comparison Renderer/Engine/spe/DrawSpan.cc @ 994:33616b2789de

SDL mode fix
author yutaka@charles.cr.ie.u-ryukyu.ac.jp
date Mon, 11 Oct 2010 14:21:02 +0900
parents 05696567d1d2
children
comparison
equal deleted inserted replaced
993:8024a3a44832 994:33616b2789de
214 updateBuffer(Gptr g, float zpos, int rangex, int localx, int localy, int tex_x, int tex_y, 214 updateBuffer(Gptr g, float zpos, int rangex, int localx, int localy, int tex_x, int tex_y,
215 float normal_x, float normal_y, float normal_z, TilePtr tile, 215 float normal_x, float normal_y, float normal_z, TilePtr tile,
216 int world_x, int world_y, float world_z, SchedTask *smanager) 216 int world_x, int world_y, float world_z, SchedTask *smanager)
217 { 217 {
218 218
219 int color = get_rgb(tex_x, tex_y, tile); 219 uint32 color = get_rgb(tex_x, tex_y, tile);
220 /*下位4bitを抽出*/ 220 /*下位4bitを抽出*/
221 #if LITTLEENDIAN 221 #if LITTLEENDIAN
222 int alpha = color & 0x000000ff; 222 int alpha = color & 0x000000ff;
223 #else 223 #else
224 int alpha = color & 0xff000000; 224 int alpha = color & 0xff000000;
225 #endif 225 #endif
226 /*完全に透けているか判断*/ 226
227 //完全に透けているか判断
227 int flag = (alpha != 0 && normal_z < 0); 228 int flag = (alpha != 0 && normal_z < 0);
228 int *light_sysswitch = (int*)smanager->global_get(LightSysSwitch); 229 int *light_sysswitch = (int*)smanager->global_get(LightSysSwitch);
229 //smanager->printf("sys %d\n",light_sysswitch); 230 //smanager->printf("sys %d\n",light_sysswitch);
230 231
231 if ( *light_sysswitch == 1 && flag) { 232 if ( *light_sysswitch == 1 && flag) {
233 smanager,localx,localy,zpos, 234 smanager,localx,localy,zpos,
234 world_x,world_y,world_z); 235 world_x,world_y,world_z);
235 } 236 }
236 237
237 g->zRow[localx + (rangex*localy)] = zpos*flag + g->zRow[localx + (rangex*localy)]*(1-flag); 238 g->zRow[localx + (rangex*localy)] = zpos*flag + g->zRow[localx + (rangex*localy)]*(1-flag);
238 int *point = &g->linebuf[localy][localx] ; 239 int *point = &g->linebuf[localy][localx];
239 *point = color*flag + *point *(1-flag); 240 *point = color*flag + *point *(1-flag);
240
241
242 241
243 } 242 }
244 243
245 /** 244 /**
246 * 長さが 1 の Span の描画 (要するに 1 pixel) 245 * 長さが 1 の Span の描画 (要するに 1 pixel)
512 511
513 return 0; 512 return 0;
514 513
515 } 514 }
516 515
517
518 G g0; 516 G g0;
519 Gptr g = &g0; 517 Gptr g = &g0;
520 518
521 SpanPackPtr spack = (SpanPackPtr)smanager->get_input(0); 519 SpanPackPtr spack = (SpanPackPtr)smanager->get_input(0);
522 SpanPackPtr next_spack = (SpanPackPtr)smanager->allocate(sizeof(SpanPack)); 520 SpanPackPtr next_spack = (SpanPackPtr)smanager->allocate(sizeof(SpanPack));
564 SpanPtr next_span; 562 SpanPtr next_span;
565 563
566 span = &spack->span[t]; 564 span = &spack->span[t];
567 565
568 if (span->length_x != 1) { 566 if (span->length_x != 1) {
569 drawLine1( 567 drawLine1(
570 smanager, g, 568 smanager, g,
571 span, rangex_start, rangex_end, tl_tag[tl_tag_flg1]); 569 span, rangex_start, rangex_end, tl_tag[tl_tag_flg1]);
572 } else { 570 } else {
573 drawDot1( 571 drawDot1(
574 smanager, g, 572 smanager, g,
575 span, rangex_start, rangex_end, tl_tag[tl_tag_flg1]); 573 span, rangex_start, rangex_end, tl_tag[tl_tag_flg1]);
576 } 574 }
577 next_span = span; 575 next_span = span;
578 576
579 resume_span = next_span; 577 resume_span = next_span;
580 578