mirror of https://github.com/OpenTTD/OpenTTD
(svn r24004) [1.2] -Backport from trunk:
- Fix: Zero the offsets of disabled zoomlevels, so they do not influence offset calculations (r23989) - Fix: Invalid reads when scaling an odd-sized sprite smaller (r23986) - Fix: Inconsistent quit/abandon/exit game/scenario/editor strings [FS#5074] (r23985) - Fix: Tarred heightmaps would not be found [FS#5083] (r23983)release/1.2
parent
9d168228e7
commit
2ab087f31f
|
@ -337,6 +337,7 @@ Sprite *Blitter_32bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorPr
|
||||||
dest_sprite->y_offs = sprite->y_offs;
|
dest_sprite->y_offs = sprite->y_offs;
|
||||||
|
|
||||||
SpriteData *dst = (SpriteData *)dest_sprite->data;
|
SpriteData *dst = (SpriteData *)dest_sprite->data;
|
||||||
|
memset(dst, 0, sizeof(*dst));
|
||||||
|
|
||||||
for (ZoomLevel z = zoom_min; z <= zoom_max; z++) {
|
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];
|
dst->offset[z][0] = z == zoom_min ? 0 : lengths[z - 1][1] + dst->offset[z - 1][1];
|
||||||
|
|
|
@ -141,6 +141,7 @@ Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorPro
|
||||||
* and the memory usage is quite low. */
|
* and the memory usage is quite low. */
|
||||||
static ReusableBuffer<byte> temp_buffer;
|
static ReusableBuffer<byte> temp_buffer;
|
||||||
SpriteData *temp_dst = (SpriteData *)temp_buffer.Allocate(memory);
|
SpriteData *temp_dst = (SpriteData *)temp_buffer.Allocate(memory);
|
||||||
|
memset(temp_dst, 0, sizeof(*temp_dst));
|
||||||
byte *dst = temp_dst->data;
|
byte *dst = temp_dst->data;
|
||||||
|
|
||||||
/* Make the sprites per zoom-level */
|
/* Make the sprites per zoom-level */
|
||||||
|
|
|
@ -683,6 +683,7 @@ uint TarScanner::DoScan(Subdirectory sd)
|
||||||
}
|
}
|
||||||
if (mode & TarScanner::SCENARIO) {
|
if (mode & TarScanner::SCENARIO) {
|
||||||
num += fs.DoScan(SCENARIO_DIR);
|
num += fs.DoScan(SCENARIO_DIR);
|
||||||
|
num += fs.DoScan(HEIGHTMAP_DIR);
|
||||||
}
|
}
|
||||||
DEBUG(misc, 1, "Scan complete, found %d files", num);
|
DEBUG(misc, 1, "Scan complete, found %d files", num);
|
||||||
return num;
|
return num;
|
||||||
|
|
|
@ -293,7 +293,7 @@ STR_SORT_BY_RANGE :Range
|
||||||
STR_TOOLBAR_TOOLTIP_PAUSE_GAME :{BLACK}Pause game
|
STR_TOOLBAR_TOOLTIP_PAUSE_GAME :{BLACK}Pause game
|
||||||
STR_TOOLBAR_TOOLTIP_FORWARD :{BLACK}Fast forward the game
|
STR_TOOLBAR_TOOLTIP_FORWARD :{BLACK}Fast forward the game
|
||||||
STR_TOOLBAR_TOOLTIP_OPTIONS :{BLACK}Options
|
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_MAP :{BLACK}Display map, extra viewport or list of signs
|
||||||
STR_TOOLBAR_TOOLTIP_DISPLAY_TOWN_DIRECTORY :{BLACK}Display town directory
|
STR_TOOLBAR_TOOLTIP_DISPLAY_TOWN_DIRECTORY :{BLACK}Display town directory
|
||||||
STR_TOOLBAR_TOOLTIP_DISPLAY_SUBSIDIES :{BLACK}Display subsidies
|
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
|
STR_TOOLBAR_TOOLTIP_SWITCH_TOOLBAR :{BLACK}Switch toolbars
|
||||||
|
|
||||||
# Extra tooltips for the scenario editor toolbar
|
# 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_OPENTTD :{YELLOW}OpenTTD
|
||||||
STR_SCENEDIT_TOOLBAR_SCENARIO_EDITOR :{YELLOW}Scenario Editor
|
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
|
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_LOAD_SCENARIO :Load scenario
|
||||||
STR_SCENEDIT_FILE_MENU_SAVE_HEIGHTMAP :Save heightmap
|
STR_SCENEDIT_FILE_MENU_SAVE_HEIGHTMAP :Save heightmap
|
||||||
STR_SCENEDIT_FILE_MENU_LOAD_HEIGHTMAP :Load 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_SEPARATOR :
|
||||||
STR_SCENEDIT_FILE_MENU_QUIT :Quit
|
STR_SCENEDIT_FILE_MENU_QUIT :Exit
|
||||||
############ range for SE file menu starts
|
############ range for SE file menu starts
|
||||||
|
|
||||||
############ range for settings 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_SAVE_GAME :Save game
|
||||||
STR_FILE_MENU_LOAD_GAME :Load game
|
STR_FILE_MENU_LOAD_GAME :Load game
|
||||||
STR_FILE_MENU_QUIT_GAME :Abandon game
|
STR_FILE_MENU_QUIT_GAME :Abandon game
|
||||||
|
STR_FILE_MENU_SEPARATOR :
|
||||||
STR_FILE_MENU_EXIT :Exit
|
STR_FILE_MENU_EXIT :Exit
|
||||||
############ range ends here
|
############ range ends here
|
||||||
|
|
||||||
|
@ -1409,7 +1410,7 @@ STR_INTRO_ADVANCED_SETTINGS :{BLACK}Advanced
|
||||||
STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF Settings
|
STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF Settings
|
||||||
STR_INTRO_ONLINE_CONTENT :{BLACK}Check Online Content
|
STR_INTRO_ONLINE_CONTENT :{BLACK}Check Online Content
|
||||||
STR_INTRO_SCRIPT_SETTINGS :{BLACK}AI / Game Settings
|
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_NEW_GAME :{BLACK}Start a new game. Ctrl+Click skips map configuration
|
||||||
STR_INTRO_TOOLTIP_LOAD_GAME :{BLACK}Load a saved game
|
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_NEWGRF_SETTINGS :{BLACK}Display NewGRF settings
|
||||||
STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Check for new and updated content to download
|
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_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.
|
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
|
# 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_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_YES :{BLACK}Yes
|
||||||
STR_QUIT_NO :{BLACK}No
|
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_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_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_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
|
# Transparency settings window
|
||||||
STR_TRANSPARENCY_CAPTION :{WHITE}Transparency Options
|
STR_TRANSPARENCY_CAPTION :{WHITE}Transparency Options
|
||||||
|
|
|
@ -293,7 +293,7 @@ STR_SORT_BY_RANGE :Range
|
||||||
STR_TOOLBAR_TOOLTIP_PAUSE_GAME :{BLACK}Pause game
|
STR_TOOLBAR_TOOLTIP_PAUSE_GAME :{BLACK}Pause game
|
||||||
STR_TOOLBAR_TOOLTIP_FORWARD :{BLACK}Fast forward the game
|
STR_TOOLBAR_TOOLTIP_FORWARD :{BLACK}Fast forward the game
|
||||||
STR_TOOLBAR_TOOLTIP_OPTIONS :{BLACK}Options
|
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_MAP :{BLACK}Display map
|
||||||
STR_TOOLBAR_TOOLTIP_DISPLAY_TOWN_DIRECTORY :{BLACK}Display town directory
|
STR_TOOLBAR_TOOLTIP_DISPLAY_TOWN_DIRECTORY :{BLACK}Display town directory
|
||||||
STR_TOOLBAR_TOOLTIP_DISPLAY_SUBSIDIES :{BLACK}Display subsidies
|
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_LOAD_SCENARIO :Load scenario
|
||||||
STR_SCENEDIT_FILE_MENU_SAVE_HEIGHTMAP :Save heightmap
|
STR_SCENEDIT_FILE_MENU_SAVE_HEIGHTMAP :Save heightmap
|
||||||
STR_SCENEDIT_FILE_MENU_LOAD_HEIGHTMAP :Load 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_SEPARATOR :
|
||||||
STR_SCENEDIT_FILE_MENU_QUIT :Quit
|
STR_SCENEDIT_FILE_MENU_QUIT :Quit
|
||||||
############ range for SE file menu starts
|
############ range for SE file menu starts
|
||||||
|
@ -366,7 +366,8 @@ STR_SETTINGS_MENU_TRANSPARENT_SIGNS :Transparent sig
|
||||||
############ range for file menu starts
|
############ range for file menu starts
|
||||||
STR_FILE_MENU_SAVE_GAME :Save game
|
STR_FILE_MENU_SAVE_GAME :Save game
|
||||||
STR_FILE_MENU_LOAD_GAME :Load 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
|
STR_FILE_MENU_EXIT :Quit
|
||||||
############ range ends here
|
############ range ends here
|
||||||
|
|
||||||
|
@ -1452,9 +1453,9 @@ STR_OSNAME_OS2 :OS/2
|
||||||
STR_OSNAME_SUNOS :SunOS
|
STR_OSNAME_SUNOS :SunOS
|
||||||
|
|
||||||
# Abandon game
|
# Abandon game
|
||||||
STR_ABANDON_GAME_CAPTION :{WHITE}Quit Game
|
STR_ABANDON_GAME_CAPTION :{WHITE}Abandon Game
|
||||||
STR_ABANDON_GAME_QUERY :{YELLOW}Are you sure you want to quit this 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 quit this scenario ?
|
STR_ABANDON_SCENARIO_QUERY :{YELLOW}Are you sure you want to abandon this scenario ?
|
||||||
|
|
||||||
# Cheat window
|
# Cheat window
|
||||||
STR_CHEATS :{WHITE}Cheats
|
STR_CHEATS :{WHITE}Cheats
|
||||||
|
|
|
@ -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;
|
const SpriteLoader::CommonPixel *src_end = src + sprite[zoom - 1].height * sprite[zoom - 1].width;
|
||||||
|
|
||||||
for (uint y = 0; y < sprite[zoom].height; y++) {
|
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;
|
||||||
|
assert(src_ln <= src_end);
|
||||||
const SpriteLoader::CommonPixel *src_ln = src + sprite[zoom - 1].width * 2;
|
|
||||||
for (uint x = 0; x < sprite[zoom].width; x++) {
|
for (uint x = 0; x < sprite[zoom].width; x++) {
|
||||||
if (src >= src_ln) src = src_ln - 1;
|
assert(src < src_ln);
|
||||||
if ((src + 1)->a != 0) { *dst = *(src + 1); }
|
if (src + 1 != src_ln && (src + 1)->a != 0) {
|
||||||
else { *dst = *src; }
|
*dst = *(src + 1);
|
||||||
|
} else {
|
||||||
|
*dst = *src;
|
||||||
|
}
|
||||||
dst++;
|
dst++;
|
||||||
src += 2;
|
src += 2;
|
||||||
}
|
}
|
||||||
|
src = src_ln + sprite[zoom - 1].width;
|
||||||
src = src_ln;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,7 @@ enum SaveLoadNormalMenuEntries {
|
||||||
SLNME_SAVE_GAME = 0,
|
SLNME_SAVE_GAME = 0,
|
||||||
SLNME_LOAD_GAME,
|
SLNME_LOAD_GAME,
|
||||||
SLNME_EXIT_TOINTRO,
|
SLNME_EXIT_TOINTRO,
|
||||||
SLNME_EXIT_GAME,
|
SLNME_EXIT_GAME = 4,
|
||||||
SLNME_MENUCOUNT,
|
SLNME_MENUCOUNT,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue