Changeset 124 for abuse/trunk/src/light.cpp
- Timestamp:
- Mar 18, 2008, 9:36:56 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/light.cpp
r115 r124 34 34 int32_t light_to_number(light_source *l) 35 35 { 36 36 37 37 if (!l) return 0; 38 38 int x=1; … … 49 49 light_source *s=first_light_source; 50 50 for (;x && s;x--,s=s->next); 51 return s; 51 return s; 52 52 } 53 53 … … 147 147 } 148 148 149 light_source::light_source(char Type, int32_t X, int32_t Y, int32_t Inner_radius, 150 151 { 152 type=Type; 153 x=X; y=Y; 154 inner_radius=Inner_radius; 155 outer_radius=Outer_radius; 156 next=Next; 149 light_source::light_source(char Type, int32_t X, int32_t Y, int32_t Inner_radius, 150 int32_t Outer_radius, int32_t Xshift, int32_t Yshift, light_source *Next) 151 { 152 type=Type; 153 x=X; y=Y; 154 inner_radius=Inner_radius; 155 outer_radius=Outer_radius; 156 next=Next; 157 157 known=0; 158 158 xshift=Xshift; 159 159 yshift=Yshift; 160 calc_range(); 160 calc_range(); 161 161 } 162 162 … … 170 170 } 171 171 172 light_source *add_light_source(char type, int32_t x, int32_t y, 173 172 light_source *add_light_source(char type, int32_t x, int32_t y, 173 int32_t inner, int32_t outer, int32_t xshift, int32_t yshift) 174 174 { 175 175 first_light_source=new light_source(type,x,y,inner,outer,xshift,yshift,first_light_source); … … 204 204 void calc_light_table(palette *pal) 205 205 { 206 207 208 209 // 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 // 234 235 236 237 // 238 // 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 if (r) r--; if (g) g--; if (b) b--; 261 262 263 206 white_light_initial=(uint8_t *)jmalloc(256*64,"light table"); 207 white_light=white_light_initial; 208 209 // green_light=(uint8_t *)jmalloc(256*64,"green light"); 210 int i = 0; 211 for( ; i < TTINTS; i++ ) 212 { 213 tints[i] = (uint8_t *)jmalloc( 256, "color tint" ); 214 } 215 216 char *lightpath; 217 lightpath = (char *)jmalloc( strlen( get_save_filename_prefix() ) + 9 + 1, "lightpath" ); 218 sprintf( lightpath, "%slight.tbl", get_save_filename_prefix() ); 219 220 bFILE *fp=open_file( lightpath, "rb" ); 221 int recalc = 0; 222 if( fp->open_failure() ) 223 { 224 recalc = 1; 225 } 226 else 227 { 228 if (fp->read_uint16()!=calc_crc((uint8_t *)pal->addr(),768)) 229 recalc=1; 230 else 231 { 232 fp->read(white_light,256*64); 233 // fp->read(green_light,256*64); 234 for (i=0;i<TTINTS;i++) 235 fp->read(tints[i],256); 236 fp->read(bright_tint,256); 237 // trans_table=(uint8_t *)jmalloc(256*256,"transparency table"); 238 // fp.read(trans_table,256*256); 239 } 240 } 241 delete fp; 242 fp = NULL; 243 244 if( recalc ) 245 { 246 fprintf(stderr,"Palette has changed, recalculating light table...\n"); 247 stat_man->push("white light",NULL); 248 int color=0; 249 for (;color<256;color++) 250 { 251 uint8_t r,g,b; 252 pal->get(color,r,g,b); 253 stat_man->update(color*100/256); 254 for (int intensity=63;intensity>=0;intensity--) 255 { 256 if (r>0 || g>0 || b>0) 257 white_light[intensity*256+color]=pal->find_closest(r,g,b); 258 else 259 white_light[intensity*256+color]=0; 260 if (r) r--; if (g) g--; if (b) b--; 261 } 262 } 263 stat_man->pop(); 264 264 265 265 /* stat_man->push("green light",NULL); … … 273 273 for (int intensity=63;intensity>=0;intensity--) 274 274 { 275 275 if (r>0 || g>0 || b>0) 276 276 green_light[intensity*256+color]=pal->find_closest(r,g,b); 277 277 else 278 278 green_light[intensity*256+color]=0; 279 if (r) r--; 280 281 if (g) g--; 282 279 if (r) r--; 280 if ((intensity&1)==1) 281 if (g) g--; 282 if (b) b--; 283 283 } 284 284 } … … 288 288 uint8_t t[TTINTS*6]={0,0,0,0,0,0, // normal 289 289 0,0,0,1,0,0, // red 290 291 292 293 294 295 0,0,0,0,1,1, // cyan 296 297 298 299 300 301 302 303 290 0,0,0,1,1,0, // yellow 291 0,0,0,1,0,1, // purple 292 0,0,0,1,1,1, // gray 293 0,0,0,0,1,0, // green 294 0,0,0,0,0,1, // blue 295 0,0,0,0,1,1, // cyan 296 297 298 299 300 301 302 0,0,0,0,0,0 // reverse green (night vision effect) 303 } ; 304 304 uint8_t *ti=t+6; 305 305 uint8_t *c; … … 333 333 uint8_t *tp=trans_table; 334 334 for (i=0;i<256;i++) 335 { 335 { 336 336 uint8_t r1,g1,b1,r2,g2,b2; 337 337 pal->get(i,r1,g1,b1); … … 340 340 for (int j=0;j<256;j++,tp++) 341 341 { 342 343 344 345 346 pal->get(j,r2,g2,b2); 347 348 342 if (r1==0 && r2==0 && b2==0) 343 *tp=j; 344 else 345 { 346 pal->get(j,r2,g2,b2); 347 *tp=pal->find_closest((r2-r1)*3/7+r1,(g2-g1)*3/7+g1,(b2-b1)*3/7+b1); 348 } 349 349 } 350 350 }*/ 351 351 352 352 353 354 355 356 357 358 359 353 bFILE *f = open_file( lightpath, "wb" ); 354 if( f->open_failure() ) 355 dprintf( "Unable to open file light.tbl for writing\n" ); 356 else 357 { 358 f->write_uint16(calc_crc((uint8_t *)pal->addr(),768)); 359 f->write(white_light,256*64); 360 360 // f->write(green_light,256*64); 361 362 363 361 for (int i=0;i<TTINTS;i++) 362 f->write(tints[i],256); 363 f->write(bright_tint,256); 364 364 // f.write(trans_table,256*256); 365 366 367 368 365 } 366 delete f; 367 } 368 jfree( lightpath ); 369 369 } 370 370 371 371 372 372 light_patch *light_patch::copy(light_patch *Next) 373 { 374 light_patch *p=new light_patch(x1,y1,x2,y2,Next); 373 { 374 light_patch *p=new light_patch(x1,y1,x2,y2,Next); 375 375 p->total=total; 376 if (total) 376 if (total) 377 377 { 378 378 p->lights=(light_source **)jmalloc(total*sizeof(light_source *),"light patches"); 379 379 memcpy(p->lights,lights,total*(sizeof(light_source *))); 380 380 } 381 else 382 p->lights=NULL; 381 else 382 p->lights=NULL; 383 383 return p; 384 384 } … … 404 404 } 405 405 406 void add_light(light_patch *&first, int32_t x1, int32_t y1, int32_t x2, int32_t y2, 407 408 { 406 void add_light(light_patch *&first, int32_t x1, int32_t y1, int32_t x2, int32_t y2, 407 light_source *who) 408 { 409 409 light_patch *next; 410 410 light_patch *p=first; … … 419 419 if (x1>p->x1) 420 420 { 421 422 423 421 light_patch *l=p->copy(NULL); 422 l->x2=x1-1; 423 insert_light(first,l); 424 424 } 425 425 if (x2<p->x2) 426 426 { 427 428 429 427 light_patch *l=p->copy(NULL); 428 l->x1=x2+1; 429 insert_light(first,l); 430 430 } 431 431 if (y1>p->y1) 432 432 { 433 434 435 436 437 433 light_patch *l=p->copy(NULL); 434 l->x1=x1; 435 l->x2=x2; 436 l->y2=y1-1; 437 insert_light(first,l); 438 438 } 439 439 if (y2<p->y2) 440 440 { 441 442 443 444 445 441 light_patch *l=p->copy(NULL); 442 l->x1=x1; 443 l->x2=x2; 444 l->y1=y2+1; 445 insert_light(first,l); 446 446 } 447 447 p->x1=x1; p->y1=y1; p->x2=x2; p->y2=y2; 448 // p has possibly changed it's y1, so we need to move it to it's correct sorted 448 // p has possibly changed it's y1, so we need to move it to it's correct sorted 449 449 // spot in the list 450 450 if (first==p) … … 452 452 else 453 453 { 454 455 456 454 light_patch *q=first; 455 for (;q->next!=p;q=q->next); 456 q->next=p->next; 457 457 } 458 458 insert_light(first,p); 459 460 461 p->total++; 459 460 461 p->total++; 462 462 p->lights=(light_source **)jrealloc(p->lights,sizeof(light_source *)*p->total,"patch_list"); 463 463 p->lights[p->total-1]=who; … … 477 477 add_light(first,p->x1,p->y2+1,p->x2,y2,who); 478 478 if (p->total==MAX_LP) return ; 479 p->total++; 479 p->total++; 480 480 p->lights=(light_source **)jrealloc(p->lights,sizeof(light_source *)*p->total,"patch_list"); 481 481 p->lights[p->total-1]=who; … … 484 484 485 485 // see if we intersect another rect 486 if (!(x2<p->x1 || y2<p->y1 || x1>p->x2 || y1>p->y2)) 486 if (!(x2<p->x1 || y2<p->y1 || x1>p->x2 || y1>p->y2)) 487 487 { 488 488 int ax1,ay1,ax2,ay2; … … 490 490 { 491 491 add_light(first,x1,max(y1,p->y1),p->x1-1,min(y2,p->y2),who); 492 492 ax1=p->x1; 493 493 } else 494 494 ax1=x1; 495 495 496 496 if (x2>p->x2) 497 497 { 498 498 add_light(first,p->x2+1,max(y1,p->y1),x2,min(y2,p->y2),who); 499 500 } 499 ax2=p->x2; 500 } 501 501 else 502 502 ax2=x2; 503 503 504 504 if (y1<p->y1) 505 { 505 { 506 506 add_light(first,x1,y1,x2,p->y1-1,who); 507 508 } else 509 507 ay1=p->y1; 508 } else 509 ay1=y1; 510 510 511 511 if (y2>p->y2) 512 512 { 513 513 add_light(first,x1,p->y2+1,x2,y2,who); 514 515 } else 516 517 518 519 add_light(first,ax1,ay1,ax2,ay2,who); 520 521 return ; 522 } 523 } 524 } 525 514 ay2=p->y2; 515 } else 516 ay2=y2; 517 518 519 add_light(first,ax1,ay1,ax2,ay2,who); 520 521 return ; 522 } 523 } 524 } 525 526 526 light_patch *find_patch(int screenx, int screeny, light_patch *list) 527 527 { … … 540 540 int t=which->total; 541 541 for (register int i=t-1;i>=0;i--) 542 { 542 { 543 543 light_source *fn=which->lights[i]; 544 544 if (fn->type==9) … … 555 555 r2=dx+dy-(dx>>1); 556 556 else r2=dx+dy-(dy>>1); 557 557 558 558 if (r2>=fn->inner_radius) 559 559 { 560 561 562 563 564 } else lv=63; 565 } 566 } 567 if (lv>63) return 63; 560 if (r2<fn->outer_radius) 561 { 562 lv+=((fn->outer_radius-r2)*fn->mul_div)>>16; 563 } 564 } else lv=63; 565 } 566 } 567 if (lv>63) return 63; 568 568 else 569 569 return lv; … … 573 573 void reduce_patches(light_patch *f) // find constant valued patches 574 574 { 575 575 576 576 } 577 577 … … 609 609 610 610 inline void MAP_PUT(uint8_t * screen_addr, uint8_t * remap, int w) 611 { 611 { 612 612 register int cx=w; 613 613 register uint8_t * di=screen_addr; 614 614 register uint8_t * si=remap; 615 while (cx--) 615 while (cx--) 616 616 { 617 617 uint8_t x=*((uint8_t *)si+*((uint8_t *)di)); … … 621 621 622 622 inline void MAP_2PUT(uint8_t * in_addr, uint8_t * out_addr, uint8_t * remap, int w) 623 { 624 while (w--) 623 { 624 while (w--) 625 625 { 626 626 uint8_t x=*(((uint8_t *)remap)+(*(uint8_t *)(in_addr++))); … … 633 633 // calculate the light value for this block. sum up all contritors 634 634 inline int calc_light_value(light_patch *lp, // light patch to look at 635 636 635 int32_t sx, // screen x & y 636 int32_t sy) 637 637 { 638 638 int lv=min_light_level,r2,light_count; … … 644 644 { 645 645 light_source *fn=*lon_p; 646 register int32_t *dt=&(*lon_p)->type; 646 register int32_t *dt=&(*lon_p)->type; 647 647 // note we are accessing structure members by bypassing the compiler 648 648 // for speed, this may not work on all compilers, but don't 649 649 // see why it shouldn't.. all members are int32_t 650 650 651 651 if (*dt==9) // (dt==type), if light is a Solid rectangle, return it value 652 652 return fn->inner_radius; … … 655 655 dt++; 656 656 dx=abs(*dt-sx); dt++; // xdist between light and this block (dt==x) 657 dx<<=*dt; dt++; // shift makes distance further, 657 dx<<=*dt; dt++; // shift makes distance further, 658 658 // making light skinner. (dt==xshift) 659 659 … … 664 664 r2=dx+dy-(dx>>1); 665 665 else r2=dx+dy-(dy>>1); 666 666 667 667 if (r2<*dt) // if this withing the light's outer radius? (dt==outer_radius) 668 { 669 int v=*dt-r2; dt++; 670 668 { 669 int v=*dt-r2; dt++; 670 lv+=v*(*dt)>>16; 671 671 } 672 672 } … … 674 674 } 675 675 676 if (lv>63) 677 return 63; // lighting table only has 64 (256 bytes) entries 676 if (lv>63) 677 return 63; // lighting table only has 64 (256 bytes) entries 678 678 else return lv; 679 679 } … … 685 685 while (count--) 686 686 { 687 uint8_t *off=light_lookup+(((int32_t)*remap_line)<<8); 687 uint8_t *off=light_lookup+(((int32_t)*remap_line)<<8); 688 688 remap_line++; 689 689 690 *addr=off[*addr]; 690 *addr=off[*addr]; 691 691 addr[1]=off[addr[1]]; 692 692 addr[2]=off[addr[2]]; … … 705 705 uint8_t v; 706 706 int x; 707 for (x=0;x<count;x++) 708 { 707 for (x=0;x<count;x++) 708 { 709 709 uint8_t *off=light_lookup+(((int32_t)*remap)<<8); 710 710 … … 753 753 ambient=shutdown_lighting_value; 754 754 755 switch (light_detail) 756 { 757 case HIGH_DETAIL : 755 switch (light_detail) 756 { 757 case HIGH_DETAIL : 758 758 { lx_run=2; ly_run=1; } break; // 4 x 2 patches 759 759 case MEDIUM_DETAIL : … … 798 798 { 799 799 int x,count; 800 // while (f->next && f->y2<y) 800 // while (f->next && f->y2<y) 801 801 // f=f->next; 802 802 uint8_t *rem=remap_line; … … 807 807 808 808 int calcy=((y+screeny)&(~3))-cy1; 809 809 810 810 811 811 if (suffix) 812 812 { 813 813 light_patch *lp=f; 814 for (;(lp->y1>y-cy1 || lp->y2<y-cy1 || 815 814 for (;(lp->y1>y-cy1 || lp->y2<y-cy1 || 815 lp->x1>suffix_x || lp->x2<suffix_x);lp=lp->next); 816 816 uint8_t * caddr=(uint8_t *)screen_line+cx2-cx1+1-suffix; 817 817 uint8_t *r=light_lookup+(((int32_t)calc_light_value(lp,suffix_x+screenx,calcy)<<8)); 818 818 switch (todoy) 819 819 { 820 821 { 822 823 824 825 826 827 828 829 { 830 831 820 case 4 : 821 { 822 MAP_PUT(caddr,r,suffix); caddr+=scr_w; 823 } 824 case 3 : 825 { MAP_PUT(caddr,r,suffix); caddr+=scr_w;} 826 case 2 : 827 { MAP_PUT(caddr,r,suffix); caddr+=scr_w;} 828 case 1 : 829 { 830 MAP_PUT(caddr,r,suffix); 831 } 832 832 } 833 833 } … … 836 836 { 837 837 light_patch *lp=f; 838 for (;(lp->y1>y-cy1 || lp->y2<y-cy1 || 839 838 for (;(lp->y1>y-cy1 || lp->y2<y-cy1 || 839 lp->x1>prefix_x || lp->x2<prefix_x);lp=lp->next); 840 840 841 841 uint8_t *r=light_lookup+(((int32_t)calc_light_value(lp,prefix_x+screenx,calcy)<<8)); … … 843 843 switch (todoy) 844 844 { 845 846 { 847 MAP_PUT(caddr,r,prefix); 848 caddr+=scr_w; 849 850 851 852 853 854 855 845 case 4 : 846 { 847 MAP_PUT(caddr,r,prefix); 848 caddr+=scr_w; 849 } 850 case 3 : 851 { MAP_PUT(caddr,r,prefix); caddr+=scr_w; } 852 case 2 : 853 { MAP_PUT(caddr,r,prefix); caddr+=scr_w; } 854 case 1 : 855 { MAP_PUT(caddr,r,prefix); } 856 856 } 857 857 screen_line+=prefix; … … 859 859 860 860 861 862 863 for (x=prefix,count=0;count<remap_size;count++,x+=8,rem++) 861 862 863 for (x=prefix,count=0;count<remap_size;count++,x+=8,rem++) 864 864 { 865 865 light_patch *lp=f; … … 870 870 switch (todoy) 871 871 { 872 case 4 : 872 case 4 : 873 873 remap_line_asm2(screen_line,light_lookup,remap_line,count); y++; todoy--; screen_line+=scr_w; 874 874 case 3 : … … 878 878 case 1 : 879 879 remap_line_asm2(screen_line,light_lookup,remap_line,count); y++; todoy--; screen_line+=scr_w; 880 } 880 } 881 881 882 882 … … 896 896 897 897 void double_light_screen(image *sc, int32_t screenx, int32_t screeny, uint8_t *light_lookup, uint16_t ambient, 898 898 image *out, int32_t out_x, int32_t out_y) 899 899 { 900 900 if (sc->width()*2+out_x>out->width() || 901 sc->height()*2+out_y>out->height()) 901 sc->height()*2+out_y>out->height()) 902 902 return ; // screen was resized and small_render has not changed size yet 903 903 904 904 905 905 int lx_run=0,ly_run; // light block x & y run size in pixels == (1<<lx_run) 906 switch (light_detail) 907 { 908 case HIGH_DETAIL : 906 switch (light_detail) 907 { 908 case HIGH_DETAIL : 909 909 { lx_run=2; ly_run=1; } break; // 4 x 2 patches 910 910 case MEDIUM_DETAIL : … … 936 936 for (x=sc->width();x;x--) 937 937 { 938 939 940 938 v=*(src++); 939 *(dst++)=v; 940 *(dst++)=v; 941 941 } 942 942 dst=dst+d_skip; … … 973 973 { 974 974 int x,count; 975 // while (f->next && f->y2<y) 975 // while (f->next && f->y2<y) 976 976 // f=f->next; 977 977 uint8_t *rem=remap_line; … … 982 982 983 983 int calcy=((y+screeny)&(~3))-cy1; 984 984 985 985 986 986 if (suffix) 987 987 { 988 988 light_patch *lp=f; 989 for (;(lp->y1>y-cy1 || lp->y2<y-cy1 || 990 989 for (;(lp->y1>y-cy1 || lp->y2<y-cy1 || 990 lp->x1>suffix_x || lp->x2<suffix_x);lp=lp->next); 991 991 uint8_t * caddr=(uint8_t *)in_line+cx2-cx1+1-suffix; 992 992 uint8_t * daddr=(uint8_t *)out_line+(cx2-cx1+1-suffix)*2; … … 995 995 switch (todoy) 996 996 { 997 case 4 : 998 { 999 1000 1001 1002 1003 { 1004 1005 1006 1007 1008 { 1009 1010 1011 1012 1013 { 1014 1015 1016 997 case 4 : 998 { 999 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; 1000 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; caddr+=scr_w; 1001 } 1002 case 3 : 1003 { 1004 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; 1005 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; caddr+=scr_w; 1006 } 1007 case 2 : 1008 { 1009 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; 1010 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; caddr+=scr_w; 1011 } 1012 case 1 : 1013 { 1014 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; 1015 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; caddr+=scr_w; 1016 } break; 1017 1017 } 1018 1018 } … … 1021 1021 { 1022 1022 light_patch *lp=f; 1023 for (;(lp->y1>y-cy1 || lp->y2<y-cy1 || 1024 1023 for (;(lp->y1>y-cy1 || lp->y2<y-cy1 || 1024 lp->x1>prefix_x || lp->x2<prefix_x);lp=lp->next); 1025 1025 1026 1026 uint8_t *r=light_lookup+(((int32_t)calc_light_value(lp,prefix_x+screenx,calcy)<<8)); … … 1029 1029 switch (todoy) 1030 1030 { 1031 1032 { 1033 1034 1035 1036 1037 { 1038 1039 1040 1041 1042 { 1043 1044 1045 1046 1047 { 1048 1049 1050 1031 case 4 : 1032 { 1033 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; 1034 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; caddr+=scr_w; 1035 } 1036 case 3 : 1037 { 1038 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; 1039 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; caddr+=scr_w; 1040 } 1041 case 2 : 1042 { 1043 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; 1044 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; caddr+=scr_w; 1045 } 1046 case 1 : 1047 { 1048 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; 1049 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; caddr+=scr_w; 1050 } break; 1051 1051 } 1052 1052 in_line+=prefix; … … 1055 1055 1056 1056 1057 1058 1059 for (x=prefix,count=0;count<remap_size;count++,x+=8,rem++) 1057 1058 1059 for (x=prefix,count=0;count<remap_size;count++,x+=8,rem++) 1060 1060 { 1061 1061 light_patch *lp=f; … … 1066 1066 rem=remap_line; 1067 1067 1068 put_8line(in_line,out_line,rem,light_lookup,count); 1068 put_8line(in_line,out_line,rem,light_lookup,count); 1069 1069 memcpy(out_line+dscr_w,out_line,count*16); 1070 1070 out_line+=dscr_w; … … 1072 1072 if (todoy) 1073 1073 { 1074 put_8line(in_line,out_line,rem,light_lookup,count); 1074 put_8line(in_line,out_line,rem,light_lookup,count); 1075 1075 memcpy(out_line+dscr_w,out_line,count*16); 1076 1076 out_line+=dscr_w; … … 1078 1078 if (todoy) 1079 1079 { 1080 put_8line(in_line,out_line,rem,light_lookup,count); 1081 1082 1083 1084 1085 1086 put_8line(in_line,out_line,rem,light_lookup,count); 1087 1088 1089 1090 1091 } 1092 } 1080 put_8line(in_line,out_line,rem,light_lookup,count); 1081 memcpy(out_line+dscr_w,out_line,count*16); 1082 out_line+=dscr_w; 1083 in_line+=scr_w; out_line+=dscr_w; y++; todoy--; 1084 if (todoy) 1085 { 1086 put_8line(in_line,out_line,rem,light_lookup,count); 1087 memcpy(out_line+dscr_w,out_line,count*16); 1088 out_line+=dscr_w; 1089 in_line+=scr_w; out_line+=dscr_w; y++; 1090 } 1091 } 1092 } 1093 1093 in_line-=prefix; 1094 1094 out_line-=prefix*2; 1095 } 1095 } 1096 1096 1097 1097 … … 1113 1113 for (light_source *f=first_light_source;f;f=f->next) 1114 1114 size+=6*4+1; 1115 sd->add_by_hand(new spec_entry(SPEC_LIGHT_LIST,"lights",NULL,size,0)); 1115 sd->add_by_hand(new spec_entry(SPEC_LIGHT_LIST,"lights",NULL,size,0)); 1116 1116 } 1117 1117 … … 1158 1158 1159 1159 light_source *p=new light_source(ty,x,y,ir,ora,xshift,yshift,NULL); 1160 1160 1161 1161 if (first_light_source) 1162 1162 last->next=p;
Note: See TracChangeset
for help on using the changeset viewer.