comparison test/testsprite2.c @ 4884:27ab20a36eba

- added directx include path to VS2008 solution - updated shape vcproj and add it to VS2008 solution - minor changes (i.e. typecasting) to get rid of compiler warnings in VS
author Andreas Schiffler <aschiffler@ferzkopp.net>
date Wed, 15 Sep 2010 22:15:47 -0700
parents cd2523c69d3e
children aa8888658021
comparison
equal deleted inserted replaced
4883:511948f4919e 4884:27ab20a36eba
313 velocities = (SDL_Rect *) SDL_malloc(num_sprites * sizeof(SDL_Rect)); 313 velocities = (SDL_Rect *) SDL_malloc(num_sprites * sizeof(SDL_Rect));
314 if (!positions || !velocities) { 314 if (!positions || !velocities) {
315 fprintf(stderr, "Out of memory!\n"); 315 fprintf(stderr, "Out of memory!\n");
316 quit(2); 316 quit(2);
317 } 317 }
318 srand(time(NULL)); 318 srand((unsigned int)time(NULL));
319 if (scaleMode != SDL_TEXTURESCALEMODE_NONE) { 319 if (scaleMode != SDL_TEXTURESCALEMODE_NONE) {
320 sprite_w += sprite_w / 2; 320 sprite_w += sprite_w / 2;
321 sprite_h += sprite_h / 2; 321 sprite_h += sprite_h / 2;
322 } 322 }
323 for (i = 0; i < num_sprites; ++i) { 323 for (i = 0; i < num_sprites; ++i) {
366 if (now > then) { 366 if (now > then) {
367 double fps = ((double) frames * 1000) / (now - then); 367 double fps = ((double) frames * 1000) / (now - then);
368 printf("%2.2f frames per second\n", fps); 368 printf("%2.2f frames per second\n", fps);
369 } 369 }
370 quit(0); 370 quit(0);
371 return 0;
371 } 372 }
372 373
373 /* vi: set ts=4 sw=4 expandtab: */ 374 /* vi: set ts=4 sw=4 expandtab: */