test/nds-test-progs/sprite2/source/testsprite2.c
changeset 2750 e3affc66d963
parent 2735 204be4fc2726
child 2884 9dde605c7540
     1.1 --- a/test/nds-test-progs/sprite2/source/testsprite2.c	Sat Sep 06 00:10:16 2008 +0000
     1.2 +++ b/test/nds-test-progs/sprite2/source/testsprite2.c	Sat Sep 06 04:31:34 2008 +0000
     1.3 @@ -7,8 +7,6 @@
     1.4  #include <fat.h>
     1.5  #include "common.h"
     1.6  
     1.7 -#include "icon_bmp_bin.h"
     1.8 -
     1.9  #define NUM_SPRITES	10
    1.10  #define MAX_SPEED 	1
    1.11  
    1.12 @@ -184,66 +182,7 @@
    1.13      if (!state) {
    1.14          return 1;
    1.15      }
    1.16 -    for (i = 1; i < argc;) {
    1.17 -        int consumed;
    1.18  
    1.19 -        consumed = CommonArg(state, i);
    1.20 -        if (consumed == 0) {
    1.21 -            consumed = -1;
    1.22 -            if (SDL_strcasecmp(argv[i], "--blend") == 0) {
    1.23 -                if (argv[i + 1]) {
    1.24 -                    if (SDL_strcasecmp(argv[i + 1], "none") == 0) {
    1.25 -                        blendMode = SDL_TEXTUREBLENDMODE_NONE;
    1.26 -                        consumed = 2;
    1.27 -                    } else if (SDL_strcasecmp(argv[i + 1], "mask") == 0) {
    1.28 -                        blendMode = SDL_TEXTUREBLENDMODE_MASK;
    1.29 -                        consumed = 2;
    1.30 -                    } else if (SDL_strcasecmp(argv[i + 1], "blend") == 0) {
    1.31 -                        blendMode = SDL_TEXTUREBLENDMODE_BLEND;
    1.32 -                        consumed = 2;
    1.33 -                    } else if (SDL_strcasecmp(argv[i + 1], "add") == 0) {
    1.34 -                        blendMode = SDL_TEXTUREBLENDMODE_ADD;
    1.35 -                        consumed = 2;
    1.36 -                    } else if (SDL_strcasecmp(argv[i + 1], "mod") == 0) {
    1.37 -                        blendMode = SDL_TEXTUREBLENDMODE_MOD;
    1.38 -                        consumed = 2;
    1.39 -                    }
    1.40 -                }
    1.41 -            } else if (SDL_strcasecmp(argv[i], "--scale") == 0) {
    1.42 -                if (argv[i + 1]) {
    1.43 -                    if (SDL_strcasecmp(argv[i + 1], "none") == 0) {
    1.44 -                        scaleMode = SDL_TEXTURESCALEMODE_NONE;
    1.45 -                        consumed = 2;
    1.46 -                    } else if (SDL_strcasecmp(argv[i + 1], "fast") == 0) {
    1.47 -                        scaleMode = SDL_TEXTURESCALEMODE_FAST;
    1.48 -                        consumed = 2;
    1.49 -                    } else if (SDL_strcasecmp(argv[i + 1], "slow") == 0) {
    1.50 -                        scaleMode = SDL_TEXTURESCALEMODE_SLOW;
    1.51 -                        consumed = 2;
    1.52 -                    } else if (SDL_strcasecmp(argv[i + 1], "best") == 0) {
    1.53 -                        scaleMode = SDL_TEXTURESCALEMODE_BEST;
    1.54 -                        consumed = 2;
    1.55 -                    }
    1.56 -                }
    1.57 -            } else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) {
    1.58 -                cycle_color = SDL_TRUE;
    1.59 -                consumed = 1;
    1.60 -            } else if (SDL_strcasecmp(argv[i], "--cyclealpha") == 0) {
    1.61 -                cycle_alpha = SDL_TRUE;
    1.62 -                consumed = 1;
    1.63 -            } else if (SDL_isdigit(*argv[i])) {
    1.64 -                num_sprites = SDL_atoi(argv[i]);
    1.65 -                consumed = 1;
    1.66 -            }
    1.67 -        }
    1.68 -        if (consumed < 0) {
    1.69 -            fprintf(stderr,
    1.70 -                    "Usage: %s %s [--blend none|mask|blend|add|mod] [--scale none|fast|slow|best] [--cyclecolor] [--cyclealpha]\n",
    1.71 -                    argv[0], CommonUsage(state));
    1.72 -            quit(1);
    1.73 -        }
    1.74 -        i += consumed;
    1.75 -    }
    1.76      if (!CommonInit(state)) {
    1.77          quit(2);
    1.78      }
    1.79 @@ -259,8 +198,9 @@
    1.80          SDL_SelectRenderer(state->windows[i]);
    1.81          SDL_RenderFill(0xA0, 0xA0, 0xA0, 0xFF, NULL);
    1.82      }
    1.83 -    if (LoadSprite2(icon_bmp_bin, icon_bmp_bin_size) < 0) {
    1.84 -        printf("errored.\n");
    1.85 +    if (LoadSprite("icon.bmp") < 0) {
    1.86 +        printf("\nerrored.\n");
    1.87 +        while (1);
    1.88          quit(2);
    1.89      }
    1.90