Removed width/height parameters from LoadTexture()
You can directly access the texture width and height now.
This commit is contained in:
parent
dcb97a5f49
commit
efe122be4d
14 changed files with 49 additions and 70 deletions
|
@ -53,16 +53,18 @@ void SDL_AppQuit(void *appstate, SDL_AppResult result)
|
|||
|
||||
static int LoadSprite(const char *file)
|
||||
{
|
||||
int i, w, h;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < state->num_windows; ++i) {
|
||||
/* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */
|
||||
if (sprites[i]) {
|
||||
SDL_DestroyTexture(sprites[i]);
|
||||
}
|
||||
sprites[i] = LoadTexture(state->renderers[i], file, true, &w, &h);
|
||||
sprite_w = (float)w;
|
||||
sprite_h = (float)h;
|
||||
sprites[i] = LoadTexture(state->renderers[i], file, true);
|
||||
if (sprites[i]) {
|
||||
sprite_w = (float)sprites[i]->w;
|
||||
sprite_h = (float)sprites[i]->h;
|
||||
}
|
||||
if (!sprites[i]) {
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue