comparison test/nds-test-progs/sprite2/source/testsprite2.c @ 2698:e1da92da346c gsoc2008_nds

Clean up.
author Darren Alton <dalton@stevens.edu>
date Wed, 27 Aug 2008 04:23:38 +0000
parents c04a266c277a
children
comparison
equal deleted inserted replaced
2697:c9121b04cffa 2698:e1da92da346c
79 79
80 /* We're ready to roll. :) */ 80 /* We're ready to roll. :) */
81 return (0); 81 return (0);
82 } 82 }
83 83
84 int LoadSprite2(const u8* ptr, int size) { 84 int
85 LoadSprite2(const u8 * ptr, int size)
86 {
85 int i; 87 int i;
86 SDL_Rect r = {0,0,32,32}; 88 SDL_Rect r = { 0, 0, 32, 32 };
87 for (i = 0; i < state->num_windows; ++i) { 89 for (i = 0; i < state->num_windows; ++i) {
88 SDL_SelectRenderer(state->windows[i]); 90 SDL_SelectRenderer(state->windows[i]);
89 sprites[i] = SDL_CreateTexture(SDL_PIXELFORMAT_ABGR1555, 91 sprites[i] = SDL_CreateTexture(SDL_PIXELFORMAT_ABGR1555,
90 SDL_TEXTUREACCESS_STATIC, r.w, r.h); 92 SDL_TEXTUREACCESS_STATIC, r.w, r.h);
91 if (!sprites[i]) { 93 if (!sprites[i]) {
92 fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError()); 94 fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError());
93 return -1; 95 return -1;
94 } 96 }
95 SDL_UpdateTexture(sprites[i], &r, ptr, r.w*2); 97 SDL_UpdateTexture(sprites[i], &r, ptr, r.w * 2);
96 SDL_SetTextureBlendMode(sprites[i], blendMode); 98 SDL_SetTextureBlendMode(sprites[i], blendMode);
97 SDL_SetTextureScaleMode(sprites[i], scaleMode); 99 SDL_SetTextureScaleMode(sprites[i], scaleMode);
98 } 100 }
99 return 0; 101 return 0;
100 } 102 }
168 { 170 {
169 int i, done; 171 int i, done;
170 SDL_Event event; 172 SDL_Event event;
171 Uint32 then, now, frames; 173 Uint32 then, now, frames;
172 174
173 consoleDemoInit(); puts("Hello world! Initializing FAT..."); 175 consoleDemoInit();
176 puts("Hello world! Initializing FAT...");
174 fatInitDefault(); 177 fatInitDefault();
175 178
176 /* Initialize parameters */ 179 /* Initialize parameters */
177 num_sprites = NUM_SPRITES; 180 num_sprites = NUM_SPRITES;
178 181