diff options
Diffstat (limited to 'util.cpp')
| -rw-r--r-- | util.cpp | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/util.cpp b/util.cpp index 868161f..5ccfe51 100644 --- a/util.cpp +++ b/util.cpp | |||
| @@ -11,7 +11,7 @@ void wrap(int* x, int* y) | |||
| 11 | { | 11 | { | 
| 12 | *x = *x-WIDTH; | 12 | *x = *x-WIDTH; | 
| 13 | } | 13 | } | 
| 14 | 14 | ||
| 15 | if (*y < 0) | 15 | if (*y < 0) | 
| 16 | { | 16 | { | 
| 17 | *y = HEIGHT-(0-*y); | 17 | *y = HEIGHT-(0-*y); | 
| @@ -53,10 +53,10 @@ SDL_Texture* loadImage(SDL_Renderer* renderer, std::string file) | |||
| 53 | std::cout << SDL_GetError() << std::endl; | 53 | std::cout << SDL_GetError() << std::endl; | 
| 54 | return NULL; | 54 | return NULL; | 
| 55 | } | 55 | } | 
| 56 | 56 | ||
| 57 | SDL_Texture* texture = SDL_CreateTextureFromSurface(renderer, surface); | 57 | SDL_Texture* texture = SDL_CreateTextureFromSurface(renderer, surface); | 
| 58 | SDL_FreeSurface(surface); | 58 | SDL_FreeSurface(surface); | 
| 59 | 59 | ||
| 60 | return texture; | 60 | return texture; | 
| 61 | } | 61 | } | 
| 62 | 62 | ||
| @@ -66,6 +66,6 @@ void applyTexture(SDL_Renderer* renderer, SDL_Texture* tex, int x, int y) | |||
| 66 | pos.x = x; | 66 | pos.x = x; | 
| 67 | pos.y = y; | 67 | pos.y = y; | 
| 68 | SDL_QueryTexture(tex, NULL, NULL, &pos.w, &pos.h); | 68 | SDL_QueryTexture(tex, NULL, NULL, &pos.w, &pos.h); | 
| 69 | 69 | ||
| 70 | SDL_RenderCopy(renderer, tex, NULL, &pos); | 70 | SDL_RenderCopy(renderer, tex, NULL, &pos); | 
| 71 | } \ No newline at end of file | 71 | } \ No newline at end of file | 
