changeset 1184:5abf0ce8c71c draft

texture hash fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 06 Jul 2011 21:05:06 +0900
parents d7486d6a5e37
children 6147dd81b4c7
files Renderer/Engine/Makefile.def Renderer/Engine/SceneGraph.cc Renderer/Engine/TextureHash.cc Renderer/Test/Makefile.def TaskManager/Makefile.def
diffstat 5 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/Makefile.def	Tue Jun 07 17:55:20 2011 +0900
+++ b/Renderer/Engine/Makefile.def	Wed Jul 06 21:05:06 2011 +0900
@@ -6,8 +6,8 @@
 ABI = -m$(ABIBIT)
 CC      = g++
 
-#OPT	=  -g -DUSE_TASKARRAY -DUSE_PIPELINE -DUSE_SEGMENT 
- OPT	= -O9 -DUSE_TASKARRAY -DUSE_PIPELINE -DUSE_SEGMENT  
+OPT	=  -g -DUSE_TASKARRAY -DUSE_PIPELINE -DUSE_SEGMENT 
+# OPT	= -O9 -DUSE_TASKARRAY -DUSE_PIPELINE -DUSE_SEGMENT  
 
 CFLAGS  = -Wall $(ABI) $(OPT)  #  -DDEBUG
 
--- a/Renderer/Engine/SceneGraph.cc	Tue Jun 07 17:55:20 2011 +0900
+++ b/Renderer/Engine/SceneGraph.cc	Wed Jul 06 21:05:06 2011 +0900
@@ -616,7 +616,7 @@
      * image_name を既に Load していれば何もしない
      */
     int tex_id;
-    if (!texture_hash.hash_regist(filename, tex_id)) {
+    if (texture_hash.sg_hash_regist(filename, tex_id) == -1) {
 
         SDL_Surface *texture_image = load_decode_image(filename, image_name, cur);
 	if (texture_image==0) {
--- a/Renderer/Engine/TextureHash.cc	Tue Jun 07 17:55:20 2011 +0900
+++ b/Renderer/Engine/TextureHash.cc	Wed Jul 06 21:05:06 2011 +0900
@@ -44,7 +44,7 @@
     if (table[hash].tx_id == -1) {
       table[hash].key   = (char*)key;
       id = id_count++;
-      return 0;
+      return -1;
       
     } else if (strcmp(key, table[hash].key) == 0
 	       && table[hash].tx_id != -1){
@@ -64,7 +64,7 @@
         if (table[hash].tx_id == -1) {
             table[hash].key   = (char*)key;
 	    table[hash].tx_id = id;
-            return 0;
+            return -1;
 
         } else if (strcmp(key, table[hash].key) == 0
                    && table[hash].tx_id != -1){
--- a/Renderer/Test/Makefile.def	Tue Jun 07 17:55:20 2011 +0900
+++ b/Renderer/Test/Makefile.def	Wed Jul 06 21:05:06 2011 +0900
@@ -4,8 +4,8 @@
 ABIBIT = 64
 ABI =  -m$(ABIBIT)
 CC      = g++
-#CFLAGS  =  -Wall $(ABI) -g
-CFLAGS  =  -Wall $(ABI) -O9 #-g   # -O -DDEBUG
+CFLAGS  =  -Wall $(ABI) -g
+# CFLAGS  =  -Wall $(ABI) -O9 #-g   # -O -DDEBUG
 
 
 INCLUDE = -I$(CERIUM)/include/TaskManager -I$(CERIUM)/Renderer/Engine -I. -I$(CERIUM)/include/Cerium
--- a/TaskManager/Makefile.def	Tue Jun 07 17:55:20 2011 +0900
+++ b/TaskManager/Makefile.def	Wed Jul 06 21:05:06 2011 +0900
@@ -29,8 +29,8 @@
 
 ABIBIT = 64
 
-#OPT = -g -DMAIL_QUEUE -DNOT_CHECK #-DTASK_LIST_MAIL #-DEARLY_TOUCH -DUSE_CACHE
-OPT = -O9 -DMAIL_QUEUE -DNOT_CHECK #-DTASK_LIST_MAIL #-DEARLY_TOUCH -DUSE_CACHE 
+OPT = -g -DMAIL_QUEUE -DNOT_CHECK #-DTASK_LIST_MAIL #-DEARLY_TOUCH -DUSE_CACHE
+# OPT = -O9 -DMAIL_QUEUE -DNOT_CHECK #-DTASK_LIST_MAIL #-DEARLY_TOUCH -DUSE_CACHE