Fix bug 2034: replace printf by SDL_Log in tests; update loopwave VS solution: copy missing dependency

This commit is contained in:
Andreas Schiffler 2013-08-14 23:30:10 -07:00
parent a0bc602061
commit 16a40598f6
47 changed files with 616 additions and 505 deletions

View file

@ -48,7 +48,7 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
/* Load the sprite image */
temp = SDL_LoadBMP(file);
if (temp == NULL) {
fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError());
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError());
return NULL;
}
@ -79,7 +79,7 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
/* Create textures from the image */
texture = SDL_CreateTextureFromSurface(renderer, temp);
if (!texture) {
fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError());
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError());
SDL_FreeSurface(temp);
return NULL;
}
@ -129,6 +129,9 @@ main(int argc, char *argv[])
int frames;
Uint32 then, now;
/* Enable standard application logging */
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
if (!state) {
@ -139,7 +142,7 @@ main(int argc, char *argv[])
consumed = SDLTest_CommonArg(state, i);
if (consumed == 0) {
fprintf(stderr, "Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state));
SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state));
return 1;
}
i += consumed;
@ -183,7 +186,7 @@ main(int argc, char *argv[])
now = SDL_GetTicks();
if (now > then) {
double fps = ((double) frames * 1000) / (now - then);
printf("%2.2f frames per second\n", fps);
SDL_Log("%2.2f frames per second\n", fps);
}
SDL_stack_free(drawstates);