equal
deleted
inserted
replaced
173 SDL_Surface *newscreen, *icon; |
173 SDL_Surface *newscreen, *icon; |
174 char caption[50]; |
174 char caption[50]; |
175 |
175 |
176 GetAvailableVideoMode(&w, &h); |
176 GetAvailableVideoMode(&w, &h); |
177 |
177 |
178 DEBUG(driver, 1) ("sdl: using mode %dx%d", w, h); |
178 DEBUG(driver, 1, "SDL: using mode %dx%d", w, h); |
179 |
179 |
180 /* Give the application an icon */ |
180 /* Give the application an icon */ |
181 icon = SDL_CALL SDL_LoadBMP(ICON_DIR PATHSEP "openttd.32.bmp"); |
181 icon = SDL_CALL SDL_LoadBMP(ICON_DIR PATHSEP "openttd.32.bmp"); |
182 if (icon != NULL) { |
182 if (icon != NULL) { |
183 /* Get the colourkey, which will be magenta */ |
183 /* Get the colourkey, which will be magenta */ |
293 if (sym->mod & KMOD_SHIFT) key |= WKC_SHIFT; |
293 if (sym->mod & KMOD_SHIFT) key |= WKC_SHIFT; |
294 if (sym->mod & KMOD_CTRL) key |= WKC_CTRL; |
294 if (sym->mod & KMOD_CTRL) key |= WKC_CTRL; |
295 if (sym->mod & KMOD_ALT) key |= WKC_ALT; |
295 if (sym->mod & KMOD_ALT) key |= WKC_ALT; |
296 // these two lines really help porting hotkey combos. Uncomment to use -- Bjarni |
296 // these two lines really help porting hotkey combos. Uncomment to use -- Bjarni |
297 #if 0 |
297 #if 0 |
298 DEBUG(driver, 0) ("scancode character pressed %u", sym->scancode); |
298 DEBUG(driver, 0, "Scancode character pressed %u", sym->scancode); |
299 DEBUG(driver, 0) ("unicode character pressed %u", sym->unicode); |
299 DEBUG(driver, 0, "Unicode character pressed %u", sym->unicode); |
300 #endif |
300 #endif |
301 return (key << 16) + sym->unicode; |
301 return (key << 16) + sym->unicode; |
302 } |
302 } |
303 |
303 |
304 static int PollEvent(void) |
304 static int PollEvent(void) |
402 |
402 |
403 const char *s = SdlOpen(SDL_INIT_VIDEO); |
403 const char *s = SdlOpen(SDL_INIT_VIDEO); |
404 if (s != NULL) return s; |
404 if (s != NULL) return s; |
405 |
405 |
406 SDL_CALL SDL_VideoDriverName(buf, 30); |
406 SDL_CALL SDL_VideoDriverName(buf, 30); |
407 DEBUG(driver, 1) ("sdl: using driver '%s'", buf); |
407 DEBUG(driver, 1, "SDL: using driver '%s'", buf); |
408 |
408 |
409 GetVideoModes(); |
409 GetVideoModes(); |
410 CreateMainSurface(_cur_resolution[0], _cur_resolution[1]); |
410 CreateMainSurface(_cur_resolution[0], _cur_resolution[1]); |
411 MarkWholeScreenDirty(); |
411 MarkWholeScreenDirty(); |
412 |
412 |