Changeset 162
- Timestamp:
- Aug 11, 2009, 10:56:57 PM (14 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/cache.cpp
r147 r162 511 511 } 512 512 513 uint32_t tsaved=fp->read_uint32();513 int tsaved = fp->read_uint32(); 514 514 515 515 … … 1193 1193 void CacheList::free_oldest() 1194 1194 { 1195 uint32_t i,old_time=last_access;1195 int32_t old_time = last_access; 1196 1196 CacheItem *ci=list,*oldest=NULL; 1197 1197 ful=1; 1198 1198 1199 for (i =0;i<total;i++,ci++)1200 { 1201 if (ci->data && ci->last_access <old_time)1202 { 1203 oldest =ci;1204 old_time =ci->last_access;1199 for (int i = 0; i < total; i++, ci++) 1200 { 1201 if (ci->data && ci->last_access < old_time) 1202 { 1203 oldest = ci; 1204 old_time = ci->last_access; 1205 1205 } 1206 1206 } -
abuse/trunk/src/director.cpp
r124 r162 85 85 dist=31; 86 86 if (y-y1<dist) 87 { 87 88 if (y-y1<1) dist=0; 88 89 else dist=y-y1; 90 } 89 91 90 92 if (y2-y<dist) 93 { 91 94 if (y2-y<1) dist=0; 92 95 else dist=y2-y; 96 } 93 97 94 98 int c=cmap[dist]; -
abuse/trunk/src/game.cpp
r136 r162 193 193 continue; 194 194 195 if( (unsigned)w >= xres - 1)195 if(w >= xres - 1) 196 196 w = xres - 2; 197 if( (unsigned)h >= yres - 1)197 if(h >= yres - 1) 198 198 h = yres - 2; 199 199 f->suggest.cx1 = (xres + 1) / 2 - w / 2; -
abuse/trunk/src/imlib/palette.cpp
r134 r162 261 261 else if (ncolors==16) 262 262 for (i=0;i<ncolors;i++) 263 set(i,255- i&3,255-(i&4)>>2,255-(i&8)>>3);263 set(i,255-(i&3),255-(i&4)>>2,255-(i&8)>>3); 264 264 else 265 265 for (i=0;i<ncolors;i++) 266 set(i,255- i%3,255-(i+1)%3,255-(i+2)%3);266 set(i,255-(i%3),255-((i+1)%3),255-((i+2)%3)); 267 267 } 268 268 -
abuse/trunk/src/imlib/pmenu.cpp
r131 r162 189 189 x=cx2-w-parent->x; 190 190 if (h+y+parent->y>cy2) 191 { 191 192 if (parent->y+parent->h+wm->font()->height()>cy2) 192 193 y=-h; 193 else y=y-h+wm->font()->height()+5; 194 else y=y-h+wm->font()->height()+5; 195 } 194 196 195 197 -
abuse/trunk/src/imlib/specs.cpp
r129 r162 433 433 for (s=access_string;*s;s++) 434 434 if (toupper(*s)=='W') 435 { 435 436 if (access) 436 437 access=O_RDWR; 437 438 else access=O_WRONLY; 439 } 438 440 439 441 for (s=access_string;*s;s++) … … 627 629 { 628 630 double a; 629 write_uint32((long)(modf(x,&a)*(double)(1<<3 2-1)));631 write_uint32((long)(modf(x,&a)*(double)(1<<31))); 630 632 write_uint32((long)a); 631 633 } … … 636 638 a=read_uint32(); 637 639 b=read_uint32(); 638 return (double)b+a/(double)(1<<3 2-1);640 return (double)b+a/(double)(1<<31); 639 641 } 640 642 -
abuse/trunk/src/imlib/video.hpp
r57 r162 24 24 25 25 extern unsigned char current_background; 26 extern unsignedint xres,yres;26 extern int xres,yres; 27 27 extern int xoff,yoff; 28 28 extern image *screen; -
abuse/trunk/src/lisp/lisp.cpp
r133 r162 3115 3115 void lisp_init(long perm_size, long tmp_size) 3116 3116 { 3117 int i;3117 unsigned int i; 3118 3118 lsym_root=NULL; 3119 3119 total_user_functions=0; -
abuse/trunk/src/loadgame.cpp
r124 r162 94 94 int w=cache.img(save_buts[0])->width(); 95 95 int mx=last_demo_mx-w/2; 96 if( (unsigned)(mx + w + 10)> xres) mx = xres - w - 10;97 if( 96 if(mx + w + 10 > xres) mx = xres - w - 10; 97 if(mx < 0) mx = 0; 98 98 99 99 Jwindow *l_win=create_num_window(mx,MAX_SAVE_GAMES,NULL); -
abuse/trunk/src/net/tcpip.cpp
r150 r162 28 28 FILE *log_file=NULL; 29 29 extern int net_start(); 30 void net_log(char *st, void *buf, long size) 30 31 static void net_log(char const *st, void *buf, long size) 31 32 { 32 33 … … 40 41 41 42 42 fprintf(log_file,"%s% d - ",st,size);43 fprintf(log_file,"%s%ld - ",st,size); 43 44 int i; 44 45 for (i=0;i<size;i++) … … 50 51 51 52 for (i=0;i<size;i++) 52 fprintf(log_file,"%02x, ",*((unsigned char *)buf+i) ,*((unsigned char *)buf+i));53 fprintf(log_file,"%02x, ",*((unsigned char *)buf+i)); 53 54 fprintf(log_file,"\n"); 54 55 fflush(log_file); … … 193 194 } 194 195 tmp[i] = num; 195 if (*np == ':' & !force_port)196 if (*np == ':' && !force_port) 196 197 { 197 198 int x; -
abuse/trunk/src/objects.cpp
r129 r162 1371 1371 set_state(run_jump); 1372 1372 if (xvel()!=0) 1373 { 1373 1374 if (direction>0) 1374 1375 set_xvel(get_ability(type(),jump_top_speed)); 1375 1376 else 1376 1377 set_xvel(-get_ability(type(),jump_top_speed)); 1378 } 1377 1379 set_xacel(0); 1378 1380 -
abuse/trunk/src/sdlport/setup.cpp
r149 r162 43 43 keys_struct keys; 44 44 45 extern unsignedint xres, yres;45 extern int xres, yres; 46 46 static unsigned int scale; 47 47 -
abuse/trunk/src/sdlport/video.cpp
r142 r162 43 43 unsigned char current_background; 44 44 int win_xscale, win_yscale, mouse_xscale, mouse_yscale; 45 unsignedint xres, yres;45 int xres, yres; 46 46 47 47 extern palette *lastl; … … 238 238 Uint16 dinset; 239 239 240 if( (unsigned)y > yres || (unsigned)x > xres)240 if(y > yres || x > xres) 241 241 return; 242 242 … … 250 250 } 251 251 srcrect.x = x1; 252 if( (unsigned)(x + (x2 - x1)) >= xres)252 if(x + (x2 - x1) >= xres) 253 253 xe = xres - x + x1 - 1; 254 254 else … … 261 261 } 262 262 srcrect.y = y1; 263 if( (unsigned)(y + (y2 - y1)) >= yres)263 if(y + (y2 - y1) >= yres) 264 264 ye = yres - y + y1 - 1; 265 265 else
Note: See TracChangeset
for help on using the changeset viewer.