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

@ -46,7 +46,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;
}
@ -77,7 +77,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;
}
@ -114,7 +114,7 @@ DrawComposite(DrawState *s)
SDL_RenderCopy(s->renderer, A, NULL, NULL);
SDL_RenderReadPixels(s->renderer, NULL, SDL_PIXELFORMAT_ARGB8888, &P, sizeof(P));
printf("Blended pixel: 0x%8.8X\n", P);
SDL_Log("Blended pixel: 0x%8.8X\n", P);
SDL_DestroyTexture(A);
SDL_DestroyTexture(B);
@ -218,6 +218,9 @@ main(int argc, char *argv[])
Uint32 then, now;
SDL_bool test_composite = SDL_FALSE;
/* 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) {
@ -235,8 +238,7 @@ main(int argc, char *argv[])
}
}
if (consumed < 0) {
fprintf(stderr,
"Usage: %s %s [--composite]\n",
SDL_Log("Usage: %s %s [--composite]\n",
argv[0], SDLTest_CommonUsage(state));
quit(1);
}
@ -289,7 +291,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);