Update: Merge branch 'jgrpp_master_cmake' into jgrpp_cmake

This commit is contained in:
TechGeekNZ
2020-06-27 20:46:53 +12:00
committed by Jonathan G Rennison
329 changed files with 4044 additions and 32403 deletions

5
src/3rdparty/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1,5 @@
add_subdirectory(md5)
add_subdirectory(squirrel)
add_subdirectory(os2)
add_subdirectory(cpp-btree)
add_subdirectory(mingw-std-threads)

9
src/3rdparty/cpp-btree/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1,9 @@
add_files(
btree.h
btree_container.h
btree_map.h
btree_set.h
safe_btree.h
safe_btree_map.h
safe_btree_set.h
)

4
src/3rdparty/md5/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1,4 @@
add_files(
md5.cpp
md5.h
)

View File

@@ -0,0 +1,7 @@
add_files(
mingw.condition_variable.h
mingw.mutex.h
mingw.shared_mutex.h
mingw.thread.h
CONDITION MINGW
)

7
src/3rdparty/os2/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1,7 @@
add_files(
getaddrinfo.c
getaddrinfo.h
getnameinfo.c
getnameinfo.h
CONDITION OPTION_OS2
)

3
src/3rdparty/squirrel/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1,3 @@
add_subdirectory(include)
add_subdirectory(sqstdlib)
add_subdirectory(squirrel)

View File

@@ -0,0 +1,6 @@
add_files(
sqstdaux.h
sqstdmath.h
sqstdstring.h
squirrel.h
)

View File

@@ -0,0 +1,4 @@
add_files(
sqstdaux.cpp
sqstdmath.cpp
)

View File

@@ -0,0 +1,30 @@
add_files(
sqapi.cpp
sqarray.h
sqbaselib.cpp
sqclass.cpp
sqclass.h
sqclosure.h
sqcompiler.cpp
sqcompiler.h
sqdebug.cpp
sqfuncproto.h
sqfuncstate.cpp
sqfuncstate.h
sqlexer.cpp
sqlexer.h
sqmem.cpp
sqobject.cpp
sqobject.h
sqopcodes.h
sqpcheader.h
sqstate.cpp
sqstate.h
sqstring.h
sqtable.cpp
sqtable.h
squserdata.h
squtils.h
sqvm.cpp
sqvm.h
)

View File

@@ -72,7 +72,7 @@ struct SQVM;
#define TK_CONST 324
/* MSVC doesn't like NORETURN for function prototypes, but we kinda need it for GCC. */
#if defined(_MSC_VER)
#if defined(_MSC_VER) && !defined(__clang__)
typedef void(*CompilerErrorFunc)(void *ud, const SQChar *s);
#else
typedef NORETURN void(*CompilerErrorFunc)(void *ud, const SQChar *s);

524
src/CMakeLists.txt Normal file
View File

@@ -0,0 +1,524 @@
add_subdirectory(3rdparty)
add_subdirectory(ai)
add_subdirectory(blitter)
add_subdirectory(core)
add_subdirectory(game)
add_subdirectory(lang)
add_subdirectory(linkgraph)
add_subdirectory(misc)
add_subdirectory(music)
add_subdirectory(network)
add_subdirectory(os)
add_subdirectory(pathfinder)
add_subdirectory(saveload)
add_subdirectory(script)
add_subdirectory(settingsgen)
add_subdirectory(sound)
add_subdirectory(spriteloader)
add_subdirectory(strgen)
add_subdirectory(table)
add_subdirectory(video)
add_subdirectory(widgets)
add_files(
viewport_sprite_sorter_sse4.cpp
CONDITION SSE_FOUND
)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set_compile_flags(
viewport_sprite_sorter_sse4.cpp
COMPILE_FLAGS -msse4.1)
endif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_files(
aircraft.h
aircraft_cmd.cpp
aircraft_gui.cpp
airport.cpp
airport.h
airport_gui.cpp
animated_tile.cpp
animated_tile_func.h
articulated_vehicles.cpp
articulated_vehicles.h
autoreplace.cpp
autoreplace_base.h
autoreplace_cmd.cpp
autoreplace_func.h
autoreplace_gui.cpp
autoreplace_gui.h
autoreplace_type.h
autoslope.h
base_consist.cpp
base_consist.h
base_media_base.h
base_media_func.h
base_station_base.h
bitmap_type.h
bmp.cpp
bmp.h
bootstrap_gui.cpp
bridge.h
bridge_gui.cpp
bridge_map.cpp
bridge_map.h
bridge_signal_map.h
build_vehicle_gui.cpp
cargo_type.h
cargoaction.cpp
cargoaction.h
cargomonitor.cpp
cargomonitor.h
cargopacket.cpp
cargopacket.h
cargotype.cpp
cargotype.h
cheat.cpp
cheat_func.h
cheat_gui.cpp
cheat_type.h
clear_cmd.cpp
clear_func.h
clear_map.h
cmd_helper.h
command.cpp
command_func.h
command_type.h
company_base.h
company_cmd.cpp
company_func.h
company_gui.cpp
company_gui.h
company_manager_face.h
company_type.h
console.cpp
console_cmds.cpp
console_func.h
console_gui.cpp
console_gui.h
console_internal.h
console_type.h
cpu.cpp
cpu.h
crashlog.cpp
crashlog.h
crashlog_bfd.h
currency.cpp
currency.h
date.cpp
date_func.h
date_gui.cpp
date_gui.h
date_type.h
debug.cpp
debug.h
debug_settings.h
dedicated.cpp
departures.cpp
departures_func.h
departures_gui.cpp
departures_gui.h
departures_type.h
depot.cpp
depot_base.h
depot_cmd.cpp
depot_func.h
depot_gui.cpp
depot_map.h
depot_type.h
direction_func.h
direction_type.h
disaster_vehicle.cpp
disaster_vehicle.h
dock_gui.cpp
driver.cpp
driver.h
economy.cpp
economy_base.h
economy_func.h
economy_type.h
effectvehicle.cpp
effectvehicle_base.h
effectvehicle_func.h
elrail.cpp
elrail_func.h
engine.cpp
engine_base.h
engine_func.h
engine_gui.cpp
engine_gui.h
engine_type.h
error.h
error_gui.cpp
fileio.cpp
fileio_func.h
fileio_type.h
fios.cpp
fios.h
fios_gui.cpp
fontcache.cpp
fontcache.h
fontdetection.cpp
fontdetection.h
framerate_gui.cpp
framerate_type.h
gamelog.cpp
gamelog.h
gamelog_internal.h
genworld.cpp
genworld.h
genworld_gui.cpp
gfx.cpp
gfx_func.h
gfx_layout.cpp
gfx_layout.h
gfx_type.h
gfxinit.cpp
gfxinit.h
goal.cpp
goal_base.h
goal_gui.cpp
goal_type.h
graph_gui.cpp
graph_gui.h
ground_vehicle.cpp
ground_vehicle.hpp
group.h
group_cmd.cpp
group_gui.cpp
group_gui.h
group_type.h
gui.h
guitimer_func.h
heightmap.cpp
heightmap.h
highscore.cpp
highscore.h
highscore_gui.cpp
hotkeys.cpp
hotkeys.h
house.h
house_type.h
industry.h
industry_cmd.cpp
industry_gui.cpp
industry_map.h
industry_type.h
industrytype.h
ini.cpp
ini_load.cpp
ini_type.h
infrastructure.cpp
infrastructure_func.h
intro_gui.cpp
landscape.cpp
landscape.h
landscape_type.h
language.h
livery.h
main_gui.cpp
map.cpp
map_func.h
map_type.h
misc.cpp
misc_cmd.cpp
misc_gui.cpp
mixer.cpp
mixer.h
music.cpp
music_gui.cpp
newgrf.cpp
newgrf.h
newgrf_airport.cpp
newgrf_airport.h
newgrf_airporttiles.cpp
newgrf_airporttiles.h
newgrf_animation_base.h
newgrf_animation_type.h
newgrf_callbacks.h
newgrf_canal.cpp
newgrf_canal.h
newgrf_cargo.cpp
newgrf_cargo.h
newgrf_class.h
newgrf_class_func.h
newgrf_commons.cpp
newgrf_commons.h
newgrf_config.cpp
newgrf_config.h
newgrf_debug.h
newgrf_debug_gui.cpp
newgrf_engine.cpp
newgrf_engine.h
newgrf_generic.cpp
newgrf_generic.h
newgrf_gui.cpp
newgrf_house.cpp
newgrf_house.h
newgrf_industries.cpp
newgrf_industries.h
newgrf_industrytiles.cpp
newgrf_industrytiles.h
newgrf_object.cpp
newgrf_object.h
newgrf_profiling.cpp
newgrf_profiling.h
newgrf_properties.h
newgrf_railtype.cpp
newgrf_railtype.h
newgrf_roadtype.cpp
newgrf_roadtype.h
newgrf_sound.cpp
newgrf_sound.h
newgrf_spritegroup.cpp
newgrf_spritegroup.h
newgrf_station.cpp
newgrf_station.h
newgrf_storage.cpp
newgrf_storage.h
newgrf_text.cpp
newgrf_text.h
newgrf_town.cpp
newgrf_town.h
newgrf_townname.cpp
newgrf_townname.h
news_func.h
news_gui.cpp
news_gui.h
news_type.h
object.h
object_base.h
object_cmd.cpp
object_gui.cpp
object_map.h
object_type.h
openttd.cpp
openttd.h
order_backup.cpp
order_backup.h
order_base.h
order_cmd.cpp
order_cmd.h
order_func.h
order_gui.cpp
order_type.h
osk_gui.cpp
pbs.cpp
pbs.h
plans.cpp
plans_base.h
plans_cmd.cpp
plans_func.h
plans_gui.cpp
plans_type.h
programmable_signals.cpp
programmable_signals_gui.cpp
programmable_signals.h
progress.cpp
progress.h
querystring_gui.h
rail.cpp
rail.h
rail_cmd.cpp
rail_gui.cpp
rail_gui.h
rail_map.h
rail_type.h
rev.h
road.cpp
road.h
road_cmd.cpp
road_cmd.h
road_func.h
road_gui.cpp
road_gui.h
road_internal.h
road_map.cpp
road_map.h
road_type.h
roadstop.cpp
roadstop_base.h
roadveh.h
roadveh_cmd.cpp
roadveh_gui.cpp
safeguards.h
schdispatch.h
schdispatch_cmd.cpp
schdispatch_gui.cpp
screenshot_gui.cpp
screenshot_gui.h
screenshot.cpp
screenshot.h
scope.h
scope_info.cpp
scope_info.h
settings.cpp
settings_func.h
settings_gui.cpp
settings_gui.h
settings_internal.h
settings_type.h
ship.h
ship_cmd.cpp
ship_gui.cpp
signal.cpp
signal_func.h
signal_type.h
signs.cpp
signs_base.h
signs_cmd.cpp
signs_func.h
signs_gui.cpp
signs_type.h
slope_func.h
slope_type.h
smallmap_colours.h
smallmap_gui.cpp
smallmap_gui.h
sortlist_type.h
sound.cpp
sound_func.h
sound_type.h
sprite.cpp
sprite.h
spritecache.cpp
spritecache.h
station.cpp
station_base.h
station_cmd.cpp
station_func.h
station_gui.cpp
station_gui.h
station_kdtree.h
station_map.h
station_type.h
statusbar_gui.cpp
statusbar_gui.h
stdafx.h
story.cpp
story_base.h
story_gui.cpp
story_type.h
strgen/strgen.h
string.cpp
string_base.h
string_func.h
string_func_extra.h
string_type.h
stringfilter.cpp
stringfilter_type.h
strings.cpp
strings_func.h
strings_type.h
subsidy.cpp
subsidy_base.h
subsidy_func.h
subsidy_gui.cpp
subsidy_type.h
tar_type.h
tbtr_template_gui_main.cpp
tbtr_template_gui_create.cpp
tbtr_template_vehicle.cpp
tbtr_template_vehicle_func.cpp
tbtr_template_gui_main.h
tbtr_template_gui_create.h
tbtr_template_vehicle.h
tbtr_template_vehicle_func.h
terraform_cmd.cpp
terraform_gui.cpp
terraform_gui.h
textbuf.cpp
textbuf_gui.h
textbuf_type.h
texteff.cpp
texteff.hpp
textfile_gui.cpp
textfile_gui.h
textfile_type.h
tgp.cpp
tgp.h
thread.h
tile_cmd.h
tile_map.cpp
tile_map.h
tile_type.h
tilearea.cpp
tilearea_type.h
tilehighlight_func.h
tilehighlight_type.h
tilematrix_type.hpp
timetable.h
timetable_cmd.cpp
timetable_gui.cpp
toolbar_gui.cpp
toolbar_gui.h
town.h
town_cmd.cpp
town_gui.cpp
town_gui.h
town_kdtree.h
town_map.h
town_type.h
townname.cpp
townname_func.h
townname_type.h
tracerestrict.cpp
tracerestrict.h
tracerestrict_gui.cpp
track_func.h
track_type.h
train.h
train_cmd.cpp
train_gui.cpp
transparency.h
transparency_gui.cpp
transparency_gui.h
transport_type.h
tree_cmd.cpp
tree_gui.cpp
tree_map.h
tunnel_base.h
tunnel_map.cpp
tunnel_map.h
tunnelbridge.h
tunnelbridge_cmd.cpp
tunnelbridge_map.h
unit_conversion.h
vehicle.cpp
vehicle_base.h
vehicle_cmd.cpp
vehicle_func.h
vehicle_gui.cpp
vehicle_gui.h
vehicle_gui_base.h
vehicle_type.h
vehiclelist.cpp
vehiclelist.h
viewport.cpp
viewport_func.h
viewport_gui.cpp
viewport_kdtree.h
viewport_sprite_sorter.h
viewport_type.h
void_cmd.cpp
void_map.h
water.h
water_cmd.cpp
water_map.h
waypoint.cpp
waypoint_base.h
waypoint_cmd.cpp
waypoint_func.h
waypoint_gui.cpp
widget.cpp
widget_type.h
window.cpp
window_func.h
window_gui.h
window_type.h
zoom_func.h
zoom_type.h
zoning.h
zoning_cmd.cpp
zoning_gui.cpp
)

14
src/ai/CMakeLists.txt Normal file
View File

@@ -0,0 +1,14 @@
add_files(
ai.hpp
ai_config.cpp
ai_config.hpp
ai_core.cpp
ai_gui.cpp
ai_gui.hpp
ai_info.cpp
ai_info.hpp
ai_instance.cpp
ai_instance.hpp
ai_scanner.cpp
ai_scanner.hpp
)

View File

@@ -0,0 +1,55 @@
add_files(
32bpp_anim.cpp
32bpp_anim.hpp
32bpp_base.cpp
32bpp_base.hpp
32bpp_optimized.cpp
32bpp_optimized.hpp
32bpp_simple.cpp
32bpp_simple.hpp
8bpp_base.cpp
8bpp_base.hpp
8bpp_optimized.cpp
8bpp_optimized.hpp
8bpp_simple.cpp
8bpp_simple.hpp
CONDITION NOT OPTION_DEDICATED
)
add_files(
32bpp_anim_sse2.cpp
32bpp_anim_sse2.hpp
32bpp_anim_sse4.cpp
32bpp_anim_sse4.hpp
32bpp_sse2.cpp
32bpp_sse2.hpp
32bpp_sse4.cpp
32bpp_sse4.hpp
32bpp_sse_func.hpp
32bpp_sse_type.h
32bpp_ssse3.cpp
32bpp_ssse3.hpp
CONDITION NOT OPTION_DEDICATED AND SSE_FOUND
)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set_compile_flags(
32bpp_anim_sse2.cpp
32bpp_sse2.cpp
COMPILE_FLAGS -msse2)
set_compile_flags(
32bpp_ssse3.cpp
COMPILE_FLAGS -mssse3)
set_compile_flags(
32bpp_anim_sse4.cpp
32bpp_sse4.cpp
COMPILE_FLAGS -msse4.1)
endif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_files(
base.hpp
common.hpp
factory.hpp
null.cpp
null.hpp
)

View File

@@ -460,7 +460,7 @@ public:
uint Reroute(uint max_move, VehicleCargoList *dest, StationID avoid, StationID avoid2, const GoodsEntry *ge);
/**
* Are two the two CargoPackets mergeable in the context of
* Are the two CargoPackets mergeable in the context of
* a list of CargoPackets for a Vehicle?
* @param cp1 First CargoPacket.
* @param cp2 Second CargoPacket.
@@ -523,7 +523,7 @@ public:
while (!next.IsEmpty()) {
if (this->packets.find(next.Pop()) != this->packets.end()) return true;
}
/* Packets for INVALID_STTION can go anywhere. */
/* Packets for INVALID_STATION can go anywhere. */
return this->packets.find(INVALID_STATION) != this->packets.end();
}

View File

@@ -810,7 +810,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac
int x = TileX(tile) * TILE_SIZE;
int y = TileY(tile) * TILE_SIZE;
if (_pause_mode != PM_UNPAUSED && !IsCommandAllowedWhilePaused(cmd)) {
if (_pause_mode != PM_UNPAUSED && !IsCommandAllowedWhilePaused(cmd) && !estimate_only) {
ShowErrorMessage(GB(cmd, 16, 16), STR_ERROR_NOT_ALLOWED_WHILE_PAUSED, WL_INFO, x, y);
return false;
}

View File

@@ -662,6 +662,7 @@ DEF_CONSOLE_CMD(ConBanList)
uint i = 1;
for (const auto &entry : _network_ban_list) {
IConsolePrintF(CC_DEFAULT, " %d) %s", i, entry.c_str());
i++;
}
return true;

34
src/core/CMakeLists.txt Normal file
View File

@@ -0,0 +1,34 @@
add_files(
alloc_func.cpp
alloc_func.hpp
alloc_type.hpp
backup_type.hpp
bitmath_func.cpp
bitmath_func.hpp
checksum_func.hpp
container_func.hpp
dyn_arena_alloc.hpp
endian_func.hpp
endian_type.hpp
enum_type.hpp
geometry_func.cpp
geometry_func.hpp
geometry_type.hpp
kdtree.hpp
math_func.cpp
math_func.hpp
mem_func.hpp
multimap.hpp
overflowsafe_type.hpp
pool_func.cpp
pool_func.hpp
pool_type.hpp
random_func.cpp
random_func.hpp
smallmap_type.hpp
smallmatrix_type.hpp
smallstack_type.hpp
smallvec_type.hpp
string_compare_type.hpp
tinystring_type.hpp
)

View File

@@ -23,30 +23,8 @@
/** Big endian builds use this for TTD_ENDIAN. */
#define TTD_BIG_ENDIAN 1
/* Windows has always LITTLE_ENDIAN */
#if defined(_WIN32) || defined(__OS2__) || defined(__HAIKU__)
# define TTD_ENDIAN TTD_LITTLE_ENDIAN
#elif defined(OSX)
# include <sys/types.h>
# if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
# define TTD_ENDIAN TTD_LITTLE_ENDIAN
# else
# define TTD_ENDIAN TTD_BIG_ENDIAN
# endif
#elif defined(__OpenBSD__)
# include <endian.h>
# if BYTE_ORDER == LITTLE_ENDIAN
# define TTD_ENDIAN TTD_LITTLE_ENDIAN
# else
# define TTD_ENDIAN TTD_BIG_ENDIAN
# endif
#elif !defined(TESTING)
# include <sys/param.h>
# if __BYTE_ORDER == __LITTLE_ENDIAN
# define TTD_ENDIAN TTD_LITTLE_ENDIAN
# else
# define TTD_ENDIAN TTD_BIG_ENDIAN
# endif
#endif /* _WIN32 || __OS2__ */
#if !defined(TTD_ENDIAN)
# error "TTD_ENDIAN is not defined; please set it to either TTD_LITTLE_ENDIAN or TTD_BIG_ENDIAN"
#endif /* !TTD_ENDIAN */
#endif /* ENDIAN_TYPE_HPP */

File diff suppressed because it is too large Load Diff

View File

@@ -25,6 +25,7 @@
#endif
#include <sys/stat.h>
#include <algorithm>
#include <sstream>
#ifdef WITH_XDG_BASEDIR
#include <basedir.h>
@@ -484,6 +485,28 @@ FILE *FioFOpenFile(const char *filename, const char *mode, Subdirectory subdir,
strecpy(resolved_name, filename, lastof(resolved_name));
strtolower(resolved_name);
/* Resolve ".." */
std::istringstream ss(resolved_name);
std::vector<std::string> tokens;
std::string token;
while (std::getline(ss, token, PATHSEPCHAR)) {
if (token == "..") {
if (tokens.size() < 2) return nullptr;
tokens.pop_back();
} else {
tokens.push_back(token);
}
}
resolved_name[0] = '\0';
bool first = true;
for (const std::string &token : tokens) {
if (!first) {
strecat(resolved_name, PATHSEP, lastof(resolved_name));
}
strecat(resolved_name, token.c_str(), lastof(resolved_name));
first = false;
}
size_t resolved_len = strlen(resolved_name);
/* Resolve ONE directory link */

14
src/game/CMakeLists.txt Normal file
View File

@@ -0,0 +1,14 @@
add_files(
game.hpp
game_config.cpp
game_config.hpp
game_core.cpp
game_info.cpp
game_info.hpp
game_instance.cpp
game_instance.hpp
game_scanner.cpp
game_scanner.hpp
game_text.cpp
game_text.hpp
)

View File

@@ -894,6 +894,7 @@ void DrawCharCentered(WChar c, int x, int y, TextColour colour)
* Get the size of a sprite.
* @param sprid Sprite to examine.
* @param[out] offset Optionally returns the sprite position offset.
* @param zoom The zoom level applicable to the sprite.
* @return Sprite size in pixels.
* @note The size assumes (0, 0) as top-left coordinate and ignores any part of the sprite drawn at the left or above that position.
*/
@@ -1408,6 +1409,16 @@ void DrawMouseCursor()
_cursor.dirty = false;
}
/**
* Repaints a specific rectangle of the screen.
*
* @param left,top,right,bottom The area of the screen that needs repainting
* @pre The rectangle is assumed to have been previously marked dirty with \c SetDirtyBlocks.
* @see SetDirtyBlocks
* @see DrawDirtyBlocks
* @ingroup dirty
*
*/
void RedrawScreenRect(int left, int top, int right, int bottom)
{
assert(right <= _screen.width && bottom <= _screen.height);
@@ -1487,6 +1498,8 @@ static void DrawDirtyViewport(uint occlusion, int left, int top, int right, int
* Repaints the rectangle blocks which are marked as 'dirty'.
*
* @see SetDirtyBlocks
*
* @ingroup dirty
*/
void DrawDirtyBlocks()
{
@@ -1817,6 +1830,8 @@ static void AddDirtyBlocks(uint start, int left, int top, int right, int bottom)
}
/**
* Add the specified rectangle to the collection of screen areas to be
* invalidated and redrawn.
* Note the point (0,0) is top left.
*
* @param left The left edge of the rectangle
@@ -1825,9 +1840,7 @@ static void AddDirtyBlocks(uint start, int left, int top, int right, int bottom)
* @param bottom The bottom edge of the rectangle
* @see DrawDirtyBlocks
*
* @todo The name of the function should be called like @c AddDirtyBlock as
* it neither set a dirty rect nor add several dirty rects although
* the function name is in plural. (Progman)
* @ingroup dirty
*/
void SetDirtyBlocks(int left, int top, int right, int bottom)
{

122
src/lang/CMakeLists.txt Normal file
View File

@@ -0,0 +1,122 @@
set(LANG_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/afrikaans.txt
${CMAKE_CURRENT_SOURCE_DIR}/arabic_egypt.txt
${CMAKE_CURRENT_SOURCE_DIR}/basque.txt
${CMAKE_CURRENT_SOURCE_DIR}/belarusian.txt
${CMAKE_CURRENT_SOURCE_DIR}/brazilian_portuguese.txt
${CMAKE_CURRENT_SOURCE_DIR}/bulgarian.txt
${CMAKE_CURRENT_SOURCE_DIR}/catalan.txt
${CMAKE_CURRENT_SOURCE_DIR}/croatian.txt
${CMAKE_CURRENT_SOURCE_DIR}/czech.txt
${CMAKE_CURRENT_SOURCE_DIR}/danish.txt
${CMAKE_CURRENT_SOURCE_DIR}/dutch.txt
${CMAKE_CURRENT_SOURCE_DIR}/english.txt
${CMAKE_CURRENT_SOURCE_DIR}/english_AU.txt
${CMAKE_CURRENT_SOURCE_DIR}/english_US.txt
${CMAKE_CURRENT_SOURCE_DIR}/esperanto.txt
${CMAKE_CURRENT_SOURCE_DIR}/estonian.txt
${CMAKE_CURRENT_SOURCE_DIR}/faroese.txt
${CMAKE_CURRENT_SOURCE_DIR}/finnish.txt
${CMAKE_CURRENT_SOURCE_DIR}/french.txt
${CMAKE_CURRENT_SOURCE_DIR}/gaelic.txt
${CMAKE_CURRENT_SOURCE_DIR}/galician.txt
${CMAKE_CURRENT_SOURCE_DIR}/german.txt
${CMAKE_CURRENT_SOURCE_DIR}/greek.txt
${CMAKE_CURRENT_SOURCE_DIR}/hebrew.txt
${CMAKE_CURRENT_SOURCE_DIR}/hungarian.txt
${CMAKE_CURRENT_SOURCE_DIR}/icelandic.txt
${CMAKE_CURRENT_SOURCE_DIR}/indonesian.txt
${CMAKE_CURRENT_SOURCE_DIR}/irish.txt
${CMAKE_CURRENT_SOURCE_DIR}/italian.txt
${CMAKE_CURRENT_SOURCE_DIR}/japanese.txt
${CMAKE_CURRENT_SOURCE_DIR}/korean.txt
${CMAKE_CURRENT_SOURCE_DIR}/latin.txt
${CMAKE_CURRENT_SOURCE_DIR}/latvian.txt
${CMAKE_CURRENT_SOURCE_DIR}/lithuanian.txt
${CMAKE_CURRENT_SOURCE_DIR}/luxembourgish.txt
${CMAKE_CURRENT_SOURCE_DIR}/malay.txt
${CMAKE_CURRENT_SOURCE_DIR}/norwegian_bokmal.txt
${CMAKE_CURRENT_SOURCE_DIR}/norwegian_nynorsk.txt
${CMAKE_CURRENT_SOURCE_DIR}/polish.txt
${CMAKE_CURRENT_SOURCE_DIR}/portuguese.txt
${CMAKE_CURRENT_SOURCE_DIR}/romanian.txt
${CMAKE_CURRENT_SOURCE_DIR}/russian.txt
${CMAKE_CURRENT_SOURCE_DIR}/serbian.txt
${CMAKE_CURRENT_SOURCE_DIR}/simplified_chinese.txt
${CMAKE_CURRENT_SOURCE_DIR}/slovak.txt
${CMAKE_CURRENT_SOURCE_DIR}/slovenian.txt
${CMAKE_CURRENT_SOURCE_DIR}/spanish.txt
${CMAKE_CURRENT_SOURCE_DIR}/spanish_MX.txt
${CMAKE_CURRENT_SOURCE_DIR}/swedish.txt
${CMAKE_CURRENT_SOURCE_DIR}/tamil.txt
${CMAKE_CURRENT_SOURCE_DIR}/thai.txt
${CMAKE_CURRENT_SOURCE_DIR}/traditional_chinese.txt
${CMAKE_CURRENT_SOURCE_DIR}/turkish.txt
${CMAKE_CURRENT_SOURCE_DIR}/ukrainian.txt
${CMAKE_CURRENT_SOURCE_DIR}/vietnamese.txt
${CMAKE_CURRENT_SOURCE_DIR}/welsh.txt
)
set(LANG_BINARY_DIR ${CMAKE_BINARY_DIR}/lang)
# Walk over all the (finished) language files, and generate a command to compile them
foreach(LANG_SOURCE_FILE IN LISTS LANG_SOURCE_FILES)
get_filename_component(LANG_SOURCE_FILE_NAME_WE ${LANG_SOURCE_FILE} NAME_WE)
set(LANG_BINARY_FILE ${LANG_BINARY_DIR}/${LANG_SOURCE_FILE_NAME_WE}.lng)
add_custom_command(OUTPUT ${LANG_BINARY_FILE}
COMMAND ${CMAKE_COMMAND} -E make_directory ${LANG_BINARY_DIR}
COMMAND strgen
-s ${CMAKE_CURRENT_SOURCE_DIR}
-d ${LANG_BINARY_DIR}
${LANG_SOURCE_FILE}
DEPENDS strgen
MAIN_DEPENDENCY ${LANG_SOURCE_FILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Compiling language ${LANG_SOURCE_FILE_NAME_WE}"
)
list(APPEND LANG_BINARY_FILES ${LANG_BINARY_FILE})
endforeach(LANG_SOURCE_FILE)
# Create a new target which compiles all language files
add_custom_target(language_files
DEPENDS
${LANG_BINARY_FILES}
)
set_target_properties(language_files
PROPERTIES LANG_SOURCE_FILES "${LANG_SOURCE_FILES}"
)
set(GENERATED_BINARY_DIR ${CMAKE_BINARY_DIR}/generated)
set(TABLE_BINARY_DIR ${GENERATED_BINARY_DIR}/table)
# Generate a command and target to create the strings table
add_custom_command_timestamp(OUTPUT ${TABLE_BINARY_DIR}/strings.h
COMMAND ${CMAKE_COMMAND} -E make_directory ${TABLE_BINARY_DIR}
COMMAND strgen
-s ${CMAKE_CURRENT_SOURCE_DIR}
-d ${TABLE_BINARY_DIR}
DEPENDS strgen ${LANG_SOURCE_FILES}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating table/strings.h"
)
add_custom_target_timestamp(table_strings
DEPENDS
${TABLE_BINARY_DIR}/strings.h
)
add_library(languages
INTERFACE
)
target_include_directories(languages
INTERFACE
${GENERATED_BINARY_DIR}
)
add_dependencies(languages
language_files
table_strings
)
add_library(openttd::languages ALIAS languages)

View File

@@ -936,6 +936,7 @@ STR_GAME_OPTIONS_CURRENCY_MXN :Meksikansk Peso
STR_GAME_OPTIONS_CURRENCY_NTD :Ny Taiwan dollar (NTD)
STR_GAME_OPTIONS_CURRENCY_CNY :Kinesisk Renminbi (CNY)
STR_GAME_OPTIONS_CURRENCY_HKD :Hong Kong Dollar (HKD)
STR_GAME_OPTIONS_CURRENCY_INR :Indisk rupi (INR)
############ end of currency region
STR_GAME_OPTIONS_ROAD_VEHICLES_FRAME :{BLACK}Vejkøretøjer

View File

@@ -988,6 +988,7 @@ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Kali empat
STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Ukuran font
STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal
STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Kali dua
STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :4 kali
STR_GAME_OPTIONS_BASE_GRF :{BLACK}Set Grafik Dasar
@@ -1523,10 +1524,12 @@ STR_CONFIG_SETTING_NEWS_MESSAGES_FULL :Penuh
STR_CONFIG_SETTING_COLOURED_NEWS_YEAR :Berita berwarna tampil pada: {STRING}
STR_CONFIG_SETTING_COLOURED_NEWS_YEAR_HELPTEXT :Tahun saat surat kabar/koran menjadi berwarna. Sebelum tahun ini, koran menggunakan warna hitam-putih
STR_CONFIG_SETTING_STARTING_YEAR :Tahun mulai: {STRING}
STR_CONFIG_SETTING_ENDING_YEAR_ZERO :Tidak pernah
STR_CONFIG_SETTING_SMOOTH_ECONOMY :Aktifkan pertumbuhan ekonomi yang stabil (jarang berubah): {STRING}
STR_CONFIG_SETTING_SMOOTH_ECONOMY_HELPTEXT :Ketika diaktifkan, produksi industri mengalami perubahan lebih sering, dalam gerakan kecil. Pengaturan tidak berpengaruh jika jenis industri disediakan oleh NewGRF
STR_CONFIG_SETTING_ALLOW_SHARES :Ijinkan pembelian saham perusahaan lain: {STRING}
STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :Jika diaktifkan, pemain dibolehkan membeli saham suatu perusahaan. Saham hanya bisa dibeli saat perusahaan memasuki umur tertentu
STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES_HELPTEXT :Set umur minimal perusahaan saat sahamnya dapat dibeli atau dijual.
STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE :Persentase keuntungan akhir dari sistem pengisi: {STRING}
STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE_HELPTEXT :Persentase pendapatan yang diberikan dari sistem pengisi, memberikan lebih banyak kendali pendapatan
STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY :Saat menyeret, tempatkan sinyal setiap: {STRING}
@@ -2697,10 +2700,12 @@ STR_FRAMERATE_RATE_GAMELOOP :{WHITE}Rata sim
STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Jumlah detak permainan tersimulasi per detik.
STR_FRAMERATE_SPEED_FACTOR_TOOLTIP :{BLACK}Beberapa cepat permainan lagi berjalan, dibanding dengan kecepatan diharapkan memakai rata simulasi biasa.
STR_FRAMERATE_CURRENT :{WHITE}Sekarang
STR_FRAMERATE_MEMORYUSE :{WHITE}Memori
STR_FRAMERATE_DATA_POINTS :{WHITE}Data tergantung oleh ukuran {COMMA}
STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL}{WHITE} ms
STR_FRAMERATE_MS_WARN :{YELLOW}{DECIMAL}{WHITE} ms
STR_FRAMERATE_MS_BAD :{RED}{DECIMAL}{WHITE} ms
STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} bingkai/dtk
STR_FRAMERATE_GRAPH_MILLISECONDS :{TINY_FONT}{COMMA} ms
STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} s
############ Leave those lines in this order!!
@@ -2710,6 +2715,7 @@ STR_FRAMERATE_GL_ROADVEHS :{WHITE} Titik k
STR_FRAMERATE_GL_SHIPS :{WHITE} Titik kapal:
STR_FRAMERATE_GL_AIRCRAFT :{WHITE} Titik pesawat:
STR_FRAMERATE_GL_LANDSCAPE :{WHITE} Titik dunia:
STR_FRAMERATE_GL_LINKGRAPH :{BLACK} Jarak tunda linkgraph:
STR_FRAMERATE_DRAWING :{BLACK}Render grafis:
STR_FRAMERATE_DRAWING_VIEWPORTS :{WHITE} Viewport dunia:
STR_FRAMERATE_VIDEO :{BLACK}Keluaran Video:
@@ -2866,6 +2872,8 @@ STR_NEWGRF_SETTINGS_VERSION :{BLACK}Versi: {
STR_NEWGRF_SETTINGS_MIN_VERSION :{BLACK}Versi kompatibel min.: {SILVER}{NUM}
STR_NEWGRF_SETTINGS_MD5SUM :{BLACK}MD5sum: {SILVER}{STRING}
STR_NEWGRF_SETTINGS_PALETTE :{BLACK}Palet/warna: {SILVER}{STRING}
STR_NEWGRF_SETTINGS_PALETTE_DEFAULT :Standar (D)
STR_NEWGRF_SETTINGS_PALETTE_DEFAULT_32BPP :Standar (D) / 32 bpp
STR_NEWGRF_SETTINGS_PARAMETER :{BLACK}Parameter: {SILVER}{STRING}
STR_NEWGRF_SETTINGS_NO_INFO :{BLACK}Tidak ada informasi yang tersedia
@@ -2914,6 +2922,7 @@ STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Lanjutka
STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}Mewakili sprite yang sedang dipilih. Penjajaran diabaikan ketika sprite ini digambar
STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Pindahkan sprite, mengubah offset X dan Y
STR_SPRITE_ALIGNER_RESET_BUTTON :{BLACK}Reset relatif
STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Reset offset relatif saat ini
STR_SPRITE_ALIGNER_PICKER_BUTTON :{BLACK}Pilih sprite
STR_SPRITE_ALIGNER_PICKER_TOOLTIP :{BLACK}Pilih sebuah sprite di manapun pada layar
@@ -3116,6 +3125,7 @@ STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Klik pad
# Story book window
STR_STORY_BOOK_CAPTION :{WHITE}{COMPANY} Buku Cerita
STR_STORY_BOOK_SPECTATOR_CAPTION :{WHITE}Buku Cerita Global
STR_STORY_BOOK_SPECTATOR :Buku Cerita Global
STR_STORY_BOOK_TITLE :{YELLOW}{STRING}
STR_STORY_BOOK_GENERIC_PAGE_ITEM :Halaman {NUM}
STR_STORY_BOOK_SEL_PAGE_TOOLTIP :{BLACK}Loncat ke halaman yang dipilih dari daftar drop-down ini
@@ -3310,6 +3320,7 @@ STR_INDUSTRY_DIRECTORY_CAPTION :{WHITE}Industri
STR_INDUSTRY_DIRECTORY_NONE :{ORANGE}- Tidak Ada -
STR_INDUSTRY_DIRECTORY_ITEM_NOPROD :{ORANGE}{INDUSTRY}
STR_INDUSTRY_DIRECTORY_LIST_CAPTION :{BLACK}Nama-nama industri - klik di nama untuk mengarahkan pandangan utama pada industri. Ctrl+Click akan membuka viewport baru pada lokasi industri
STR_INDUSTRY_DIRECTORY_ACCEPTED_CARGO_FILTER :{BLACK}Muatan diterima: {SILVER}{STRING}
# Industry view
STR_INDUSTRY_VIEW_CAPTION :{WHITE}{INDUSTRY}
@@ -3321,6 +3332,7 @@ STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Industr
STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Membutuhkan:
STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{STRING}{BLACK}{3:STRING}
STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT :{YELLOW}{STRING}{BLACK}: {CARGO_SHORT} menunggu{STRING}
STR_CONFIG_GAME_PRODUCTION :{WHITE}Perubahan produksi (kelipatan 8, hingga 2040)
@@ -3558,10 +3570,12 @@ STR_ENGINE_PREVIEW_CAPTION :{WHITE}Pesan da
STR_ENGINE_PREVIEW_MESSAGE :{GOLD}Kami telah mendesain {STRING} baru - apakah anda tertarik mempergunakan kendaraan ini secara eksklusif , sehingga kami dapat melihat bagaimana kemampuannya sebelum dijual secara masal?
STR_ENGINE_PREVIEW_RAILROAD_LOCOMOTIVE :lokomotif kereta
STR_ENGINE_PREVIEW_ELRAIL_LOCOMOTIVE :lokomotif rel kereta listrik
STR_ENGINE_PREVIEW_MONORAIL_LOCOMOTIVE :lokomotif monorel
STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE :lokomotif maglev
STR_ENGINE_PREVIEW_ROAD_VEHICLE :kendaraan jalan raya
STR_ENGINE_PREVIEW_TRAM_VEHICLE :kendaraan jalan trem
STR_ENGINE_PREVIEW_AIRCRAFT :pesawat
STR_ENGINE_PREVIEW_SHIP :kapal
@@ -4062,6 +4076,7 @@ STR_AI_LIST_ACCEPT_TOOLTIP :{BLACK}Pilih sk
STR_AI_LIST_CANCEL :{BLACK}Batal
STR_AI_LIST_CANCEL_TOOLTIP :{BLACK}Jangan mengubah skrip AI
STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Tangkapan layar Peta Ketinggian
# AI Parameters
STR_AI_SETTINGS_CAPTION :{WHITE}{STRING} Parameter
@@ -4354,6 +4369,7 @@ STR_ERROR_CAN_T_REMOVE_ROAD_FROM :{WHITE}Tidak da
STR_ERROR_CAN_T_REMOVE_TRAMWAY_FROM :{WHITE}Tidak dapat membongkar jalur trem disini...
STR_ERROR_THERE_IS_NO_ROAD :{WHITE}... tidak ada jalan
STR_ERROR_THERE_IS_NO_TRAMWAY :{WHITE}... tidak ada jalur trem
STR_ERROR_NO_SUITABLE_TRAMWAY :{WHITE}Jalur Tram tidak ada yang cocok
# Waterway construction errors
STR_ERROR_CAN_T_BUILD_CANALS :{WHITE}Tidak dapat membangun kanal disini...

View File

@@ -1850,7 +1850,7 @@ STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO_PARAM :{STRING}에 대
STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO_HELPTEXT :"(기본)"은 이 화물 종류에 대한 기본 화물 분배 형식을 따른다는 뜻입니다. "균형"은 대체로 A역에서 B역으로 가려는 화물의 수가 B에서 A로 가려는 화물의 수와 대체로 같다는 뜻입니다. "불균형"은 아무 방향이나 임의의 양만큼 가게 됨을 뜻합니다. "수동"은 자동적인 화물 분배가 일어나지 않고 기존 방식을 사용하겠음을 뜻합니다.
STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO_DEFAULT :(기본)
STR_CONFIG_SETTING_LINKGRAPH_ACCURACY :분배 정확도: {STRING}
STR_CONFIG_SETTING_LINKGRAPH_ACCURACY_HELPTEXT :값이 높으면 높을수록 CPU가 연결 상태를 계산하는 시간이 더 오래 걸립니다. 만약 이 시간이 너무 오래 걸리면 랙 현상이 나타날 것입니다. 하지만, 낮은 값으로 설정하면 분배가 부정확하게 일어나서, 화물이 원하는 곳으로 분배되지 않을 수 있습니다.
STR_CONFIG_SETTING_LINKGRAPH_ACCURACY_HELPTEXT :값이 높으면 높을수록 CPU가 연결 상태를 계산하는 시간이 더 오래 걸립니다. 만약 이 시간이 너무 오래 걸리면 게임이 버벅일 것입니다. 하지만, 낮은 값으로 설정하면 분배가 부정확하게 일어나서, 화물이 원하는 곳으로 분배되지 않을 수 있습니다.
STR_CONFIG_SETTING_DEMAND_DISTANCE :거리에 따른 수요 효과: {STRING}
STR_CONFIG_SETTING_DEMAND_DISTANCE_HELPTEXT :이 값을 0보다 크게 설정하면, 어떤 화물이 있는 A역과 목적지가 될 수 있는 역 B 사이의 거리는 A에서 B로 가는 화물의 양에 영향을 미치게 됩니다. A역에서 B역이 더 멀리 떨어질 수록 이동하는 화물의 양은 적어질 것입니다. 값이 크면 클 수록 화물은 멀리 이동하지 않고 가까운 역으로 가게 됩니다.
STR_CONFIG_SETTING_DEMAND_SIZE :균형 모드에서 되돌아오는 화물의 양: {STRING}

View File

@@ -1315,6 +1315,7 @@ STR_GAME_OPTIONS_CURRENCY_MXN :Peso meksykańs
STR_GAME_OPTIONS_CURRENCY_NTD :Nowy dolar tajwański (TWD)
STR_GAME_OPTIONS_CURRENCY_CNY :Juan chiński (CNY)
STR_GAME_OPTIONS_CURRENCY_HKD :Dolar hongkoński (HKD)
STR_GAME_OPTIONS_CURRENCY_INR :Rupia Indyjska (INR)
############ end of currency region
STR_GAME_OPTIONS_ROAD_VEHICLES_FRAME :{BLACK}Pojazdy drogowe

View File

@@ -864,6 +864,7 @@ STR_NEWS_NEW_VEHICLE_NOW_AVAILABLE :{BIG_FONT}{BLAC
STR_NEWS_NEW_VEHICLE_TYPE :{BIG_FONT}{BLACK}{ENGINE}
STR_NEWS_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE :{BLACK}Ny {STRING} är nu tillgänglig - {ENGINE}
STR_NEWS_SHOW_VEHICLE_GROUP_TOOLTIP :{BLACK}Öppna gruppfönstret fokuserat på fordonets grupp
STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO :{WHITE}{STATION} tar inte längre emot {STRING}
STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO_OR_CARGO :{WHITE}{STATION} tar inte längre emot {STRING} eller {STRING}
@@ -934,6 +935,7 @@ STR_GAME_OPTIONS_CURRENCY_MXN :Mexikansk peso
STR_GAME_OPTIONS_CURRENCY_NTD :Nya Taiwanesisk dollar (NTD)
STR_GAME_OPTIONS_CURRENCY_CNY :Kinesisk Renminbi (CNY)
STR_GAME_OPTIONS_CURRENCY_HKD :Hongkongdollar (HKD)
STR_GAME_OPTIONS_CURRENCY_INR :Indisk rupie (INR)
############ end of currency region
STR_GAME_OPTIONS_ROAD_VEHICLES_FRAME :{BLACK}Vägfordon
@@ -1160,7 +1162,7 @@ STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN_HELPTEXT :Maximalt belopp
STR_CONFIG_SETTING_INTEREST_RATE :Räntenivå: {STRING}
STR_CONFIG_SETTING_INTEREST_RATE_HELPTEXT :Räntenivå för lån; styr även inflationen om sådan är aktiverad
STR_CONFIG_SETTING_RUNNING_COSTS :Driftkostnader: {STRING}
STR_CONFIG_SETTING_RUNNING_COSTS_HELPTEXT :Sätt nivån för underhålls- och driftkostnader för fordon och infrastruktur
STR_CONFIG_SETTING_RUNNING_COSTS_HELPTEXT :Sätt nivån för underhålls- och driftskostnader för fordon och infrastruktur
STR_CONFIG_SETTING_CONSTRUCTION_SPEED :Konstruktionshastighet: {STRING}
STR_CONFIG_SETTING_CONSTRUCTION_SPEED_HELPTEXT :Begränsar antalet konstruktionshandlingar för AI-spelare
STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS :Fordonshaverier: {STRING}
@@ -1308,6 +1310,8 @@ STR_CONFIG_SETTING_POPULATION_IN_LABEL :Visa invånaran
STR_CONFIG_SETTING_POPULATION_IN_LABEL_HELPTEXT :Visa antal invånare efter stadsnamnen på kartan
STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS :Linjetjocklek i grafer: {STRING}
STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Linjernas bredd i grafernas kurvor. En tunn linje är lättare att läsa av mer precist, medan en tjockare linje är lättare att se och gör det lättare att skilja mellan de olika färgerna
STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Visa NewGRF:ens namn i fordonsbyggnadsfönstret: {STRING}
STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :Lägg till en rad i fordonsbyggnadsfönstret som visar vilken NewGRF det valda fordonet kommer ifrån.
STR_CONFIG_SETTING_LANDSCAPE :Landskap: {STRING}
STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Landskap definiera grundläggande gameplay scenarier med olika last och krav stad tillväxt. NewGRF och Game skript tillåter finare kontroll.
@@ -1319,8 +1323,8 @@ STR_CONFIG_SETTING_TERRAIN_TYPE :Terrängtyp: {S
STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT :(TerraGenesis endast) Hilliness av landskapet
STR_CONFIG_SETTING_INDUSTRY_DENSITY :Industritäthet: {STRING}
STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :Ange hur många industrier som ska genereras och vilken nivå som ska bibehållas under spelet
STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Maximalt avstånd mellan oljeraffinaderier och kartans kant: {STRING}
STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Oljeraffinaderier byggs bara nära kartans kanter, alltså vid kusten om det är en ö-karta
STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Maximalt avstånd mellan oljeindustrier och kartans kant: {STRING}
STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Begränsar hur långt från kartans kant oljeraffinaderier och oljeplattformar kan byggas. På ö-kartor säkerställer detta att de är nära kusten. På kartor större än 256 rutor skalas detta värde upp.
STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Snögränsens höjd: {STRING}
STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Kontrollerar på vilken höjd snön börjar i det subarktiska landskapet. Snö påverkar även industrigeneration och städers tillväxtkrav
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Terrängens svårhetsgrad: {STRING}
@@ -1545,10 +1549,16 @@ STR_CONFIG_SETTING_NEWS_MESSAGES_FULL :På
STR_CONFIG_SETTING_COLOURED_NEWS_YEAR :Nyheter i färg visas efter: {STRING}
STR_CONFIG_SETTING_COLOURED_NEWS_YEAR_HELPTEXT :Årtal då tidningens nyhetsartiklar börjar tryckas i färg. Innan detta år används monokromt svart/vitt
STR_CONFIG_SETTING_STARTING_YEAR :Startår: {STRING}
STR_CONFIG_SETTING_ENDING_YEAR :Slutår för poängräkning: {STRING}
STR_CONFIG_SETTING_ENDING_YEAR_HELPTEXT :Årtal då spelet slutar räkna poäng. Vid slutet av detta år sparas företagets poäng och listan med de bästa spelresultaten visas, men därefter kan spelarna fortsätta att spela.{}Om årtalet är satt till innan startåret visas aldrig de bästa spelresultaten.
STR_CONFIG_SETTING_ENDING_YEAR_VALUE :{NUM}
STR_CONFIG_SETTING_ENDING_YEAR_ZERO :Aldrig
STR_CONFIG_SETTING_SMOOTH_ECONOMY :Lugn ekonomi (flera små ändringar): {STRING}
STR_CONFIG_SETTING_SMOOTH_ECONOMY_HELPTEXT :När det är aktiverat ändras industriproduktionen oftare och i mindre steg. Den här inställningen har vanligtvis ingen effekt om de olika industrityperna kommer från en NewGRF
STR_CONFIG_SETTING_ALLOW_SHARES :Tillåt köp av aktier från andra företag: {STRING}
STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :När det är aktiverat blir det tillåtet att köpa och sälja andelar i företag. För att dess andelar ska bli tillgängliga måste ett företag ha uppnått en viss ålder
STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES :Lägsta företagsålder för aktiehandel: {STRING}
STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES_HELPTEXT :Ställ in den lägsta ålder från vilken ett företags aktier kan köpas och säljas av andra företag.
STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE :Inkomstprocent per etapp i matarsystem: {STRING}
STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE_HELPTEXT :Procentandel av inkomsten som ges till de mellanliggande etapperna i matarsystem. Ger mer kontroll över inkomsterna
STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY :Vid dragning med verktyget, placera en signal per: {STRING}
@@ -1590,7 +1600,7 @@ STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :Förbjuden
STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :Tillåten
STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :Tillåten, vanlig stads-layout
STR_CONFIG_SETTING_TOWN_CARGOGENMODE :Fraktgods som genereras i staden: {STRING}
STR_CONFIG_SETTING_TOWN_CARGOGENMODE_HELPTEXT :Hur mycket fraktgods produceras av hus i städer, i förhållande till den totala befolkningen i staden.{}Kvadratisk tillväxt: En stad dubbelt så stor genererar fyra gånger så många passagerare.{}Linjär tillväxt: En stad dubbelt så stor genererar dubbelt så många passagerare.
STR_CONFIG_SETTING_TOWN_CARGOGENMODE_HELPTEXT :Hur mycket fraktgods som produceras av hus i städer, i förhållande till den totala befolkningen i staden.{}Kvadratisk tillväxt: En dubbelt så stor stad genererar fyra gånger så många passagerare.{}Linjär tillväxt: En dubbelt så stor stad genererar dubbelt så många passagerare.
STR_CONFIG_SETTING_TOWN_CARGOGENMODE_ORIGINAL :Kvadratisk (original)
STR_CONFIG_SETTING_TOWN_CARGOGENMODE_BITCOUNT :Linjär
@@ -2156,6 +2166,7 @@ STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Fel lös
STR_NETWORK_ERROR_SERVER_FULL :{WHITE}Servern är full
STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}Du är bannlyst från den här servern
STR_NETWORK_ERROR_KICKED :{WHITE}Du blev utkastad från spelet
STR_NETWORK_ERROR_KICK_MESSAGE :{WHITE}Orsak: {STRING}
STR_NETWORK_ERROR_CHEATER :{WHITE}Fusk är inte tillåtet på denna server
STR_NETWORK_ERROR_TOO_MANY_COMMANDS :{WHITE}Du skickade för många kommandon till servern
STR_NETWORK_ERROR_TIMEOUT_PASSWORD :{WHITE}Du tog för lång tid på dig att mata in löserondet
@@ -2215,6 +2226,7 @@ STR_NETWORK_MESSAGE_GIVE_MONEY :*** {STRING} ga
STR_NETWORK_MESSAGE_GAVE_MONEY_AWAY :*** You gave {1:STRING} {2:CURRENCY_LONG}
STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}Servern avslutade sessionen
STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Servern startar om...{}Var vänlig vänta...
STR_NETWORK_MESSAGE_KICKED :*** {STRING} kastades ut. Orsak: ({STRING})
# Content downloading window
STR_CONTENT_TITLE :{WHITE}Nedladdning av innehåll
@@ -3042,7 +3054,7 @@ STR_NEWGRF_BROKEN_CAPACITY :{WHITE}Kapacite
STR_BROKEN_VEHICLE_LENGTH :{WHITE}Tåg '{VEHICLE}' som tillhör '{COMPANY}' har ogiltig längd. Detta orsakas förmodligen av problem med en NewGRF. Spelet kan desynkroniseras eller krascha
STR_NEWGRF_BUGGY :{WHITE}NewGRF '{0:STRING}' ger felaktig information
STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Last/återställnings information för '{1:ENGINE}' är skilld ifrån köp lista efter konstruktion. Detta kan leda till att utomatisk förnyelse/uppgradering misslyckas med att anpassa fordonen/vagnarna korrekt
STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Last-/återställningsinformationen för '{1:ENGINE}' skiljer sig från köplistan efter konstruktion. Detta kan leda till att automatisk förnyelse/uppgradering misslyckas med att anpassa fordonen/vagnarna korrekt
STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' skapade en oändlig loop i en produktions-callback-funktion
STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Callback-funktion {1:HEX} returnerade ett okänt/ogiltligt resultat {2:HEX}
STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' returnerade ogiltig lasttyp i produktions-callback vid {2:HEX}
@@ -3112,6 +3124,8 @@ STR_TOWN_VIEW_RENAME_TOWN_BUTTON :Byt namn på st
# Town local authority window
STR_LOCAL_AUTHORITY_CAPTION :{WHITE}{TOWN} lokala myndigheter
STR_LOCAL_AUTHORITY_ZONE :{BLACK}Zon
STR_LOCAL_AUTHORITY_ZONE_TOOLTIP :{BLACK}Visa zonen som ryms inom de lokala myndigheternas gränser
STR_LOCAL_AUTHORITY_COMPANY_RATINGS :{BLACK}Transportföretags värderingar:
STR_LOCAL_AUTHORITY_COMPANY_RATING :{YELLOW}{COMPANY} {COMPANY_NUM}: {ORANGE}{STRING}
STR_LOCAL_AUTHORITY_ACTIONS_TITLE :{BLACK}Tillgängliga åtgärder:
@@ -3207,7 +3221,7 @@ STR_STATION_LIST_STATION :{YELLOW}{STATIO
STR_STATION_LIST_WAYPOINT :{YELLOW}{WAYPOINT}
STR_STATION_LIST_NONE :{YELLOW}- Inga -
STR_STATION_LIST_SELECT_ALL_FACILITIES :{BLACK}Markera alla inrättningar
STR_STATION_LIST_SELECT_ALL_TYPES :{BLACK}Välj alla last-typer (inklusive icke väntande last)
STR_STATION_LIST_SELECT_ALL_TYPES :{BLACK}Välj alla typer av last (inklusive icke väntande last)
STR_STATION_LIST_NO_WAITING_CARGO :{BLACK}Ingen sorts last väntar
# Station view window
@@ -3382,8 +3396,17 @@ STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL :{WHITE}{CURRENC
# Industry directory
STR_INDUSTRY_DIRECTORY_CAPTION :{WHITE}Industrier
STR_INDUSTRY_DIRECTORY_NONE :{ORANGE}- Inga -
STR_INDUSTRY_DIRECTORY_ITEM_INFO :{BLACK}{CARGO_LONG}{STRING}{YELLOW} ({COMMA}% transporterat){BLACK}
STR_INDUSTRY_DIRECTORY_ITEM_NOPROD :{ORANGE}{INDUSTRY}
STR_INDUSTRY_DIRECTORY_ITEM_PROD1 :{ORANGE}{INDUSTRY} {STRING}
STR_INDUSTRY_DIRECTORY_ITEM_PROD2 :{ORANGE}{INDUSTRY} {STRING}, {STRING}
STR_INDUSTRY_DIRECTORY_ITEM_PROD3 :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING}
STR_INDUSTRY_DIRECTORY_ITEM_PRODMORE :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING} och {NUM} till...
STR_INDUSTRY_DIRECTORY_LIST_CAPTION :{BLACK}Industrinamn - klicka på namnet för att centrera huvudvyn över industrin. Ctrl+klick öppnar en ny vy över industrins läge
STR_INDUSTRY_DIRECTORY_ACCEPTED_CARGO_FILTER :{BLACK}Accepterat gods: {SILVER}{STRING}
STR_INDUSTRY_DIRECTORY_PRODUCED_CARGO_FILTER :{BLACK}Producerat fraktgods: {SILVER}{STRING}
STR_INDUSTRY_DIRECTORY_FILTER_ALL_TYPES :Alla typer av last
STR_INDUSTRY_DIRECTORY_FILTER_NONE :Inga
# Industry view
STR_INDUSTRY_VIEW_CAPTION :{WHITE}{INDUSTRY}
@@ -4158,6 +4181,13 @@ STR_AI_LIST_ACCEPT_TOOLTIP :{BLACK}Välj ma
STR_AI_LIST_CANCEL :{BLACK}Avbryt
STR_AI_LIST_CANCEL_TOOLTIP :{BLACK}Ändra inte datorspelare
STR_SCREENSHOT_CAPTION :{WHITE}Ta en skärmdump
STR_SCREENSHOT_SCREENSHOT :{BLACK}Vanlig skärmdump
STR_SCREENSHOT_ZOOMIN_SCREENSHOT :{BLACK}Fullt inzoomad skärmdump
STR_SCREENSHOT_DEFAULTZOOM_SCREENSHOT :{BLACK}Skärmdump med grundinställd zoomnivå
STR_SCREENSHOT_WORLD_SCREENSHOT :{BLACK}Skärmdump med hela kartan
STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Skärmdump av höjdkarta
STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Skärmdump av miniatyrkartan
# AI Parameters
STR_AI_SETTINGS_CAPTION :{WHITE}{STRING} parametrar

View File

@@ -4298,6 +4298,7 @@ STR_AI_LIST_ACCEPT_TOOLTIP :{BLACK}Вибр
STR_AI_LIST_CANCEL :{BLACK}Відміна
STR_AI_LIST_CANCEL_TOOLTIP :{BLACK}Не міняти скрипт
STR_SCREENSHOT_CAPTION :{WHITE}Зробити знімок екрану
# AI Parameters
STR_AI_SETTINGS_CAPTION :{WHITE}{STRING} Параметри

View File

@@ -0,0 +1,22 @@
add_files(
demands.cpp
demands.h
flowmapper.cpp
flowmapper.h
init.h
linkgraph.cpp
linkgraph.h
linkgraph_base.h
linkgraph_gui.cpp
linkgraph_gui.h
linkgraph_type.h
linkgraphjob.cpp
linkgraphjob.h
linkgraphjob_base.h
linkgraphschedule.cpp
linkgraphschedule.h
mcf.cpp
mcf.h
refresh.cpp
refresh.h
)

14
src/misc/CMakeLists.txt Normal file
View File

@@ -0,0 +1,14 @@
add_files(
array.hpp
binaryheap.hpp
blob.hpp
countedobj.cpp
countedptr.hpp
dbg_helpers.cpp
dbg_helpers.h
fixedsizearray.hpp
getoptdata.cpp
getoptdata.h
hashtable.hpp
str.hpp
)

54
src/music/CMakeLists.txt Normal file
View File

@@ -0,0 +1,54 @@
if (NOT OPTION_DEDICATED)
add_files(
allegro_m.cpp
allegro_m.h
CONDITION Allegro_FOUND
)
add_files(
fluidsynth.cpp
fluidsynth.h
CONDITION Fluidsynth_FOUND
)
add_files(
cocoa_m.cpp
cocoa_m.h
CONDITION APPLE
)
add_files(
dmusic.cpp
dmusic.h
win32_m.cpp
win32_m.h
CONDITION WIN32
)
add_files(
extmidi.cpp
extmidi.h
CONDITION UNIX
)
add_files(
bemidi.cpp
bemidi.h
CONDITION OPTION_HAIKU
)
add_files(
os2_m.cpp
os2_m.h
CONDITION OPTION_OS2
)
endif (NOT OPTION_DEDICATED)
add_files(
midi.h
midifile.cpp
midifile.hpp
music_driver.hpp
null_m.cpp
null_m.h
)

View File

@@ -7,8 +7,6 @@
/** @file dmusic.cpp Playing music via DirectMusic. */
#ifdef WIN32_ENABLE_DIRECTMUSIC_SUPPORT
#define INITGUID
#include "../stdafx.h"
#ifdef WIN32_LEAN_AND_MEAN
@@ -1244,6 +1242,3 @@ void MusicDriver_DMusic::SetVolume(byte vol)
{
_playback.new_volume = vol;
}
#endif /* WIN32_ENABLE_DIRECTMUSIC_SUPPORT */

View File

@@ -0,0 +1,28 @@
add_subdirectory(core)
add_files(
network.cpp
network.h
network_admin.cpp
network_admin.h
network_base.h
network_chat_gui.cpp
network_client.cpp
network_client.h
network_command.cpp
network_content.cpp
network_content.h
network_content_gui.cpp
network_content_gui.h
network_func.h
network_gamelist.cpp
network_gamelist.h
network_gui.cpp
network_gui.h
network_internal.h
network_server.cpp
network_server.h
network_type.h
network_udp.cpp
network_udp.h
)

View File

@@ -0,0 +1,27 @@
add_files(
address.cpp
address.h
config.h
core.cpp
core.h
game.h
host.cpp
host.h
os_abstraction.h
packet.cpp
packet.h
tcp.cpp
tcp.h
tcp_admin.cpp
tcp_admin.h
tcp_connect.cpp
tcp_content.cpp
tcp_content.h
tcp_game.cpp
tcp_game.h
tcp_http.cpp
tcp_http.h
tcp_listen.h
udp.cpp
udp.h
)

View File

@@ -96,7 +96,6 @@ void NetworkAddress::GetAddressAsString(char *buffer, const char *last, bool wit
* Get the address as a string, e.g. 127.0.0.1:12345.
* @param with_family whether to add the family (e.g. IPvX).
* @return the address
* @note NOT thread safe
*/
const char *NetworkAddressDumper::GetAddressAsString(NetworkAddress *addr, bool with_family)
{

View File

@@ -15,6 +15,8 @@
#include "../../string_func.h"
#include "../../core/smallmap_type.hpp"
#include <string>
class NetworkAddress;
typedef std::vector<NetworkAddress> NetworkAddressList; ///< Type for a list of addresses.
typedef SmallMap<NetworkAddress, SOCKET> SocketList; ///< Type for a mapping between address and socket.
@@ -91,6 +93,7 @@ public:
const char *GetHostname();
void GetAddressAsString(char *buffer, const char *last, bool with_family = true);
std::string GetAddressAsString(bool with_family = true);
const sockaddr_storage *GetAddress();
/**

4
src/os/CMakeLists.txt Normal file
View File

@@ -0,0 +1,4 @@
add_subdirectory(macosx)
add_subdirectory(os2)
add_subdirectory(unix)
add_subdirectory(windows)

View File

@@ -0,0 +1,11 @@
add_files(
crashlog_osx.cpp
macos.h
macos.mm
osx_stdafx.h
splash.cpp
splash.h
string_osx.cpp
string_osx.h
CONDITION APPLE
)

View File

@@ -0,0 +1,4 @@
add_files(
os2.cpp
CONDITION OPTION_OS2
)

View File

@@ -0,0 +1,9 @@
add_files(
crashlog_unix.cpp
CONDITION UNIX AND NOT APPLE AND NOT OPTION_OS2
)
add_files(
unix.cpp
CONDITION UNIX AND NOT OPTION_OS2
)

View File

@@ -0,0 +1,8 @@
add_files(
crashlog_win.cpp
string_uniscribe.cpp
string_uniscribe.h
win32.cpp
win32.h
CONDITION WIN32
)

View File

@@ -37,7 +37,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
100 ICON DISCARDABLE "../../../media/openttd.ico"
100 ICON DISCARDABLE "${CMAKE_SOURCE_DIR}/os/windows/openttd.ico"
/////////////////////////////////////////////////////////////////////////////
//
@@ -77,8 +77,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,11,0,!!ISODATE!!
PRODUCTVERSION 1,11,0,!!ISODATE!!
FILEVERSION 1,11,0,${REV_ISODATE}
PRODUCTVERSION 1,11,0,${REV_ISODATE}
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -96,14 +96,14 @@ BEGIN
VALUE "Comments", "This program is licensed under the GNU General Public License version 2.\0"
VALUE "CompanyName", "OpenTTD Development Team\0"
VALUE "FileDescription", "OpenTTD\0"
VALUE "FileVersion", "!!VERSION!!\0"
VALUE "FileVersion", "${REV_VERSION}\0"
VALUE "InternalName", "openttd\0"
VALUE "LegalCopyright", "Copyright \xA9 OpenTTD Developers 2002-!!YEAR!!. All Rights Reserved.\0"
VALUE "LegalCopyright", "Copyright \xA9 OpenTTD Developers 2002-${REV_YEAR}. All Rights Reserved.\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "openttd.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "OpenTTD\0"
VALUE "ProductVersion", "!!VERSION!!\0"
VALUE "ProductVersion", "${REV_VERSION}\0"
VALUE "SpecialBuild", "-\0"
END
END
@@ -116,7 +116,7 @@ END
#endif // !_MAC
#ifdef __MINGW32__
1 24 "../../../projects/dpi_aware.manifest"
1 24 "${CMAKE_SOURCE_DIR}/os/windows/openttd.manifest"
#endif
#endif // Neutral (Default) resources

View File

@@ -7,8 +7,6 @@
/** @file string_uniscribe.cpp Functions related to laying out text on Win32. */
#if defined(WITH_UNISCRIBE)
#include "../../stdafx.h"
#include "../../debug.h"
#include "string_uniscribe.h"
@@ -620,5 +618,3 @@ const int *UniscribeParagraphLayout::UniscribeVisualRun::GetGlyphToCharMap() con
return this->utf16_to_utf8[this->cur_pos];
}
#endif /* defined(WITH_UNISCRIBE) */

View File

@@ -10,8 +10,6 @@
#ifndef STRING_UNISCRIBE_H
#define STRING_UNISCRIBE_H
#if defined(WITH_UNISCRIBE)
#include "../../gfx_layout.h"
#include "../../string_base.h"
#include <vector>
@@ -85,6 +83,4 @@ public:
size_t Prev(IterType what) override;
};
#endif /* defined(WITH_UNISCRIBE) */
#endif /* STRING_UNISCRIBE_H */

View File

@@ -0,0 +1,9 @@
add_subdirectory(npf)
add_subdirectory(yapf)
add_files(
follow_track.hpp
pathfinder_func.h
pathfinder_type.h
pf_performance_timer.hpp
)

View File

@@ -0,0 +1,8 @@
add_files(
aystar.cpp
aystar.h
npf.cpp
npf_func.h
queue.cpp
queue.h
)

View File

@@ -0,0 +1,20 @@
add_files(
nodelist.hpp
yapf.h
yapf.hpp
yapf_base.hpp
yapf_cache.h
yapf_common.hpp
yapf_costbase.hpp
yapf_costcache.hpp
yapf_costrail.hpp
yapf_destrail.hpp
yapf_node.hpp
yapf_node_rail.hpp
yapf_node_road.hpp
yapf_node_ship.hpp
yapf_rail.cpp
yapf_road.cpp
yapf_ship.cpp
yapf_type.hpp
)

View File

@@ -35,7 +35,7 @@ bool IsReleasedVersion()
*
* <modified> shows a "M", if the binary is made from modified source code.
*/
const char _openttd_revision[] = "!!VERSION!!";
const char _openttd_revision[] = "${REV_VERSION}";
/**
* The text version of OpenTTD's build date.
@@ -59,12 +59,12 @@ const char _openttd_build_configure_defines[] = "!!CONFIGURE_DEFINES!!";
/**
* The git revision hash of this version.
*/
const char _openttd_revision_hash[] = "!!GITHASH!!";
const char _openttd_revision_hash[] = "${REV_HASH}";
/**
* The year of this version.
*/
const char _openttd_revision_year[] = "!!YEAR!!";
const char _openttd_revision_year[] = "${REV_YEAR}";
/**
* Let us know if current build was modified. This detection
@@ -74,14 +74,14 @@ const char _openttd_revision_year[] = "!!YEAR!!";
* (compiling from sources without any version control software)
* and 2 is for modified revision.
*/
const byte _openttd_revision_modified = !!MODIFIED!!;
const byte _openttd_revision_modified = ${REV_MODIFIED};
/**
* Indicate whether this is a tagged version.
* If this is non-0, then _openttd_revision is the name of the tag,
* and the version is likely a beta, release candidate, or real release.
*/
const byte _openttd_revision_tagged = !!ISTAG!!;
const byte _openttd_revision_tagged = ${REV_ISTAG};
/**
* The NewGRF revision of OTTD:
@@ -96,4 +96,4 @@ const byte _openttd_revision_tagged = !!ISTAG!!;
* final release will always have a lower version number than the released
* version, thus making comparisons on specific revisions easy.
*/
const uint32 _openttd_newgrf_version = 1 << 28 | 11 << 24 | 0 << 20 | !!ISSTABLETAG!! << 19 | 28004;
const uint32 _openttd_newgrf_version = 1 << 28 | 11 << 24 | 0 << 20 | ${REV_ISSTABLETAG} << 19 | 28004;

View File

@@ -0,0 +1,54 @@
add_files(
afterload.cpp
ai_sl.cpp
airport_sl.cpp
animated_tile_sl.cpp
autoreplace_sl.cpp
bridge_signal_sl.cpp
cargomonitor_sl.cpp
cargopacket_sl.cpp
cheat_sl.cpp
company_sl.cpp
debug_sl.cpp
depot_sl.cpp
economy_sl.cpp
engine_sl.cpp
extended_ver_sl.cpp
extended_ver_sl.h
game_sl.cpp
gamelog_sl.cpp
goal_sl.cpp
group_sl.cpp
industry_sl.cpp
labelmaps_sl.cpp
linkgraph_sl.cpp
map_sl.cpp
misc_sl.cpp
newgrf_sl.cpp
newgrf_sl.h
object_sl.cpp
oldloader.cpp
oldloader.h
oldloader_sl.cpp
order_sl.cpp
plans_sl.cpp
saveload.cpp
saveload.h
saveload_buffer.h
saveload_filter.h
saveload_internal.h
signal_sl.cpp
signs_sl.cpp
station_sl.cpp
storage_sl.cpp
strings_sl.cpp
story_sl.cpp
subsidy_sl.cpp
tbtr_template_replacement_sl.cpp
tbtr_template_veh_sl.cpp
town_sl.cpp
tracerestrict_sl.cpp
tunnel_sl.cpp
vehicle_sl.cpp
waypoint_sl.cpp
)

23
src/script/CMakeLists.txt Normal file
View File

@@ -0,0 +1,23 @@
add_subdirectory(api)
add_files(
script_config.cpp
script_config.hpp
script_fatalerror.hpp
script_info.cpp
script_info.hpp
script_info_dummy.cpp
script_instance.cpp
script_instance.hpp
script_scanner.cpp
script_scanner.hpp
script_storage.hpp
script_suspend.hpp
squirrel.cpp
squirrel.hpp
squirrel_class.hpp
squirrel_helper.hpp
squirrel_helper_type.hpp
squirrel_std.cpp
squirrel_std.hpp
)

View File

@@ -0,0 +1,140 @@
add_files(
ai_changelog.hpp
game_changelog.hpp
script_accounting.hpp
script_admin.hpp
script_airport.hpp
script_base.hpp
script_basestation.hpp
script_bridge.hpp
script_bridgelist.hpp
script_cargo.hpp
script_cargolist.hpp
script_cargomonitor.hpp
script_client.hpp
script_clientlist.hpp
script_company.hpp
script_companymode.hpp
script_controller.hpp
script_date.hpp
script_depotlist.hpp
script_engine.hpp
script_enginelist.hpp
script_error.hpp
script_event.hpp
script_event_types.hpp
script_execmode.hpp
script_game.hpp
script_gamesettings.hpp
script_goal.hpp
script_group.hpp
script_grouplist.hpp
script_industry.hpp
script_industrylist.hpp
script_industrytype.hpp
script_industrytypelist.hpp
script_info_docs.hpp
script_infrastructure.hpp
script_list.hpp
script_log.hpp
script_map.hpp
script_marine.hpp
script_news.hpp
script_object.hpp
script_order.hpp
script_priorityqueue.hpp
script_rail.hpp
script_railtypelist.hpp
script_road.hpp
script_roadtypelist.hpp
script_sign.hpp
script_signlist.hpp
script_station.hpp
script_stationlist.hpp
script_story_page.hpp
script_storypagelist.hpp
script_storypageelementlist.hpp
script_subsidy.hpp
script_subsidylist.hpp
script_testmode.hpp
script_text.hpp
script_tile.hpp
script_tilelist.hpp
script_town.hpp
script_townlist.hpp
script_tunnel.hpp
script_types.hpp
script_vehicle.hpp
script_vehiclelist.hpp
script_viewport.hpp
script_waypoint.hpp
script_waypointlist.hpp
script_window.hpp
script_accounting.cpp
script_admin.cpp
script_airport.cpp
script_base.cpp
script_basestation.cpp
script_bridge.cpp
script_bridgelist.cpp
script_cargo.cpp
script_cargolist.cpp
script_cargomonitor.cpp
script_client.cpp
script_clientlist.cpp
script_company.cpp
script_companymode.cpp
script_controller.cpp
script_date.cpp
script_depotlist.cpp
script_engine.cpp
script_enginelist.cpp
script_error.cpp
script_event.cpp
script_event_types.cpp
script_execmode.cpp
script_game.cpp
script_gamesettings.cpp
script_goal.cpp
script_group.cpp
script_grouplist.cpp
script_industry.cpp
script_industrylist.cpp
script_industrytype.cpp
script_industrytypelist.cpp
script_infrastructure.cpp
script_list.cpp
script_log.cpp
script_map.cpp
script_marine.cpp
script_news.cpp
script_object.cpp
script_order.cpp
script_priorityqueue.cpp
script_rail.cpp
script_railtypelist.cpp
script_road.cpp
script_roadtypelist.cpp
script_sign.cpp
script_signlist.cpp
script_station.cpp
script_stationlist.cpp
script_story_page.cpp
script_storypagelist.cpp
script_storypageelementlist.cpp
script_subsidy.cpp
script_subsidylist.cpp
script_testmode.cpp
script_text.cpp
script_tile.cpp
script_tilelist.cpp
script_town.cpp
script_townlist.cpp
script_tunnel.cpp
script_vehicle.cpp
script_vehiclelist.cpp
script_viewport.cpp
script_waypoint.cpp
script_waypointlist.cpp
script_window.cpp
)

View File

@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.5)
project(settingsgen)
set(sourcefiles
settingsgen.cpp
../core/alloc_func.cpp
../misc/getoptdata.cpp
../ini_load.cpp
../string.cpp
)
add_definitions(-DSETTINGSGEN)
add_executable(settingsgen ${sourcefiles})

View File

@@ -250,7 +250,8 @@ public:
* @return true if the list sequence has been altered
*
*/
bool Sort(SortFunction *compare)
template <typename Comp>
bool Sort(Comp compare)
{
/* Do not sort if the resort bit is not set */
if (!(this->flags & VL_RESORT)) return false;

43
src/sound/CMakeLists.txt Normal file
View File

@@ -0,0 +1,43 @@
if (NOT OPTION_DEDICATED)
add_files(
allegro_s.cpp
allegro_s.h
CONDITION Allegro_FOUND
)
add_files(
sdl_s.cpp
sdl_s.h
CONDITION SDL_FOUND
)
add_files(
sdl2_s.cpp
sdl_s.h
CONDITION SDL2_FOUND
)
add_files(
cocoa_s.cpp
cocoa_s.h
CONDITION APPLE
)
add_files(
win32_s.cpp
win32_s.h
CONDITION WIN32
)
add_files(
xaudio2_s.cpp
xaudio2_s.h
CONDITION WIN32 AND XAUDIO2_FOUND
)
endif (NOT OPTION_DEDICATED)
add_files(
sound_driver.hpp
null_s.cpp
null_s.h
)

View File

@@ -7,8 +7,6 @@
/** @file xaudio2_s.cpp XAudio2 sound driver. */
#ifdef WITH_XAUDIO2
#include "../stdafx.h"
#include "../openttd.h"
#include "../driver.h"
@@ -267,5 +265,3 @@ void SoundDriver_XAudio2::Stop()
FreeLibrary(_xaudio_dll_handle);
CoUninitialize();
}
#endif

View File

@@ -0,0 +1,5 @@
add_files(
grf.cpp
grf.hpp
spriteloader.hpp
)

View File

@@ -10,6 +10,13 @@
#ifndef STDAFX_H
#define STDAFX_H
#ifdef _MSC_VER
/* Stop Microsoft (and clang-cl) compilers from complaining about potentially-unsafe/potentially-non-standard functions */
# define _CRT_SECURE_NO_DEPRECATE
# define _CRT_SECURE_NO_WARNINGS
# define _CRT_NONSTDC_NO_WARNINGS
#endif
#if defined(__APPLE__)
#include "os/macosx/osx_stdafx.h"
#endif /* __APPLE__ */
@@ -173,7 +180,6 @@
#endif /* (_MSC_VER < 1400) */
#pragma warning(disable: 4291) // no matching operator delete found; memory will not be freed if initialization throws an exception (reason: our overloaded functions never throw an exception)
#pragma warning(disable: 4996) // 'function': was declared deprecated
#define _CRT_SECURE_NO_DEPRECATE // all deprecated 'unsafe string functions
#pragma warning(disable: 6308) // code analyzer: 'realloc' might return null pointer: assigning null pointer to 't_ptr', which is passed as an argument to 'realloc', will cause the original memory block to be leaked
#pragma warning(disable: 6011) // code analyzer: Dereferencing nullptr pointer 'pfGetAddrInfo': Lines: 995, 996, 998, 999, 1001
#pragma warning(disable: 6326) // code analyzer: potential comparison of a constant with another constant
@@ -194,7 +200,11 @@
#define CDECL _cdecl
#define WARN_FORMAT(string, args)
#define FINAL sealed
# ifndef __clang__
# define FINAL sealed
# else
# define FINAL
# endif
/* fallthrough attribute, VS 2017 */
#if (_MSC_VER >= 1910)
@@ -430,17 +440,14 @@ void NORETURN CDECL assert_msg_error(int line, const char *file, const char *exp
const char *assert_tile_info(uint32 tile);
#define NOT_REACHED() error("NOT_REACHED triggered at line %i of %s", __LINE__, __FILE__)
/* For non-debug builds with assertions enabled use the special assertion handler:
* - For MSVC: NDEBUG is set for all release builds and WITH_ASSERT overrides the disabling of asserts.
* - For non MSVC: NDEBUG is set when assertions are disables, _DEBUG is set for non-release builds.
*/
#if (defined(_MSC_VER) && defined(NDEBUG) && defined(WITH_ASSERT)) || (!defined(_MSC_VER) && !defined(NDEBUG) && !defined(_DEBUG))
/* For non-debug builds with assertions enabled use the special assertion handler. */
#if defined(NDEBUG) && defined(WITH_ASSERT)
#undef assert
#define assert(expression) if (unlikely(!(expression))) error("Assertion failed at line %i of %s: %s", __LINE__, __FILE__, #expression);
#endif
/* Asserts are enabled if NDEBUG isn't defined, or if we are using MSVC and WITH_ASSERT is defined. */
#if !defined(NDEBUG) || (defined(_MSC_VER) && defined(WITH_ASSERT))
/* Asserts are enabled if NDEBUG isn't defined or WITH_ASSERT is defined. */
#if !defined(NDEBUG) || defined(WITH_ASSERT)
#define OTTD_ASSERT
#define assert_msg(expression, ...) if (unlikely(!(expression))) assert_msg_error(__LINE__, __FILE__, #expression, nullptr, __VA_ARGS__);
#define assert_msg_tile(expression, tile, ...) if (unlikely(!(expression))) assert_msg_error(__LINE__, __FILE__, #expression, assert_tile_info(tile), __VA_ARGS__);

25
src/strgen/CMakeLists.txt Normal file
View File

@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.5)
project(strgen)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake")
set(sourcefiles
strgen.cpp
strgen_base.cpp
../core/alloc_func.cpp
../misc/getoptdata.cpp
../string.cpp
)
add_definitions(-DSTRGEN)
add_executable(strgen ${sourcefiles})
include(Endian)
add_endian_definition()
# Source Files
add_files(strgen_base.cpp)
# Header Files
add_files(strgen.h)

84
src/table/CMakeLists.txt Normal file
View File

@@ -0,0 +1,84 @@
set(GENERATED_BINARY_DIR ${CMAKE_BINARY_DIR}/generated)
set(TABLE_BINARY_DIR ${GENERATED_BINARY_DIR}/table)
set(TABLE_INI_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/company_settings.ini
${CMAKE_CURRENT_SOURCE_DIR}/currency_settings.ini
${CMAKE_CURRENT_SOURCE_DIR}/gameopt_settings.ini
${CMAKE_CURRENT_SOURCE_DIR}/misc_settings.ini
${CMAKE_CURRENT_SOURCE_DIR}/settings.ini
${CMAKE_CURRENT_SOURCE_DIR}/win32_settings.ini
${CMAKE_CURRENT_SOURCE_DIR}/window_settings.ini
)
# Generate a command and target to create the settings table
add_custom_command_timestamp(OUTPUT ${TABLE_BINARY_DIR}/settings.h
COMMAND ${CMAKE_COMMAND} -E make_directory ${TABLE_BINARY_DIR}
COMMAND settingsgen
-o ${TABLE_BINARY_DIR}/settings.h
-b ${CMAKE_SOURCE_DIR}/src/table/settings.h.preamble
-a ${CMAKE_SOURCE_DIR}/src/table/settings.h.postamble
${TABLE_INI_SOURCE_FILES}
DEPENDS settingsgen ${TABLE_INI_SOURCE_FILES}
${CMAKE_SOURCE_DIR}/src/table/settings.h.preamble
${CMAKE_SOURCE_DIR}/src/table/settings.h.postamble
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating table/settings.h"
)
add_custom_target_timestamp(table_settings
DEPENDS
${TABLE_BINARY_DIR}/settings.h
)
add_library(settings
INTERFACE
)
target_include_directories(settings
INTERFACE
${GENERATED_BINARY_DIR}
)
add_dependencies(settings
table_settings
)
add_library(openttd::settings ALIAS settings)
add_files(
airport_defaults.h
airport_movement.h
airporttile_ids.h
airporttiles.h
animcursors.h
autorail.h
bridge_land.h
build_industry.h
cargo_const.h
clear_land.h
control_codes.h
darklight_colours.h
elrail_data.h
engines.h
genland.h
heightmap_colours.h
industry_land.h
landscape_sprite.h
newgrf_debug_data.h
object_land.h
palette_convert.h
palettes.h
pricebase.h
railtypes.h
road_land.h
roadtypes.h
roadveh_movement.h
sprites.h
station_land.h
strgen_tables.h
string_colours.h
town_land.h
townname.h
track_land.h
train_cmd.h
tree_land.h
unicode.h
water_land.h
)

35
src/video/CMakeLists.txt Normal file
View File

@@ -0,0 +1,35 @@
add_subdirectory(cocoa)
if (NOT OPTION_DEDICATED)
add_files(
allegro_v.cpp
allegro_v.h
CONDITION Allegro_FOUND
)
add_files(
sdl_v.cpp
sdl_v.h
CONDITION SDL_FOUND
)
add_files(
sdl2_v.cpp
sdl2_v.h
CONDITION SDL2_FOUND
)
add_files(
win32_v.cpp
win32_v.h
CONDITION WIN32
)
endif (NOT OPTION_DEDICATED)
add_files(
dedicated_v.cpp
dedicated_v.h
null_v.cpp
null_v.h
video_driver.hpp
)

View File

@@ -0,0 +1,8 @@
add_files(
cocoa_keys.h
cocoa_v.h
cocoa_v.mm
event.mm
wnd_quartz.mm
CONDITION APPLE
)

View File

@@ -5,7 +5,7 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file null_v.cpp The videio driver that doesn't blit. */
/** @file null_v.cpp The video driver that doesn't blit. */
#include "../stdafx.h"
#include "../gfx_func.h"

View File

@@ -470,12 +470,10 @@ bool VideoDriver_SDL::CreateMainSurface(uint w, uint h, bool resize)
seprintf(caption, lastof(caption), "OpenTTD %s", _openttd_revision);
if (_sdl_window == nullptr) {
Uint32 flags = SDL_WINDOW_SHOWN;
Uint32 flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE;
if (_fullscreen) {
flags |= SDL_WINDOW_FULLSCREEN;
} else {
flags |= SDL_WINDOW_RESIZABLE;
}
_sdl_window = SDL_CreateWindow(

View File

@@ -0,0 +1,63 @@
add_files(
ai_widget.h
airport_widget.h
autoreplace_widget.h
bootstrap_widget.h
bridge_widget.h
build_vehicle_widget.h
cheat_widget.h
company_widget.h
console_widget.h
date_widget.h
departures_widget.h
depot_widget.h
dock_widget.h
dropdown.cpp
dropdown_func.h
dropdown_type.h
dropdown_widget.h
engine_widget.h
error_widget.h
fios_widget.h
framerate_widget.h
genworld_widget.h
goal_widget.h
graph_widget.h
group_widget.h
highscore_widget.h
industry_widget.h
intro_widget.h
link_graph_legend_widget.h
main_widget.h
misc_widget.h
music_widget.h
network_chat_widget.h
network_content_widget.h
network_widget.h
newgrf_debug_widget.h
newgrf_widget.h
news_widget.h
object_widget.h
order_widget.h
osk_widget.h
plans_widget.h
rail_widget.h
road_widget.h
screenshot_widget.h
settings_widget.h
sign_widget.h
smallmap_widget.h
station_widget.h
statusbar_widget.h
story_widget.h
subsidy_widget.h
terraform_widget.h
timetable_widget.h
toolbar_widget.h
town_widget.h
transparency_widget.h
tree_widget.h
vehicle_widget.h
viewport_widget.h
waypoint_widget.h
)

View File

@@ -668,7 +668,7 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count)
WidgetType widget_type = (nw != nullptr) ? nw->type : WWT_EMPTY;
bool focused_widget_changed = false;
/* If clicked on a window that previously did dot have focus */
/* If clicked on a window that previously did not have focus */
if (_focused_window != w && // We already have focus, right?
(w->window_desc->flags & WDF_NO_FOCUS) == 0 && // Don't lose focus to toolbars
widget_type != WWT_CLOSEBOX) { // Don't change focused window if 'X' (close button) was clicked