diff --git a/src/blitter/32bpp_optimized.cpp b/src/blitter/32bpp_optimized.cpp index 90a310075a..b0d2ac5391 100644 --- a/src/blitter/32bpp_optimized.cpp +++ b/src/blitter/32bpp_optimized.cpp @@ -337,6 +337,7 @@ Sprite *Blitter_32bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorPr dest_sprite->y_offs = sprite->y_offs; SpriteData *dst = (SpriteData *)dest_sprite->data; + memset(dst, 0, sizeof(*dst)); for (ZoomLevel z = zoom_min; z <= zoom_max; z++) { dst->offset[z][0] = z == zoom_min ? 0 : lengths[z - 1][1] + dst->offset[z - 1][1]; diff --git a/src/blitter/8bpp_optimized.cpp b/src/blitter/8bpp_optimized.cpp index acef6949ee..77fc36576e 100644 --- a/src/blitter/8bpp_optimized.cpp +++ b/src/blitter/8bpp_optimized.cpp @@ -141,6 +141,7 @@ Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorPro * and the memory usage is quite low. */ static ReusableBuffer temp_buffer; SpriteData *temp_dst = (SpriteData *)temp_buffer.Allocate(memory); + memset(temp_dst, 0, sizeof(*temp_dst)); byte *dst = temp_dst->data; /* Make the sprites per zoom-level */ diff --git a/src/fileio.cpp b/src/fileio.cpp index 34d896197f..7e4d21f01b 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -683,6 +683,7 @@ uint TarScanner::DoScan(Subdirectory sd) } if (mode & TarScanner::SCENARIO) { num += fs.DoScan(SCENARIO_DIR); + num += fs.DoScan(HEIGHTMAP_DIR); } DEBUG(misc, 1, "Scan complete, found %d files", num); return num; diff --git a/src/lang/english.txt b/src/lang/english.txt index 4bfeaf8e5b..1723e4bd95 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -293,7 +293,7 @@ STR_SORT_BY_RANGE :Range STR_TOOLBAR_TOOLTIP_PAUSE_GAME :{BLACK}Pause game STR_TOOLBAR_TOOLTIP_FORWARD :{BLACK}Fast forward the game STR_TOOLBAR_TOOLTIP_OPTIONS :{BLACK}Options -STR_TOOLBAR_TOOLTIP_SAVE_GAME_ABANDON_GAME :{BLACK}Save game, abandon game, quit +STR_TOOLBAR_TOOLTIP_SAVE_GAME_ABANDON_GAME :{BLACK}Save game, abandon game, exit STR_TOOLBAR_TOOLTIP_DISPLAY_MAP :{BLACK}Display map, extra viewport or list of signs STR_TOOLBAR_TOOLTIP_DISPLAY_TOWN_DIRECTORY :{BLACK}Display town directory STR_TOOLBAR_TOOLTIP_DISPLAY_SUBSIDIES :{BLACK}Display subsidies @@ -320,7 +320,7 @@ STR_TOOLBAR_TOOLTIP_LAND_BLOCK_INFORMATION :{BLACK}Land are STR_TOOLBAR_TOOLTIP_SWITCH_TOOLBAR :{BLACK}Switch toolbars # Extra tooltips for the scenario editor toolbar -STR_SCENEDIT_TOOLBAR_TOOLTIP_SAVE_SCENARIO_LOAD_SCENARIO :{BLACK}Save scenario, load scenario, abandon scenario editor, quit +STR_SCENEDIT_TOOLBAR_TOOLTIP_SAVE_SCENARIO_LOAD_SCENARIO :{BLACK}Save scenario, load scenario, abandon scenario editor, exit STR_SCENEDIT_TOOLBAR_OPENTTD :{YELLOW}OpenTTD STR_SCENEDIT_TOOLBAR_SCENARIO_EDITOR :{YELLOW}Scenario Editor STR_SCENEDIT_TOOLBAR_TOOLTIP_MOVE_THE_STARTING_DATE_BACKWARD :{BLACK}Move the starting date backward 1 year @@ -340,9 +340,9 @@ STR_SCENEDIT_FILE_MENU_SAVE_SCENARIO :Save scenario STR_SCENEDIT_FILE_MENU_LOAD_SCENARIO :Load scenario STR_SCENEDIT_FILE_MENU_SAVE_HEIGHTMAP :Save heightmap STR_SCENEDIT_FILE_MENU_LOAD_HEIGHTMAP :Load heightmap -STR_SCENEDIT_FILE_MENU_QUIT_EDITOR :Quit editor +STR_SCENEDIT_FILE_MENU_QUIT_EDITOR :Abandon scenario editor STR_SCENEDIT_FILE_MENU_SEPARATOR : -STR_SCENEDIT_FILE_MENU_QUIT :Quit +STR_SCENEDIT_FILE_MENU_QUIT :Exit ############ range for SE file menu starts ############ range for settings menu starts @@ -367,6 +367,7 @@ STR_SETTINGS_MENU_TRANSPARENT_SIGNS :Transparent sig STR_FILE_MENU_SAVE_GAME :Save game STR_FILE_MENU_LOAD_GAME :Load game STR_FILE_MENU_QUIT_GAME :Abandon game +STR_FILE_MENU_SEPARATOR : STR_FILE_MENU_EXIT :Exit ############ range ends here @@ -1409,7 +1410,7 @@ STR_INTRO_ADVANCED_SETTINGS :{BLACK}Advanced STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF Settings STR_INTRO_ONLINE_CONTENT :{BLACK}Check Online Content STR_INTRO_SCRIPT_SETTINGS :{BLACK}AI / Game Settings -STR_INTRO_QUIT :{BLACK}Quit +STR_INTRO_QUIT :{BLACK}Exit STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Start a new game. Ctrl+Click skips map configuration STR_INTRO_TOOLTIP_LOAD_GAME :{BLACK}Load a saved game @@ -1429,12 +1430,12 @@ STR_INTRO_TOOLTIP_ADVANCED_SETTINGS :{BLACK}Display STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Display NewGRF settings STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Check for new and updated content to download STR_INTRO_TOOLTIP_SCRIPT_SETTINGS :{BLACK}Display AI and Game settings -STR_INTRO_TOOLTIP_QUIT :{BLACK}Quit 'OpenTTD' +STR_INTRO_TOOLTIP_QUIT :{BLACK}Exit 'OpenTTD' STR_INTRO_TRANSLATION :{BLACK}This translation misses {NUM} string{P "" s}. Please help make OpenTTD better by signing up as translator. See readme.txt for details. # Quit window -STR_QUIT_CAPTION :{WHITE}Quit +STR_QUIT_CAPTION :{WHITE}Exit STR_QUIT_ARE_YOU_SURE_YOU_WANT_TO_EXIT_OPENTTD :{YELLOW}Are you sure you want to exit OpenTTD and return to {STRING}? STR_QUIT_YES :{BLACK}Yes STR_QUIT_NO :{BLACK}No @@ -1924,7 +1925,7 @@ STR_CONTENT_ERROR_COULD_NOT_EXTRACT :{WHITE}Could no STR_MISSING_GRAPHICS_SET_CAPTION :{WHITE}Missing graphics STR_MISSING_GRAPHICS_SET_MESSAGE :{BLACK}OpenTTD requires graphics to function but none could be found. Do you allow OpenTTD to download and install these graphics? STR_MISSING_GRAPHICS_YES_DOWNLOAD :{BLACK}Yes, download the graphics -STR_MISSING_GRAPHICS_NO_QUIT :{BLACK}No, quit OpenTTD +STR_MISSING_GRAPHICS_NO_QUIT :{BLACK}No, exit OpenTTD # Transparency settings window STR_TRANSPARENCY_CAPTION :{WHITE}Transparency Options diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 59c1d8dbde..5c9564f4cf 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -293,7 +293,7 @@ STR_SORT_BY_RANGE :Range STR_TOOLBAR_TOOLTIP_PAUSE_GAME :{BLACK}Pause game STR_TOOLBAR_TOOLTIP_FORWARD :{BLACK}Fast forward the game STR_TOOLBAR_TOOLTIP_OPTIONS :{BLACK}Options -STR_TOOLBAR_TOOLTIP_SAVE_GAME_ABANDON_GAME :{BLACK}Save game, quit game, quit +STR_TOOLBAR_TOOLTIP_SAVE_GAME_ABANDON_GAME :{BLACK}Save game, abandon game, quit STR_TOOLBAR_TOOLTIP_DISPLAY_MAP :{BLACK}Display map STR_TOOLBAR_TOOLTIP_DISPLAY_TOWN_DIRECTORY :{BLACK}Display town directory STR_TOOLBAR_TOOLTIP_DISPLAY_SUBSIDIES :{BLACK}Display subsidies @@ -340,7 +340,7 @@ STR_SCENEDIT_FILE_MENU_SAVE_SCENARIO :Save scenario STR_SCENEDIT_FILE_MENU_LOAD_SCENARIO :Load scenario STR_SCENEDIT_FILE_MENU_SAVE_HEIGHTMAP :Save heightmap STR_SCENEDIT_FILE_MENU_LOAD_HEIGHTMAP :Load heightmap -STR_SCENEDIT_FILE_MENU_QUIT_EDITOR :Quit editor +STR_SCENEDIT_FILE_MENU_QUIT_EDITOR :Abandon scenario editor STR_SCENEDIT_FILE_MENU_SEPARATOR : STR_SCENEDIT_FILE_MENU_QUIT :Quit ############ range for SE file menu starts @@ -366,7 +366,8 @@ STR_SETTINGS_MENU_TRANSPARENT_SIGNS :Transparent sig ############ range for file menu starts STR_FILE_MENU_SAVE_GAME :Save game STR_FILE_MENU_LOAD_GAME :Load game -STR_FILE_MENU_QUIT_GAME :Quit game +STR_FILE_MENU_QUIT_GAME :Abandon game +STR_FILE_MENU_SEPARATOR : STR_FILE_MENU_EXIT :Quit ############ range ends here @@ -1452,9 +1453,9 @@ STR_OSNAME_OS2 :OS/2 STR_OSNAME_SUNOS :SunOS # Abandon game -STR_ABANDON_GAME_CAPTION :{WHITE}Quit Game -STR_ABANDON_GAME_QUERY :{YELLOW}Are you sure you want to quit this game ? -STR_ABANDON_SCENARIO_QUERY :{YELLOW}Are you sure you want to quit this scenario ? +STR_ABANDON_GAME_CAPTION :{WHITE}Abandon Game +STR_ABANDON_GAME_QUERY :{YELLOW}Are you sure you want to abandon this game ? +STR_ABANDON_SCENARIO_QUERY :{YELLOW}Are you sure you want to abandon this scenario ? # Cheat window STR_CHEATS :{WHITE}Cheats diff --git a/src/spritecache.cpp b/src/spritecache.cpp index c77d3c5460..4b705fc94d 100644 --- a/src/spritecache.cpp +++ b/src/spritecache.cpp @@ -197,18 +197,19 @@ static void ResizeSpriteOut(SpriteLoader::Sprite *sprite, ZoomLevel zoom) const SpriteLoader::CommonPixel *src_end = src + sprite[zoom - 1].height * sprite[zoom - 1].width; for (uint y = 0; y < sprite[zoom].height; y++) { - if (src >= src_end) src = src_end - sprite[zoom - 1].width; - - const SpriteLoader::CommonPixel *src_ln = src + sprite[zoom - 1].width * 2; + const SpriteLoader::CommonPixel *src_ln = src + sprite[zoom - 1].width; + assert(src_ln <= src_end); for (uint x = 0; x < sprite[zoom].width; x++) { - if (src >= src_ln) src = src_ln - 1; - if ((src + 1)->a != 0) { *dst = *(src + 1); } - else { *dst = *src; } + assert(src < src_ln); + if (src + 1 != src_ln && (src + 1)->a != 0) { + *dst = *(src + 1); + } else { + *dst = *src; + } dst++; src += 2; } - - src = src_ln; + src = src_ln + sprite[zoom - 1].width; } } diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index a9aae0171b..423dba436b 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -346,7 +346,7 @@ enum SaveLoadNormalMenuEntries { SLNME_SAVE_GAME = 0, SLNME_LOAD_GAME, SLNME_EXIT_TOINTRO, - SLNME_EXIT_GAME, + SLNME_EXIT_GAME = 4, SLNME_MENUCOUNT, };