diff options
author | alberth <alberth@openttd.org> | 2009-06-27 20:53:45 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-06-27 20:53:45 +0000 |
commit | 9b070b5405d11c74d89a747e912e627e39850f7c (patch) | |
tree | 5143dbacaa7e860b2253b091bd195f4e2d287efc /src/video/sdl_v.cpp | |
parent | 812ad41f23b7ed52a161ed15b15a2af3a7edb41f (diff) | |
download | openttd-9b070b5405d11c74d89a747e912e627e39850f7c.tar.xz |
(svn r16677) -Codechange: Dimension width and height are unsigned.
Diffstat (limited to 'src/video/sdl_v.cpp')
-rw-r--r-- | src/video/sdl_v.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index 932832699..f00ab10bc 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -124,8 +124,8 @@ static void GetVideoModes() } else { int n = 0; for (int i = 0; modes[i]; i++) { - int w = modes[i]->w; - int h = modes[i]->h; + uint w = modes[i]->w; + uint h = modes[i]->h; int j; for (j = 0; j < n; j++) { if (_resolutions[j].width == w && _resolutions[j].height == h) break; @@ -142,7 +142,7 @@ static void GetVideoModes() } } -static void GetAvailableVideoMode(int *w, int *h) +static void GetAvailableVideoMode(uint *w, uint *h) { /* All modes available? */ if (_all_modes || _num_resolutions == 0) return; @@ -154,9 +154,9 @@ static void GetAvailableVideoMode(int *w, int *h) /* Use the closest possible resolution */ int best = 0; - uint delta = abs((_resolutions[0].width - *w) * (_resolutions[0].height - *h)); + uint delta = Delta(_resolutions[0].width, *w) * Delta(_resolutions[0].height, *h); for (int i = 1; i != _num_resolutions; ++i) { - uint newdelta = abs((_resolutions[i].width - *w) * (_resolutions[i].height - *h)); + uint newdelta = Delta(_resolutions[i].width, *w) * Delta(_resolutions[i].height, *h); if (newdelta < delta) { best = i; delta = newdelta; @@ -177,7 +177,7 @@ static void GetAvailableVideoMode(int *w, int *h) #define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_CALL SDL_RWFromFile(file, "rb"), 1) #endif -static bool CreateMainSurface(int w, int h) +static bool CreateMainSurface(uint w, uint h) { SDL_Surface *newscreen, *icon; char caption[50]; @@ -185,7 +185,7 @@ static bool CreateMainSurface(int w, int h) GetAvailableVideoMode(&w, &h); - DEBUG(driver, 1, "SDL: using mode %dx%dx%d", w, h, bpp); + DEBUG(driver, 1, "SDL: using mode %ux%ux%d", w, h, bpp); if (bpp == 0) usererror("Can't use a blitter that blits 0 bpp for normal visuals"); |