changeset 1054:ab16fc9a6570 draft

light fix..?
author Yutaka_Kinjyo
date Sun, 12 Dec 2010 05:57:37 +0900
parents f18b2932fdf5
children 9ce0480cde63
files Renderer/Engine/spe/DrawSpan.cc Renderer/Engine/task/DrawSpan.cc
diffstat 2 files changed, 11 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/spe/DrawSpan.cc	Fri Dec 10 09:47:01 2010 +0900
+++ b/Renderer/Engine/spe/DrawSpan.cc	Sun Dec 12 05:57:37 2010 +0900
@@ -225,7 +225,7 @@
 #endif
 
     //完全に透けているか判断
-    int flag = (alpha != 0 && normal_z < 0);
+    int flag = (alpha != 0);
     int *light_sysswitch = (int*)smanager->global_get(LightSysSwitch);
     //smanager->printf("sys %d\n",light_sysswitch);
 
--- a/Renderer/Engine/task/DrawSpan.cc	Fri Dec 10 09:47:01 2010 +0900
+++ b/Renderer/Engine/task/DrawSpan.cc	Sun Dec 12 05:57:37 2010 +0900
@@ -195,29 +195,23 @@
     int alpha = color & 0xff000000;
 #endif
 
-    //int *light_sysswitch = (int*)smanager->global_get(LightSysSwitch);
-
-
-    /*完全に透けているか判断, 法線ベクトルが奥を向いてるかどうか*/
-    //int flag = (alpha != 0 && normal_z < 0);
+    
+    //完全に透けているか判断
     int flag = (alpha != 0);
+    int *light_sysswitch = (int*)smanager->global_get(LightSysSwitch);
+    //smanager->printf("sys %d\n",light_sysswitch);
 
-    //printf("light_sysswitch %d\n",light_sysswitch);
-
-    //if ( *light_sysswitch == 1) {
-    if (flag) {
-           color = infinity_light_calc(color,normal_x,normal_y,normal_z,
-      				  smanager,localx,localy,zpos,
-      				  world_x,world_y,world_z);
+    if ( *light_sysswitch == 1 && flag) {
+        color = infinity_light_calc(color,normal_x,normal_y,normal_z,
+				    smanager,localx,localy,zpos,
+				    world_x,world_y,world_z);
     }
-      //}
 
     g->zRow[localx + (rangex*localy)] = zpos*flag + g->zRow[localx + (rangex*localy)]*(1-flag);
-    int *point = &g->linebuf[localy][localx] ;
+    int *point = &g->linebuf[localy][localx];
     *point =  color*flag + *point *(1-flag);
 
-
-
+    
 }
 
 /**