Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Switched the test code over to use the common functions in the test l…

…ibrary.
  • Loading branch information
slouken committed Dec 31, 2012
1 parent 9a337c7 commit 09c8cfd2c129eb8e2d9f6428f9ee8a8e3adb9107

File 6 of 16 in 09c8cfd

@@ -16,11 +16,11 @@
#include <stdio.h>
#include <time.h>

#include "common.h"
#include "SDL_test_common.h"

#define NUM_OBJECTS 100

static CommonState *state;
static SDLTest_CommonState *state;
static int num_objects;
static SDL_bool cycle_color;
static SDL_bool cycle_alpha;
@@ -180,14 +180,14 @@ main(int argc, char *argv[])
num_objects = NUM_OBJECTS;

/* Initialize test framework */
state = CommonCreateState(argv, SDL_INIT_VIDEO);
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
if (!state) {
return 1;
}
for (i = 1; i < argc;) {
int consumed;

consumed = CommonArg(state, i);
consumed = SDLTest_CommonArg(state, i);
if (consumed == 0) {
consumed = -1;
if (SDL_strcasecmp(argv[i], "--blend") == 0) {
@@ -220,12 +220,12 @@ main(int argc, char *argv[])
if (consumed < 0) {
fprintf(stderr,
"Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha]\n",
argv[0], CommonUsage(state));
argv[0], SDLTest_CommonUsage(state));
return 1;
}
i += consumed;
}
if (!CommonInit(state)) {
if (!SDLTest_CommonInit(state)) {
return 2;
}

@@ -247,7 +247,7 @@ main(int argc, char *argv[])
/* Check for events */
++frames;
while (SDL_PollEvent(&event)) {
CommonEvent(state, &event, &done);
SDLTest_CommonEvent(state, &event, &done);
}
for (i = 0; i < state->num_windows; ++i) {
SDL_Renderer *renderer = state->renderers[i];
@@ -262,7 +262,7 @@ main(int argc, char *argv[])
}
}

CommonQuit(state);
SDLTest_CommonQuit(state);

/* Print out some timing information */
now = SDL_GetTicks();

0 comments on commit 09c8cfd

Please sign in to comment.