(svn r16677) -Codechange: Dimension width and height are unsigned.
This commit is contained in:
@@ -137,8 +137,8 @@ static void GetVideoModes()
|
||||
|
||||
int n = 0;
|
||||
for (int i = 0; modes[i].bpp != 0; i++) {
|
||||
int w = modes[i].width;
|
||||
int h = modes[i].height;
|
||||
uint w = modes[i].width;
|
||||
uint h = modes[i].height;
|
||||
if (w >= 640 && h >= 480) {
|
||||
int j;
|
||||
for (j = 0; j < n; j++) {
|
||||
@@ -158,7 +158,7 @@ static void GetVideoModes()
|
||||
destroy_gfx_mode_list(mode_list);
|
||||
}
|
||||
|
||||
static void GetAvailableVideoMode(int *w, int *h)
|
||||
static void GetAvailableVideoMode(uint *w, uint *h)
|
||||
{
|
||||
/* No video modes, so just try it and see where it ends */
|
||||
if (_num_resolutions == 0) return;
|
||||
@@ -170,9 +170,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;
|
||||
@@ -182,7 +182,7 @@ static void GetAvailableVideoMode(int *w, int *h)
|
||||
*h = _resolutions[best].height;
|
||||
}
|
||||
|
||||
static bool CreateMainSurface(int w, int h)
|
||||
static bool CreateMainSurface(uint w, uint h)
|
||||
{
|
||||
int bpp = BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth();
|
||||
if (bpp == 0) usererror("Can't use a blitter that blits 0 bpp for normal visuals");
|
||||
|
@@ -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");
|
||||
|
||||
|
@@ -738,7 +738,7 @@ static void FindResolutions()
|
||||
uint j;
|
||||
|
||||
for (j = 0; j < n; j++) {
|
||||
if (_resolutions[j].width == (int)dm.dmPelsWidth && _resolutions[j].height == (int)dm.dmPelsHeight) break;
|
||||
if (_resolutions[j].width == dm.dmPelsWidth && _resolutions[j].height == dm.dmPelsHeight) break;
|
||||
}
|
||||
|
||||
/* In the previous loop we have checked already existing/added resolutions if
|
||||
@@ -776,7 +776,7 @@ const char *VideoDriver_Win32::Start(const char * const *parm)
|
||||
|
||||
FindResolutions();
|
||||
|
||||
DEBUG(driver, 2, "Resolution for display: %dx%d", _cur_resolution.width, _cur_resolution.height);
|
||||
DEBUG(driver, 2, "Resolution for display: %ux%u", _cur_resolution.width, _cur_resolution.height);
|
||||
|
||||
/* fullscreen uses those */
|
||||
_wnd.width_org = _cur_resolution.width;
|
||||
|
Reference in New Issue
Block a user