Merge branch 'develop' into vehicle-update

Conflicts:
	openrct2.vcxproj.filters
This commit is contained in:
Michał Janiszewski 2015-12-31 11:41:23 +01:00
commit 5f66cd48f8
54 changed files with 1453 additions and 884 deletions

View File

@ -43,82 +43,20 @@ else (DISABLE_NETWORK)
endif (WIN32)
endif (DISABLE_NETWORK)
set(DEBUG_LEVEL 0 CACHE STRING "Select debug level for compilation. Use value in range 03.")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEBUG=${DEBUG_LEVEL}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG=${DEBUG_LEVEL}")
option(STATIC "Create a static build.")
# include lib
include_directories("lib/")
# add source files
file(GLOB_RECURSE ORCT2_SOURCES "src/*.c" "src/*.cpp" "lib/argparse/*.c" "lib/cutest/*.c" "lib/lodepng/*.c")
if (APPLE)
file(GLOB_RECURSE ORCT2_MM_SOURCES "src/*.m")
set_source_files_properties(${ORCT2_MM_SOURCES} PROPERTIES COMPILE_FLAGS "-x objective-c -fmodules")
endif (APPLE)
# Not required yet
PKG_CHECK_MODULES(PNG libpng>=1.6)
if (NOT PNG_FOUND)
PKG_CHECK_MODULES(PNG libpng16)
endif (NOT PNG_FOUND)
if (UNIX)
# force 32bit build for now and set necessary flags to compile code as is
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -std=gnu99 -fno-omit-frame-pointer -fno-pie")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -std=gnu++11 -fno-omit-frame-pointer -fno-pie")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
endif (UNIX)
# find and include SDL2
PKG_CHECK_MODULES(SDL2 REQUIRED sdl2 SDL2_ttf)
if (NOT DISABLE_HTTP_TWITCH)
PKG_CHECK_MODULES(LIBCURL REQUIRED libcurl)
PKG_CHECK_MODULES(JANSSON REQUIRED jansson)
SET(HTTPLIBS ${LIBCURL_LIBRARIES} ${JANSSON_LIBRARIES})
if (WIN32)
SET(HTTPLIBS ${HTTPLIBS} ssl crypto winmm.lib ws2_32)
endif (WIN32)
endif (NOT DISABLE_HTTP_TWITCH)
# speex v1.1.15 is supplied in our zipped library, but distributions provide
# updated version, with required functions extracted out to libspeexdsp.
# This largely takes care of the problem
if (WIN32)
include_directories("lib/libspeex/")
file(GLOB_RECURSE SPEEX_SOURCES "lib/libspeex/*.c")
else (WIN32)
PKG_CHECK_MODULES(SPEEX REQUIRED speexdsp)
endif (WIN32)
if (UNIX)
# Include libdl for dlopen
set(DLLIB dl)
endif (UNIX)
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS} ${LIBCURL_INCLUDE_DIRS} ${JANSSON_INCLUDE_DIRS} ${SPEEX_INCLUDE_DIRS})
LINK_DIRECTORIES(${SDL2_LIBRARY_DIRS} ${JANSSON_LIBRARY_DIRS} ${LIBCURL_LIBRARY_DIRS})
if (WIN32)
# build as library for now, replace with add_executable
add_library(${PROJECT} SHARED ${ORCT2_SOURCES} ${SPEEX_SOURCES})
else (WIN32)
add_executable(${PROJECT} ${ORCT2_SOURCES} ${ORCT2_MM_SOURCES})
add_custom_command(
OUTPUT g2.dat
COMMAND ./openrct2 sprite build ${CMAKE_BINARY_DIR}/g2.dat ${CMAKE_CURRENT_SOURCE_DIR}/resources/g2/
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(g2 DEPENDS ${PROJECT} g2.dat)
endif (WIN32)
if (APPLE)
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
TARGET_LINK_LIBRARIES(${PROJECT} ${ICONV_LIBRARIES})
endif (APPLE)
if (UNIX AND NOT APPLE)
# FontConfig for TrueType fonts.
PKG_CHECK_MODULES(FONTCONFIG REQUIRED fontconfig)
INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${PROJECT} ${FONTCONFIG_LIBRARIES})
endif (UNIX AND NOT APPLE)
if (PNG_FOUND)
set (USE_LODEPNG FALSE)
else (PNG_FOUND)
set (USE_LODEPNG TRUE)
message("Falling back to deprecated Lodepng for PNG support. Please upgrade your system to libpng 1.6")
endif (PNG_FOUND)
# Handle creating the rct2 text and data files on OS X and Linux
# See details in src/openrct2.c:openrct2_setup_rct2_segment for how the values
@ -137,7 +75,6 @@ if (UNIX)
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/openrct2.exe
)
add_custom_target(segfiles DEPENDS openrct2_text openrct2_data)
add_dependencies(${PROJECT} segfiles)
if (APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -sectcreate rct2_text __text ${CMAKE_CURRENT_SOURCE_DIR}/build/openrct2_text -sectcreate rct2_data __data ${CMAKE_CURRENT_SOURCE_DIR}/build/openrct2_data -segaddr rct2_data 0x8a4000 -segprot rct2_data rwx rwx -segaddr rct2_text 0x401000 -segprot rct2_text rwx rwx -fno-pie -read_only_relocs suppress")
else (APPLE)
@ -157,7 +94,6 @@ if (UNIX)
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(linkable_sections DEPENDS openrct2_text_section.o openrct2_data_section.o)
add_dependencies(${PROJECT} linkable_sections)
SET_SOURCE_FILES_PROPERTIES(
openrct2_text_section.o openrct2_data_section.o
PROPERTIES
@ -165,10 +101,123 @@ if (UNIX)
GENERATED true
)
# can't use GLOB here, as the files don't exist yet at cmake-time
list(APPEND RCT2_SECTIONS "${CMAKE_BINARY_DIR}/openrct2_data_section.o" "${CMAKE_BINARY_DIR}/openrct2_text_section.o")
set(RCT2_SECTIONS "${CMAKE_BINARY_DIR}/openrct2_data_section.o" "${CMAKE_BINARY_DIR}/openrct2_text_section.o")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-T,\"${CMAKE_CURRENT_SOURCE_DIR}/distribution/linux/ld_script.xc\"")
endif (APPLE)
endif (UNIX)
set(DEBUG_LEVEL 0 CACHE STRING "Select debug level for compilation. Use value in range 03.")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEBUG=${DEBUG_LEVEL}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG=${DEBUG_LEVEL}")
if (USE_LODEPNG)
set (LODEPNG_SOURCES "lib/lodepng/*.c")
else (USE_LODEPNG)
add_definitions(-DUSE_LIBPNG)
endif (USE_LODEPNG)
# include lib
include_directories("lib/")
# add source files
file(GLOB_RECURSE ORCT2_SOURCES "src/*.c" "src/*.cpp" "lib/argparse/*.c" "lib/cutest/*.c" ${LODEPNG_SOURCES})
if (APPLE)
file(GLOB_RECURSE ORCT2_MM_SOURCES "src/*.m")
set_source_files_properties(${ORCT2_MM_SOURCES} PROPERTIES COMPILE_FLAGS "-x objective-c -fmodules")
endif (APPLE)
# force 32bit build for now and set necessary flags to compile code as is
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -std=gnu99 -fno-omit-frame-pointer -fno-pie")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -std=gnu++11 -fno-omit-frame-pointer -fno-pie")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}")
if (MINGW)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpack-struct=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpack-struct=1")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++")
endif ()
if (STATIC)
if (WIN32)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static")
else (WIN32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
endif (WIN32)
endif ()
# find and include SDL2
PKG_CHECK_MODULES(SDL2 REQUIRED sdl2 SDL2_ttf)
if (STATIC)
# FreeType is required by SDL2_ttf, but not wired up properly in package
PKG_CHECK_MODULES(FREETYPE REQUIRED freetype2)
SET(SDL2LIBS ${SDL2_STATIC_LIBRARIES} ${FREETYPE_STATIC_LIBRARIES})
else (STATIC)
SET(SDL2LIBS ${SDL2_LIBRARIES})
endif (STATIC)
if (STATIC)
SET(PNGLIBS ${PNG_STATIC_LIBRARIES})
else (STATIC)
SET(PNGLIBS ${PNG_LIBRARIES})
endif (STATIC)
if (NOT DISABLE_HTTP_TWITCH)
PKG_CHECK_MODULES(LIBCURL REQUIRED libcurl)
PKG_CHECK_MODULES(JANSSON REQUIRED jansson>=2.7)
if (WIN32)
# Curl depends on openssl and ws2 in mingw builds, but is not wired up in pkg-config
PKG_CHECK_MODULES(SSL REQUIRED openssl)
set(WSLIBS ws2_32)
endif (WIN32)
if (STATIC)
SET(HTTPLIBS ${LIBCURL_STATIC_LIBRARIES} ${JANSSON_STATIC_LIBRARIES} ${SSL_STATIC_LIBRARIES} ${WSLIBS})
else (STATIC)
SET(HTTPLIBS ${LIBCURL_LIBRARIES} ${JANSSON_LIBRARIES} ${SSL_LIBRARIES} ${WSLIBS})
endif (STATIC)
endif (NOT DISABLE_HTTP_TWITCH)
# speex v1.1.15 is supplied in our zipped library, but distributions provide
# updated version, with required functions extracted out to libspeexdsp.
# This largely takes care of the problem
if (WIN32)
include_directories("lib/libspeex/")
file(GLOB_RECURSE SPEEX_SOURCES "lib/libspeex/*.c")
else (WIN32)
PKG_CHECK_MODULES(SPEEX REQUIRED speexdsp)
endif (WIN32)
if (UNIX)
# Include libdl for dlopen
set(DLLIB dl)
endif (UNIX)
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS} ${LIBCURL_INCLUDE_DIRS} ${JANSSON_INCLUDE_DIRS} ${SPEEX_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS})
LINK_DIRECTORIES(${SDL2_LIBRARY_DIRS} ${JANSSON_LIBRARY_DIRS} ${LIBCURL_LIBRARY_DIRS} ${PNG_LIBRARY_DIRS})
if (WIN32)
# build as library for now, replace with add_executable
add_library(${PROJECT} SHARED ${ORCT2_SOURCES} ${SPEEX_SOURCES})
else (WIN32)
add_executable(${PROJECT} ${ORCT2_SOURCES} ${ORCT2_MM_SOURCES} ${RCT2_SECTIONS})
add_dependencies(${PROJECT} segfiles)
if (NOT APPLE)
add_dependencies(${PROJECT} linkable_sections)
endif ()
add_custom_command(
OUTPUT g2.dat
COMMAND ./openrct2 sprite build ${CMAKE_BINARY_DIR}/g2.dat ${CMAKE_CURRENT_SOURCE_DIR}/resources/g2/
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(g2 DEPENDS ${PROJECT} g2.dat)
endif (WIN32)
if (UNIX AND NOT APPLE)
# FontConfig for TrueType fonts.
PKG_CHECK_MODULES(FONTCONFIG REQUIRED fontconfig)
INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${PROJECT} ${FONTCONFIG_LIBRARIES})
endif (UNIX AND NOT APPLE)
# install into ${CMAKE_INSTALL_PREFIX}/bin/
#install (TARGETS ${PROJECT} DESTINATION bin)
@ -176,7 +225,13 @@ endif (UNIX)
# libopenrct2.dll -> openrct2.dll
set_target_properties(${PROJECT} PROPERTIES PREFIX "")
TARGET_LINK_LIBRARIES(${PROJECT} ${SDL2_LIBRARIES} ${ORCTLIBS_LIB} ${HTTPLIBS} ${NETWORKLIBS} ${SPEEX_LIBRARIES} ${DLLIB} ${RCT2_SECTIONS})
TARGET_LINK_LIBRARIES(${PROJECT} ${SDL2LIBS} ${ORCTLIBS_LIB} ${HTTPLIBS} ${NETWORKLIBS} ${SPEEX_LIBRARIES} ${DLLIB} ${PNGLIBS})
if (APPLE OR STATIC)
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
TARGET_LINK_LIBRARIES(${PROJECT} ${ICONV_LIBRARIES})
endif (APPLE OR STATIC)
# CMake does not allow specifying a dependency chain which includes built-in
# targets, like `install`, so we have to trick it and execute dependency ourselves.

View File

@ -1,4 +1,3 @@
SET(ACTUAL_SYSTEM ${CMAKE_SYSTEM_NAME})
SET(CMAKE_SYSTEM_NAME Windows)
SET(COMPILER_PREFIX i686-w64-mingw32)
@ -8,17 +7,6 @@ SET(CMAKE_RC_COMPILER ${COMPILER_PREFIX}-windres)
SET(CMAKE_PKGCONFIG_EXECUTABLE ${COMPILER_PREFIX}-pkg-config)
SET(PKG_CONFIG_EXECUTABLE ${COMPILER_PREFIX}-pkg-config)
# potential flags to make code more similar to MSVC:
# -fshort-wchar -fshort-enums -mms-bitfields
#
set(CMAKE_C_FLAGS "-std=gnu99 -fpack-struct=1" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "-std=c++0x -std=gnu++0x -fpack-struct=1" CACHE STRING "" FORCE)
if(${ACTUAL_SYSTEM} MATCHES "Linux")
set(CMAKE_SHARED_LINKER_FLAGS "-O3 -static-libgcc -static-libstdc++ -static -lpthread" CACHE STRING "" FORCE)
else()
set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++" CACHE STRING "" FORCE)
endif(${ACTUAL_SYSTEM} MATCHES "Linux")
if(APPLE)
SET(TARGET_ENVIRONMENT /usr/local/mingw-w32-bin_i686-darwin/i686-w64-mingw32)
else()

View File

@ -11,7 +11,10 @@
D41B73F11C21018C0080A7B9 /* libssl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D41B73F01C21018C0080A7B9 /* libssl.tbd */; };
D41B741D1C210A7A0080A7B9 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D41B741C1C210A7A0080A7B9 /* libiconv.tbd */; };
D41B74731C2125E50080A7B9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D41B74721C2125E50080A7B9 /* Assets.xcassets */; };
D435325F1C3472E500BA219B /* libpng.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D435325E1C3472E500BA219B /* libpng.dylib */; };
D43532601C34730200BA219B /* libpng.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D435325E1C3472E500BA219B /* libpng.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
D4ABAB061C2F812B0080CAD9 /* news_options.c in Sources */ = {isa = PBXBuildFile; fileRef = D4ABAB051C2F812B0080CAD9 /* news_options.c */; };
D4D4DF141C34697B0048BE43 /* image_io.c in Sources */ = {isa = PBXBuildFile; fileRef = D4D4DF121C34697B0048BE43 /* image_io.c */; };
D4EC47DF1C26342F0024B507 /* addresses.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC46D61C26342F0024B507 /* addresses.c */; };
D4EC47E01C26342F0024B507 /* audio.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC46D91C26342F0024B507 /* audio.c */; };
D4EC47E11C26342F0024B507 /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4EC46DB1C26342F0024B507 /* mixer.cpp */; };
@ -197,6 +200,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
D43532601C34730200BA219B /* libpng.dylib in Embed Frameworks */,
D4EC48D01C2634C70024B507 /* libfreetype.dylib in Embed Frameworks */,
D4EC48D11C2634C70024B507 /* libjansson.dylib in Embed Frameworks */,
D4EC48D21C2634C70024B507 /* libSDL2.dylib in Embed Frameworks */,
@ -214,9 +218,12 @@
D41B73F01C21018C0080A7B9 /* libssl.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libssl.tbd; path = usr/lib/libssl.tbd; sourceTree = SDKROOT; };
D41B741C1C210A7A0080A7B9 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; };
D41B74721C2125E50080A7B9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = distribution/osx/Assets.xcassets; sourceTree = SOURCE_ROOT; };
D435325E1C3472E500BA219B /* libpng.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libpng.dylib; sourceTree = "<group>"; };
D4895D321C23EFDD000CD788 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = distribution/osx/Info.plist; sourceTree = SOURCE_ROOT; };
D497D0781C20FD52002BF46A /* OpenRCT2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenRCT2.app; sourceTree = BUILT_PRODUCTS_DIR; };
D4ABAB051C2F812B0080CAD9 /* news_options.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = news_options.c; sourceTree = "<group>"; };
D4D4DF121C34697B0048BE43 /* image_io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = image_io.c; path = src/image_io.c; sourceTree = "<group>"; };
D4D4DF131C34697B0048BE43 /* image_io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = image_io.h; path = src/image_io.h; sourceTree = "<group>"; };
D4EC46D61C26342F0024B507 /* addresses.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = addresses.c; path = src/addresses.c; sourceTree = "<group>"; };
D4EC46D71C26342F0024B507 /* addresses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = addresses.h; path = src/addresses.h; sourceTree = "<group>"; };
D4EC46D91C26342F0024B507 /* audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = audio.c; sourceTree = "<group>"; };
@ -555,6 +562,7 @@
files = (
D41B73EF1C2101890080A7B9 /* libcurl.tbd in Frameworks */,
D41B741D1C210A7A0080A7B9 /* libiconv.tbd in Frameworks */,
D435325F1C3472E500BA219B /* libpng.dylib in Frameworks */,
D4EC48CA1C2634870024B507 /* libjansson.dylib in Frameworks */,
D4EC48CB1C2634870024B507 /* libSDL2.dylib in Frameworks */,
D4EC48CC1C2634870024B507 /* libSDL2_ttf.dylib in Frameworks */,
@ -602,6 +610,8 @@
D4EC47031C26342F0024B507 /* game.h */,
D4EC47041C26342F0024B507 /* hook.c */,
D4EC47051C26342F0024B507 /* hook.h */,
D4D4DF121C34697B0048BE43 /* image_io.c */,
D4D4DF131C34697B0048BE43 /* image_io.h */,
D4EC47061C26342F0024B507 /* input.c */,
D4EC47071C26342F0024B507 /* input.h */,
D4EC47201C26342F0024B507 /* intro.c */,
@ -1095,6 +1105,7 @@
children = (
D4EC48C41C2634870024B507 /* libfreetype.dylib */,
D4EC48C51C2634870024B507 /* libjansson.dylib */,
D435325E1C3472E500BA219B /* libpng.dylib */,
D4EC48C61C2634870024B507 /* libSDL2.dylib */,
D4EC48C71C2634870024B507 /* libSDL2_ttf.dylib */,
D4EC48C81C2634870024B507 /* libspeexdsp.dylib */,
@ -1165,9 +1176,9 @@
D40F4E1D1C2528D5009582C9 /* Create Segment Files */,
D497D0741C20FD52002BF46A /* Sources */,
D497D0751C20FD52002BF46A /* Frameworks */,
D41B74201C210B190080A7B9 /* Embed Frameworks */,
D42C09D21C254F4E00309751 /* Build g2.dat */,
D497D0761C20FD52002BF46A /* Resources */,
D41B74201C210B190080A7B9 /* Embed Frameworks */,
);
buildRules = (
);
@ -1301,7 +1312,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cachedir=\".cache\"\nliburl=\"https://openrct2.website/files/orctlibs-osx.zip\"\n# keep in sync with version in build.sh\nsha256sum=\"2cec3958352477fbb876a5b6398722077084b5ff7e95a7d3cd67492abf5012fc\"\n\n[[ ! -e \"${SRCROOT}/libversion\" || $(head -n 1 \"${SRCROOT}/libversion\") != $sha256sum ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]] || [[ ! -f \"${SRCROOT}/$cachedir/orctlibs.zip\" ]]; then\n if [[ ! -d \"${SRCROOT}/$cachedir\" ]]; then mkdir \"${SRCROOT}/$cachedir\"; fi\n if [[ -f \"${SRCROOT}/$cachedir/orctlibs.zip\" ]]; then rm \"${SRCROOT}/$cachedir/orctlibs.zip\"; fi\n curl -L -o \"${SRCROOT}/$cachedir/orctlibs.zip\" \"$liburl\"\n if [[ -d \"${SRCROOT}/$cachedir/orctlibs\" ]]; then rm -rf \"${SRCROOT}/$cachedir/orctlibs\"; fi\n mkdir \"${SRCROOT}/$cachedir/orctlibs\"\n unzip -uaq -d \"${SRCROOT}/$cachedir/orctlibs\" \"${SRCROOT}/$cachedir/orctlibs.zip\"\nfi\n\nif [[ $outdated -eq 0 ]] || [[ ! -d \"${SRCROOT}/lib\" ]]; then\n if [[ -d \"${SRCROOT}/lib\" ]]; then rm -r \"${SRCROOT}/lib\"; fi\n cp -Rf \"${SRCROOT}/$cachedir/orctlibs/local\" \"${SRCROOT}/lib\"\nfi\nif [[ $outdated -eq 0 ]] || [[ ! -d \"${SRCROOT}/libxc\" ]]; then\n if [[ -d \"${SRCROOT}/libxc\" ]]; then rm -r \"${SRCROOT}/libxc\"; fi\n cp -Rf \"${SRCROOT}/$cachedir/orctlibs/glob\" \"${SRCROOT}/libxc\"\nfi\n\nif [[ $outdated -eq 0 ]]; then\n newsha=$(shasum -a 256 \"${SRCROOT}/$cachedir/orctlibs.zip\" | cut -f1 -d\" \")\n [[ \"$newsha\" == \"$sha256sum\" ]]\nfi";
shellScript = "cachedir=\".cache\"\nliburl=\"https://openrct2.website/files/orctlibs-osx.zip\"\n# keep in sync with version in build.sh\nsha256sum=\"02ebc8e7fd8b9b02b7144721784c5d96202a17398bc8652da163c8c85b66a7db\"\n\n[[ ! -e \"${SRCROOT}/libversion\" || $(head -n 1 \"${SRCROOT}/libversion\") != $sha256sum ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]] || [[ ! -f \"${SRCROOT}/$cachedir/orctlibs.zip\" ]]; then\n if [[ ! -d \"${SRCROOT}/$cachedir\" ]]; then mkdir \"${SRCROOT}/$cachedir\"; fi\n if [[ -f \"${SRCROOT}/$cachedir/orctlibs.zip\" ]]; then rm \"${SRCROOT}/$cachedir/orctlibs.zip\"; fi\n curl -L -o \"${SRCROOT}/$cachedir/orctlibs.zip\" \"$liburl\"\n if [[ -d \"${SRCROOT}/$cachedir/orctlibs\" ]]; then rm -rf \"${SRCROOT}/$cachedir/orctlibs\"; fi\n mkdir \"${SRCROOT}/$cachedir/orctlibs\"\n unzip -uaq -d \"${SRCROOT}/$cachedir/orctlibs\" \"${SRCROOT}/$cachedir/orctlibs.zip\"\nfi\n\nif [[ $outdated -eq 0 ]] || [[ ! -d \"${SRCROOT}/lib\" ]]; then\n if [[ -d \"${SRCROOT}/lib\" ]]; then rm -r \"${SRCROOT}/lib\"; fi\n cp -Rf \"${SRCROOT}/$cachedir/orctlibs/local\" \"${SRCROOT}/lib\"\nfi\nif [[ $outdated -eq 0 ]] || [[ ! -d \"${SRCROOT}/libxc\" ]]; then\n if [[ -d \"${SRCROOT}/libxc\" ]]; then rm -r \"${SRCROOT}/libxc\"; fi\n cp -Rf \"${SRCROOT}/$cachedir/orctlibs/glob\" \"${SRCROOT}/libxc\"\nfi\n\nif [[ $outdated -eq 0 ]]; then\n newsha=$(shasum -a 256 \"${SRCROOT}/$cachedir/orctlibs.zip\" | cut -f1 -d\" \")\n echo $newsha > \"${SRCROOT}/libversion\"\n [[ \"$newsha\" == \"$sha256sum\" ]]\nfi";
};
/* End PBXShellScriptBuildPhase section */
@ -1383,6 +1394,7 @@
D4EC48001C26342F0024B507 /* window.c in Sources */,
D4EC47F61C26342F0024B507 /* colour.c in Sources */,
D4EC486E1C26342F0024B507 /* track_manage.c in Sources */,
D4D4DF141C34697B0048BE43 /* image_io.c in Sources */,
D4EC48331C26342F0024B507 /* demolish_ride_prompt.c in Sources */,
D4EC48131C26342F0024B507 /* object_list.c in Sources */,
D4EC47ED1C26342F0024B507 /* scrolling_text.c in Sources */,
@ -1507,7 +1519,10 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
USE_LIBPNG,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
@ -1549,7 +1564,7 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = SDL_INCLUDE_FRAMEWORK;
GCC_PREPROCESSOR_DEFINITIONS = USE_LIBPNG;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
@ -1573,6 +1588,7 @@
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/libxc/include",
"$(SRCROOT)/libxc/include/SDL2",
"$(SRCROOT)/libxc/include/libpng16",
"$(SRCROOT)/lib/",
);
INFOPLIST_FILE = "$(SRCROOT)/distribution/osx/Info.plist";
@ -1618,6 +1634,7 @@
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/libxc/include",
"$(SRCROOT)/libxc/include/SDL2",
"$(SRCROOT)/libxc/include/libpng16",
"$(SRCROOT)/lib/",
);
INFOPLIST_FILE = "$(SRCROOT)/distribution/osx/Info.plist";

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D497D0771C20FD52002BF46A"
BuildableName = "OpenRCT2.app"
BlueprintName = "OpenRCT2"
ReferencedContainer = "container:OpenRCT2.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D497D0771C20FD52002BF46A"
BuildableName = "OpenRCT2.app"
BlueprintName = "OpenRCT2"
ReferencedContainer = "container:OpenRCT2.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "NO"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D497D0771C20FD52002BF46A"
BuildableName = "OpenRCT2.app"
BlueprintName = "OpenRCT2"
ReferencedContainer = "container:OpenRCT2.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D497D0771C20FD52002BF46A"
BuildableName = "OpenRCT2.app"
BlueprintName = "OpenRCT2"
ReferencedContainer = "container:OpenRCT2.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -3925,6 +3925,27 @@ STR_5582 :限制滑鼠游標於視窗中移動
STR_5583 :{COMMA1DP16}ms{POWERNEGATIVEONE}
STR_5584 :SI
STR_5585 :{SMALLFONT}{BLACK}移除遊樂設施的運行限制, 例如容許鏈條上拉速度高達{VELOCITY}
STR_5586 :自動開啟商店及攤販
STR_5587 :{SMALLFONT}{BLACK}當此設定啟用後, 商店及攤販將會於建造後自動開啟
STR_5588 :{SMALLFONT}{BLACK}與其他玩家一起遊玩
STR_5589 :消息設定
STR_5590 :樂園獎項
STR_5591 :推廣計劃已完結
STR_5592 :有關樂園的警告
STR_5593 :有關樂園評價的警告
STR_5594 :遊樂設施發生故障
STR_5595 :遊樂設施毀壞了
STR_5596 :有關遊樂設施的警告
STR_5597 :研發好的遊樂設施,商店或景物
STR_5598 :有關遊客的警告
STR_5599 :遊客迷路了
STR_5600 :遊客已離開樂園
STR_5601 :遊客正在排隊遊玩某個遊樂設施
STR_5602 :遊客已乘上遊樂設施
STR_5603 :遊客已離開遊樂設施
STR_5604 :遊客已購買物品
STR_5605 :遊客已使用設施
STR_5606 :遊客已死亡
#####################

View File

@ -1341,7 +1341,7 @@ STR_1335 :{STRINGID} - Entrance{POP16}{POP16}
STR_1336 :{STRINGID} - Station {POP16}{COMMA16} Entrance
STR_1337 :{STRINGID} - Exit{POP16}{POP16}
STR_1338 :{STRINGID} - Station {POP16}{COMMA16} Exit
STR_1339 :{BLACK}V7sledky testů nejsou hotovy...
STR_1339 :{BLACK}Výsledky testů nejsou hotovy...
STR_1340 :{WINDOW_COLOUR_2}Max. rychlost: {BLACK}{VELOCITY}
STR_1341 :{WINDOW_COLOUR_2}Ride time: {BLACK}{STRINGID}{STRINGID}{STRINGID}{STRINGID}
STR_1342 :{DURATION}
@ -1779,7 +1779,7 @@ STR_1773 :Only one on-ride photo section allowed per ride
STR_1774 :Only one cable lift hill allowed per ride
STR_1775 :Off
STR_1776 :On
STR_1777 :{WINDOW_COLOUR_2}Music
STR_1777 :{WINDOW_COLOUR_2}Hudba
STR_1778 :{STRINGID} - -
STR_1779 :{INLINE_SPRITE}{254}{19}{00}{00} Panda costume
STR_1780 :{INLINE_SPRITE}{255}{19}{00}{00} Tiger costume
@ -2238,7 +2238,7 @@ STR_2230 :Vertical track
STR_2231 :Holding brake for drop
STR_2232 :Cable lift hill
STR_2233 :{SMALLFONT}{BLACK}Park information
STR_2234 :Recent Messages
STR_2234 :Poslední zprávy
STR_2235 :{SMALLFONT}{STRINGID} {STRINGID}
STR_2236 :Ledna
STR_2237 :Únorna
@ -2331,23 +2331,23 @@ STR_2323 :{WINDOW_COLOUR_2}Park size: {BLACK}{COMMA32}m{SQUARED}
STR_2324 :{WINDOW_COLOUR_2}Park size: {BLACK}{COMMA32}sq.ft.
STR_2325 :{SMALLFONT}{BLACK}Buy land to extend park
STR_2326 :{SMALLFONT}{BLACK}Buy construction rights to allow construction above or below land outside the park
STR_2327 :Options
STR_2327 :Nastavení
STR_2328 :{WINDOW_COLOUR_2}Měna:
STR_2329 :{WINDOW_COLOUR_2}Délka a rychlost:
STR_2330 :{WINDOW_COLOUR_2}Teplota:
STR_2331 :{WINDOW_COLOUR_2}Výškové značky:
STR_2332 :Jednotky
STR_2333 :Sound
STR_2334 :Libry ({POUND})
STR_2335 :Dolary ($)
STR_2336 :Franky (F)
STR_2333 :Zvuk
STR_2334 :Libra ({POUND})
STR_2335 :Dolar ($)
STR_2336 :Frank (F)
STR_2337 :Marka (DM)
STR_2338 :Yeny ({YEN})
STR_2338 :Yen ({YEN})
STR_2339 :Pesos (Pts)
STR_2340 :Lira (L)
STR_2341 :Guldeny (fl.)
STR_2342 :Koruny (Kč)
STR_2343 :Euroa ({EURO})
STR_2341 :Gulden (fl.)
STR_2342 :Švédská koruna (kr)
STR_2343 :Euro ({EURO})
STR_2344 :Imperiální
STR_2345 :Metrické
STR_2346 :Display
@ -2362,12 +2362,12 @@ STR_2354 :{WINDOW_COLOUR_2}Bins emptied: {BLACK}{COMMA16}
STR_2355 :{WINDOW_COLOUR_2}Rides fixed: {BLACK}{COMMA16}
STR_2356 :{WINDOW_COLOUR_2}Rides inspected: {BLACK}{COMMA16}
STR_2357 :House
STR_2358 :Units
STR_2359 :Real Values
STR_2360 :{WINDOW_COLOUR_2}Display Resolution:
STR_2361 :Landscape Smoothing
STR_2358 :Jednotky
STR_2359 :Reálné hodnoty
STR_2360 :{WINDOW_COLOUR_2}Rozlišení displeje:
STR_2361 :Vyhlazování krajiny
STR_2362 :{SMALLFONT}{BLACK}Toggle landscape tile edge smoothing on/off
STR_2363 :Gridlines on Landscape
STR_2363 :Vykreslit mřížku na krajině
STR_2364 :{SMALLFONT}{BLACK}Toggle gridlines on landscape on/off
STR_2365 :The bank refuses to increase your loan!
STR_2366 :Celsius ({DEGREE}C)
@ -2491,9 +2491,9 @@ STR_2483 :{WINDOW_COLOUR_2}Weekly profit: {BLACK}+{CURRENCY2DP}
STR_2484 :{WINDOW_COLOUR_2}Weekly profit: {RED}{CURRENCY2DP}
STR_2485 :Controls
STR_2486 :General
STR_2487 :Show 'real' names of guests
STR_2487 :Zobrazit 'reálná' jména návštěvníků
STR_2488 :{SMALLFONT}{BLACK}Toggle between showing 'real' names of guests and guest numbers
STR_2489 :Shortcut keys...
STR_2489 :Klávesové zkratky...
STR_2490 :Keyboard shortcuts
STR_2491 :Reset keys
STR_2492 :{SMALLFONT}{BLACK}Set all keyboard shortcuts back to default settings
@ -2743,8 +2743,8 @@ STR_2734 :{COMMA16}mph
STR_2735 :{COMMA16}km/h
STR_2736 :{MONTH}, Year {COMMA16}
STR_2737 :{STRINGID} {MONTH}, Year {COMMA16}
STR_2738 :Title screen music:
STR_2739 :None
STR_2738 :Hudba úvodní obrazovky:
STR_2739 :Žádná
STR_2740 :RollerCoaster Tycoon 1
STR_2741 :RollerCoaster Tycoon 2
STR_2742 :css50.dat not found
@ -2779,10 +2779,10 @@ STR_2769 :Open Park
STR_2770 :Close Park
STR_2771 :Slower Gamespeed
STR_2772 :Faster Gamespeed
STR_2773 :Windowed
STR_2774 :Fullscreen
STR_2775 :Fullscreen (desktop)
STR_2776 :Language:
STR_2773 :V okně
STR_2774 :Celá obrazovka
STR_2775 :Celá obrazovka (plocha)
STR_2776 :Jazyk:
STR_2777 :{MOVE_X}{SMALLFONT}{STRING}
STR_2778 :{RIGHTGUILLEMET}{MOVE_X}{SMALLFONT}{STRING}
STR_2779 :Viewport #{COMMA16}
@ -2804,7 +2804,7 @@ STR_2793 :{SMALLFONT}(Completed by {STRINGID})
STR_2794 :{WINDOW_COLOUR_2}Completed by: {BLACK}{STRINGID}{NEWLINE}{WINDOW_COLOUR_2} with a company value of: {BLACK}{CURRENCY}
STR_2795 :Sort
STR_2796 :{SMALLFONT}{BLACK}Sort the ride list into order using the information type displayed
STR_2797 :Scroll view when pointer at screen edge
STR_2797 :Posouvat pohled při najetí myší k okraji
STR_2798 :{SMALLFONT}{BLACK}Select whether to scroll the view when the mouse pointer is at the screen edge
STR_2799 :{SMALLFONT}{BLACK}View or change control key assignments
STR_2800 :{WINDOW_COLOUR_2}Total admissions: {BLACK}{COMMA32}
@ -3062,9 +3062,9 @@ STR_3051 :Golf hole C
STR_3052 :Golf hole D
STR_3053 :Golf hole E
STR_3054 :Loading...
STR_3055 :White
STR_3056 :Translucent
STR_3057 :{WINDOW_COLOUR_2}Construction Marker:
STR_3055 :Bílá
STR_3056 :Průhledná
STR_3057 :{WINDOW_COLOUR_2}Barva návrhu výstavby:
STR_3058 :Brick walls
STR_3059 :Hedges
STR_3060 :Ice blocks
@ -3458,13 +3458,13 @@ STR_3445 :Set Patrol Area
STR_3446 :Cancel Patrol Area
# New strings, cleaner
STR_5120 :Finances
STR_5121 :Research
STR_5120 :Finance
STR_5121 :Výzkum
STR_5122 :Select rides by track type (like in RCT1)
STR_5123 :Renew rides
STR_5124 :<not used anymore>
STR_5125 :All destructable
STR_5126 :Random title music
STR_5126 :Náhodná hudba
STR_5127 :{SMALLFONT}{BLACK}Disable land elevation
STR_5128 :Selection size
STR_5129 :Enter selection size between {COMMA16} and {COMMA16}
@ -3491,17 +3491,17 @@ STR_5149 :{SMALLFONT}{BLACK}Show cheat options
STR_5150 :Enable debugging tools
STR_5151 :,
STR_5152 :.
STR_5153 :Edit Themes...
STR_5154 :Hardware display
STR_5153 :Upravit motivy...
STR_5154 :Hardwarové zobrazování
STR_5155 :Allow testing of unfinished tracks
STR_5156 :{SMALLFONT}{BLACK}Allows testing of most ride types even when the track is unfinished, does not apply to block sectioned modes
STR_5157 :Unlock all prices
STR_5158 :Quit to menu
STR_5159 :Exit OpenRCT2
STR_5160 :{POP16}{MONTH} {PUSH16}{PUSH16}{STRINGID}, Year {POP16}{COMMA16}
STR_5161 :Date Format:
STR_5162 :Day/Month/Year
STR_5163 :Month/Day/Year
STR_5161 :Formát data:
STR_5162 :Den/Měsíc/Rok
STR_5163 :Měsíc/Den/Rok
STR_5164 :Twitch Channel name
STR_5165 :Name peeps after followers
STR_5166 :{SMALLFONT}{BLACK}Will name peeps after channel's Twitch followers
@ -3515,7 +3515,7 @@ STR_5173 :Pull Twitch chat as news
STR_5174 :{SMALLFONT}{BLACK}Will use Twitch chat messages preceded by !news for in game notifications
STR_5175 :Input the name of your Twitch channel
STR_5176 :Enable Twitch integration
STR_5177 :Fullscreen mode:
STR_5177 :Režim zobrazení:
STR_5178 :{SMALLFONT}{BLACK}Show financial cheats
STR_5179 :{SMALLFONT}{BLACK}Show guest cheats
STR_5180 :{SMALLFONT}{BLACK}Show park cheats
@ -3555,8 +3555,8 @@ STR_5213 :Objective Options
STR_5214 :Map Generation
STR_5215 :Track Design Manager
STR_5216 :Track Design Manager List
STR_5217 :Cheats
STR_5218 :Themes
STR_5217 :Cheaty
STR_5218 :Motivy
STR_5219 :Nastavení
STR_5220 :Klávesové zkratky
STR_5221 :Změnit klávesové zkratky
@ -3576,13 +3576,13 @@ STR_5234 :{SMALLFONT}{BLACK}Prompts
STR_5235 :{SMALLFONT}{BLACK}Nastavení
STR_5236 :Okno:
STR_5237 :Paleta:
STR_5238 :Current Theme:
STR_5238 :Aktuální motiv:
STR_5239 :Duplikovat
STR_5240 :Enter a name for the theme
STR_5241 :Can't change this theme
STR_5242 :Theme name already exists
STR_5243 :Invalid characters used
STR_5244 :Themes
STR_5240 :Zadejte jméno pro tento motiv
STR_5241 :Nelze změnit tento motiv
STR_5242 :Jméno motivu již existuje
STR_5243 :Použity neplatné znaky
STR_5244 :Motivy
STR_5245 :Top Toolbar
STR_5246 :Bottom Toolbar
STR_5247 :Track Editor Bottom Toolbar
@ -3710,7 +3710,7 @@ STR_5368 :Reset crash status
STR_5369 :Park parameters...
STR_5370 :{SMALLFONT}{BLACK}Click this button to modify park{NEWLINE}parameters like restrictions,{NEWLINE}guest generation and money.
STR_5371 :Object Selection
STR_5372 :Invert right mouse dragging
STR_5372 :Obrátit směr posouvání pohledu pravým tlačítkem
STR_5373 :Name {STRINGID}
STR_5374 :Date {STRINGID}
STR_5375 :{UP}
@ -3778,7 +3778,7 @@ STR_5436 :Edit Title Sequences...
STR_5437 :No save selected
STR_5438 :Can't make changes while command editor is open
STR_5439 :A wait command with at least 4 seconds is required with a restart command
STR_5440 :Minimise fullscreen on focus loss
STR_5440 :Minimalizovat celoobrazovkový režim při přepnutí ze hry
STR_5441 :{SMALLFONT}{BLACK}Identifies rides by track type,{NEWLINE}so vehicles can be changed{NEWLINE}afterwards, like in RCT1.
STR_5442 :Force park rating:
STR_5443 :Speed{MOVE_X}{87}{STRINGID}
@ -3792,7 +3792,7 @@ STR_5450 :Increase game speed
STR_5451 :Open cheats window
STR_5452 :Toggle visibility of toolbars
STR_5453 :Select another ride
STR_5454 :Uncap FPS
STR_5454 :Nelimitovat FPS
STR_5455 :Enable sandbox mode
STR_5456 :Disable clearance checks
STR_5457 :Disable support limits
@ -3806,20 +3806,20 @@ STR_5464 :General
STR_5465 :Climate
STR_5466 :Staff
STR_5467 :ALT +
STR_5468 :Recent messages
STR_5468 :Poslední zprávy
STR_5469 :Scroll map up
STR_5470 :Scroll map left
STR_5471 :Scroll map down
STR_5472 :Scroll map right
STR_5473 :Cycle day / night
STR_5474 :Display text on banners in upper case
STR_5473 :Cyklus dne a noci
STR_5474 :Zobrazit text na bannerech v kapitálkách
STR_5475 :{COMMA16} weeks
STR_5476 :Hardware
STR_5477 :Map rendering
STR_5478 :Controls
STR_5479 :Toolbar
STR_5480 :Show toolbar buttons for:
STR_5481 :Themes
STR_5477 :Vykreslování mapy
STR_5478 :Ovládání
STR_5479 :Panel nástrojů
STR_5480 :Zobrazit tlačítka pro:
STR_5481 :Motivy
STR_5482 :{WINDOW_COLOUR_2}Time since last inspection: {BLACK}1 minute
STR_5483 :{BLACK}({COMMA16} weeks remaining)
STR_5484 :{BLACK}({COMMA16} week remaining)
@ -3828,7 +3828,7 @@ STR_5486 :{BLACK}{COMMA16}
STR_5487 :{SMALLFONT}{BLACK}Show recent messages
STR_5488 :No entrance (OpenRCT2 only!)
STR_5489 :{SMALLFONT}{BLACK}Show only tracked guests
STR_5490 :Disable audio on focus loss
STR_5490 :Vypnout zvuk při přepnutí ze hry
STR_5491 :Seznam vynálezů
STR_5492 :Nastavení scénáře
STR_5493 :Poslat zprávu
@ -3846,9 +3846,9 @@ STR_5504 :{SMALLFONT}{BLACK}Show multiplayer status
STR_5505 :Nelze se připojit k serveru.
STR_5506 :Hosté ingnorují intensitu
STR_5507 :Handymen mow grass by default
STR_5508 :APovolit nahrávat soubory s chybným kontrolním součtem
STR_5508 :Povolit nahrávání souborů s chybným kontrolním součtem
STR_5509 :{SMALLFONT}{BLACK}Allows loading scenarios and saves that have an incorrect checksum, like the scenarios from the demo or damaged saves.
STR_5510 :Default sound device
STR_5510 :Výchozí zvukové zařízení
STR_5511 :(UNKNOWN)
STR_5512 :Uložit hru jako
STR_5513 :(Rychle) uložit hru
@ -3891,7 +3891,7 @@ STR_5549 :Rok/Měsíc/Den
STR_5550 :{POP16}{POP16}Rok {COMMA16}, {PUSH16}{PUSH16}{MONTH} {PUSH16}{PUSH16}{STRINGID}
STR_5551 :Rok/Den/Měsíc
STR_5552 :{POP16}{POP16}Rok {COMMA16}, {PUSH16}{PUSH16}{PUSH16}{STRINGID} {MONTH}
STR_5553 :Pause game when Steam overlay is open
STR_5553 :Pozastavit hru při otevření Steamu
STR_5554 :{SMALLFONT}{BLACK}Enable mountain tool
STR_5555 :Show vehicles from other track types
STR_5556 :Vyhodit hráče
@ -3915,8 +3915,36 @@ STR_5573 :Odstranit z oblíbených
STR_5574 :Jméno serveru:
STR_5575 :Hráčů maximálně:
STR_5576 :Port:
STR_5577 :Jiho-Korejský Won (W)
STR_5578 :Ruský Rubl (R)
STR_5577 :Jihokorejský won (W)
STR_5578 :Ruský rubl (R)
STR_5579 :Koeficient velikosti okna:
STR_5580 :Česká koruna (Kč)
STR_5581 :Zobrazit FPS
STR_5582 :Zachytávat kurzor myši v okně
STR_5583 :{COMMA1DP16}ms{POWERNEGATIVEONE}
STR_5584 :SI
STR_5585 :{SMALLFONT}{BLACK}Unlocks ride operation limits, allowing for things like {VELOCITY} lift hills
STR_5586 :Automaticky otevírat obchody a stánky
STR_5587 :{SMALLFONT}{BLACK}When enabled, shops and stalls will be automatically opened after building them
STR_5588 :{SMALLFONT}{BLACK}Play with other players
STR_5589 :Notification Settings
STR_5590 :Park awards
STR_5591 :Marketing campaign has finished
STR_5592 :Park warnings
STR_5593 :Park rating warnings
STR_5594 :Ride has broken down
STR_5595 :Ride has crashed
STR_5596 :Ride warnings
STR_5597 :Ride / scenery researched
STR_5598 :Guest warnings
STR_5599 :Guest is lost
STR_5600 :Guest has left the park
STR_5601 :Guest is queuing for ride
STR_5602 :Guest is on ride
STR_5603 :Guest has left ride
STR_5604 :Guest has bought item
STR_5605 :Guest has used facility
STR_5606 :Guest has died
#####################
# Rides/attractions #

View File

@ -1462,7 +1462,7 @@ STR_1459 :Baansoort
STR_1460 :{SMALLFONT}{BLACK}Open baan in U-vorm
STR_1461 :{SMALLFONT}{BLACK}Gesloten baan in O-vorm
STR_1462 :Te steil voor een kettinglift
STR_1463 :bezoekers
STR_1463 :Bezoekers
STR_1464 :Spiraal omhoog (klein)
STR_1465 :Spiraal omhoog (groot)
STR_1466 :Spiraal omlaag (klein)
@ -3921,6 +3921,24 @@ STR_5585 :{SMALLFONT}{BLACK}Heft de limieten op het tabblad Bedrijfsopties va
STR_5586 :Winkels en kraampjes automatisch openen
STR_5587 :{SMALLFONT}{BLACK}Als deze optie is ingeschakeld zullen winkels en kraampjes na plaatsing automatisch worden geopend.
STR_5588 :{SMALLFONT}{BLACK}Multiplayer
STR_5589 :Berichtinstellingen
STR_5590 :Als het park een prijs heeft gekregen
STR_5591 :Als een marketingcampagne is afgelopen
STR_5592 :Waarschuwingen over het park
STR_5593 :Waarschuwingen over de parkwaardering
STR_5594 :Als een attractie kapot is gegaan
STR_5595 :Als een attractie is neergestort
STR_5596 :Waarschuwingen over attracties
STR_5597 :Als een nieuw type attractie of thema beschikbaar is
STR_5598 :Waarschuwingen over bezoekers
STR_5599 :Als een gevolgde bezoeker verdwaald is
STR_5600 :Als een gevolgde bezoeker het park verlaten heeft
STR_5601 :Als een gevolgde bezoeker in de rij staat voor een attractie
STR_5602 :Als een gevolgde bezoeker een attractie is ingegaan
STR_5603 :Als een gevolgde bezoeker een attractie is uitgegaan
STR_5604 :Als een gevolgde bezoeker iets gekocht heeft
STR_5605 :Als een gevolgde bezoeker een faciliteit gebruikt
STR_5606 :Als een bezoeker is overleden
#############
# Scenarios #

View File

@ -3636,7 +3636,7 @@ STR_5296 :{SMALLFONT}{BLACK}공원을 닫습니다
STR_5297 :{SMALLFONT}{BLACK}공원을 엽니다
STR_5298 :{RED}{STRINGID}
STR_5299 :{LIGHTPINK}{STRINGID}
STR_5300 :{SMALLFONT}{BLACK}빠른 직원 해고
STR_5300 :{SMALLFONT}{BLACK}직원 간편 해고
STR_5301 :{MEDIUMFONT}{BLACK}대출금을 모두 갚습니다
STR_5302 :대출금 모두 갚기
STR_5303 :일시정지 모드에서 건설 허용
@ -3924,6 +3924,25 @@ STR_5584 :국제단위(SI)법
STR_5585 :{SMALLFONT}{BLACK}체인/발사 속력을 {VELOCITY}으로 만드는 것과 같이 일부 놀이기구 운행 제한을 없애줍니다
STR_5586 :상점이나 가게를 자동으로 엶
STR_5587 :{SMALLFONT}{BLACK}이 설정을 켜면 상점이나 가게를 건설하면 자동으로 열도록 만들어 줍니다.
STR_5588 :{SMALLFONT}{BLACK}다른 참가자와 함께 플레이합니다.
STR_5589 :알림 설정
STR_5590 :공원 수상 내역
STR_5591 :광고 종료
STR_5592 :공원에 대한 경고
STR_5593 :공원 등급 경고
STR_5594 :놀이기구 고장
STR_5595 :놀이기구 충돌
STR_5596 :놀이기구에 대한 경고
STR_5597 :놀이기구 / 풍경 연구 완료
STR_5598 :손님에 대한 경고
STR_5599 :손님의 길 잃음
STR_5600 :손님의 공원 퇴장
STR_5601 :손님의 놀이기구 대기줄 진입
STR_5602 :손님의 놀이기구 탑승
STR_5603 :손님의 놀이기구 하차
STR_5604 :손님의 물건 구입
STR_5605 :손님의 시설 사용
STR_5606 :손님의 사망
###############################################################################
@ -4580,7 +4599,7 @@ STR_NAME :핫도그 가게
STR_DESC :핫도그를 파는 가게
[ICECR1]
STR_NAME :과일 아이스크림 가게
STR_NAME :아이스크림 가게
STR_DESC :과일 아이스크림을 파는 가게
[ICECR2]

View File

@ -3918,6 +3918,32 @@ STR_5577 :Won Sul-Coreano(W)
STR_5578 :Rublo Russo (R)
STR_5579 :Fator escalar da janela:
STR_5580 :Coroa Tcheca (Kc)
STR_5581 :Mostrar FPS
STR_5582 :Manter ponteiro do mouse dentro da janela
STR_5583 :{COMMA1DP16}ms{POWERNEGATIVEONE}
STR_5584 :SI
STR_5585 :{SMALLFONT}{BLACK}Destrava limites de operação na atração, permitindo coisas como corrente de elevação com {VELOCITY}
STR_5586 :Abrir automaticamente lojas e barracas
STR_5587 :{SMALLFONT}{BLACK}Quando habilitado, lojas e barracas serão abertas automaticamente depois de contruí-las
STR_5588 :{SMALLFONT}{BLACK}Jogue com outros jogadores
STR_5589 :Configurações de Notificação
STR_5590 :Prêmios do parque
STR_5591 :A campanha de marketing terminou
STR_5592 :Avisos do parque
STR_5593 :Avisos de classificação do parque
STR_5594 :Atração quebrou
STR_5595 :Atração bateu
STR_5596 :Avisos de atração
STR_5597 :Atração / Cernário pesquisado
STR_5598 :Avisos de visitantes
STR_5599 :Visitante está perdido
STR_5600 :Visitante saiu do parque
STR_5601 :Visitante está esperando na fila para atração
STR_5602 :Visitante está na atração
STR_5603 :Visitante saiu da atração
STR_5604 :Visitante comprou um item
STR_5605 :Visitante usou uma instalação
STR_5606 :Visitante morreu
#####################
# Rides/attractions #

View File

@ -770,64 +770,64 @@ STR_0765 :Visitante {INT32}
STR_0766 :Visitante {INT32}
STR_0767 :Visitante {INT32}
STR_0768 :Handyman {INT32}
STR_0769 :Mechanic {INT32}
STR_0770 :Security Guard {INT32}
STR_0771 :Entertainer {INT32}
STR_0772 :Unnamed park{POP16}{POP16}
STR_0773 :Unnamed park{POP16}{POP16}
STR_0774 :Unnamed park{POP16}{POP16}
STR_0775 :Unnamed park{POP16}{POP16}
STR_0776 :Unnamed park{POP16}{POP16}
STR_0777 :Unnamed park{POP16}{POP16}
STR_0769 :Mecánico {INT32}
STR_0770 :Guardia {INT32}
STR_0771 :Animador {INT32}
STR_0772 :Parque sin nombre{POP16}{POP16}
STR_0773 :Parque sin nombre{POP16}{POP16}
STR_0774 :Parque sin nombre{POP16}{POP16}
STR_0775 :Parque sin nombre{POP16}{POP16}
STR_0776 :Parque sin nombre{POP16}{POP16}
STR_0777 :Parque sin nombre{POP16}{POP16}
STR_0778 :Sign
STR_0779 :1st
STR_0780 :2nd
STR_0781 :3rd
STR_0782 :4th
STR_0783 :5th
STR_0784 :6th
STR_0785 :7th
STR_0786 :8th
STR_0787 :9th
STR_0788 :10th
STR_0789 :11th
STR_0790 :12th
STR_0791 :13th
STR_0792 :14th
STR_0793 :15th
STR_0794 :16th
STR_0795 :17th
STR_0796 :18th
STR_0797 :19th
STR_0798 :20th
STR_0799 :21st
STR_0800 :22nd
STR_0801 :23rd
STR_0802 :24th
STR_0803 :25th
STR_0804 :26th
STR_0805 :27th
STR_0806 :28th
STR_0807 :29th
STR_0808 :30th
STR_0809 :31st
STR_0810 :Jan
STR_0811 :Feb
STR_0812 :Mar
STR_0813 :Apr
STR_0814 :May
STR_0815 :Jun
STR_0816 :Jul
STR_0817 :Aug
STR_0818 :Sep
STR_0819 :Oct
STR_0820 :Nov
STR_0821 :Dec
STR_0779 :1
STR_0780 :2
STR_0781 :3
STR_0782 :4
STR_0783 :5
STR_0784 :6
STR_0785 :7
STR_0786 :8
STR_0787 :9
STR_0788 :10
STR_0789 :11
STR_0790 :12
STR_0791 :13
STR_0792 :14
STR_0793 :15
STR_0794 :16
STR_0795 :17
STR_0796 :18
STR_0797 :19
STR_0798 :20
STR_0799 :21
STR_0800 :22
STR_0801 :23
STR_0802 :24
STR_0803 :25
STR_0804 :26
STR_0805 :27
STR_0806 :28
STR_0807 :29
STR_0808 :30
STR_0809 :31
STR_0810 :enero
STR_0811 :feb
STR_0812 :marzo
STR_0813 :abr
STR_0814 :mayo
STR_0815 :jun
STR_0816 :jul
STR_0817 :agosto
STR_0818 :sep
STR_0819 :oct
STR_0820 :nov
STR_0821 :dic
STR_0822 :Unable to access graphic data file
STR_0823 :Missing or inaccessible data file
STR_0824 :{BLACK}{CROSS}
STR_0825 :Chosen name in use already
STR_0826 :Too many names defined
STR_0825 :Este nombre está usado
STR_0826 :Demasiados nombres están usados
STR_0827 :Not enough cash - requires {CURRENCY2DP}
STR_0828 :{SMALLFONT}{BLACK}Close window
STR_0829 :{SMALLFONT}{BLACK}Window title - Drag this to move window
@ -849,7 +849,7 @@ STR_0843 :<not used anymore>
STR_0844 :<not used anymore>
STR_0845 :<not used anymore>
STR_0846 :<not used anymore>
STR_0847 :About 'OpenRCT2'
STR_0847 :Sobre 'OpenRCT2'
STR_0848 :RollerCoaster Tycoon 2
STR_0849 :{WINDOW_COLOUR_2}Version 2.01.028
STR_0850 :{WINDOW_COLOUR_2}Copyright {COPYRIGHT} 2002 Chris Sawyer, all rights reserved
@ -879,8 +879,8 @@ STR_0873 :{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{STRINGID}
STR_0874 :{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{STRINGID}
STR_0875 :{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{STRINGID}
STR_0876 :{BLACK}{DOWN}
STR_0877 :Too low !
STR_0878 :Too high !
STR_0877 :¡Demasiado bajo!
STR_0878 :¡Demasiado alto!
STR_0879 :Can't lower land here...
STR_0880 :Can't raise land here...
STR_0881 :Object in the way
@ -893,22 +893,22 @@ STR_0887 :Quit Scenario Editor
STR_0888 :Quit Roller Coaster Designer
STR_0889 :Quit Track Designs Manager
STR_0890 :SCR{COMMA16}.BMP
STR_0891 :Screenshot
STR_0891 :Una foto
STR_0892 :Screenshot saved to disk as '{STRINGID}'
STR_0893 :Screenshot failed !
STR_0894 :Landscape data area full !
STR_0895 :Can't build partly above and partly below ground
STR_0896 :{POP16}{POP16}{STRINGID} Construction
STR_0897 :Direction
STR_0898 :{SMALLFONT}{BLACK}Left-hand curve
STR_0899 :{SMALLFONT}{BLACK}Right-hand curve
STR_0900 :{SMALLFONT}{BLACK}Left-hand curve (small radius)
STR_0901 :{SMALLFONT}{BLACK}Right-hand curve (small radius)
STR_0902 :{SMALLFONT}{BLACK}Left-hand curve (very small radius)
STR_0903 :{SMALLFONT}{BLACK}Right-hand curve (very small radius)
STR_0904 :{SMALLFONT}{BLACK}Left-hand curve (large radius)
STR_0905 :{SMALLFONT}{BLACK}Right-hand curve (large radius)
STR_0906 :{SMALLFONT}{BLACK}Straight
STR_0896 :{POP16}{POP16}{STRINGID} Construcción
STR_0897 :Dirección
STR_0898 :{SMALLFONT}{BLACK}Curva izquierda
STR_0899 :{SMALLFONT}{BLACK}Curva derecha
STR_0900 :{SMALLFONT}{BLACK}Curva izquierda (pequeño)
STR_0901 :{SMALLFONT}{BLACK}Curva derecha (pequeño)
STR_0902 :{SMALLFONT}{BLACK}Curva izquierda (muy pequeño)
STR_0903 :{SMALLFONT}{BLACK}Curva derecha (muy pequeño)
STR_0904 :{SMALLFONT}{BLACK}Curva izquierda (grande)
STR_0905 :{SMALLFONT}{BLACK}Curva derecha (grande)
STR_0906 :{SMALLFONT}{BLACK}Derecho
STR_0907 :Slope
STR_0908 :Roll/Banking
STR_0909 :Seat Rot.
@ -1915,7 +1915,7 @@ STR_1907 :{WINDOW_COLOUR_2}Staff wages
STR_1908 :{WINDOW_COLOUR_2}Marketing
STR_1909 :{WINDOW_COLOUR_2}Research
STR_1910 :{WINDOW_COLOUR_2}Loan interest
STR_1911 :{BLACK} at {COMMA16}% per year
STR_1911 :{BLACK} a {COMMA16}% por año
STR_1912 :{MONTH}
STR_1913 :{BLACK}+{CURRENCY2DP}
STR_1914 :{BLACK}{CURRENCY2DP}
@ -1923,24 +1923,24 @@ STR_1915 :{RED}{CURRENCY2DP}
STR_1916 :{WINDOW_COLOUR_2}Loan:
STR_1917 :{POP16}{POP16}{POP16}{CURRENCY}
STR_1918 :Can't borrow any more money!
STR_1919 :Not enough cash available!
STR_1919 :¡Insuficiente dinero!
STR_1920 :Can't pay back loan!
STR_1921 :{SMALLFONT}{BLACK}Start a new game
STR_1922 :{SMALLFONT}{BLACK}Continue playing a saved game
STR_1923 :{SMALLFONT}{BLACK}Show tutorial
STR_1924 :{SMALLFONT}{BLACK}Exit
STR_1924 :{SMALLFONT}{BLACK}Salida
STR_1925 :Can't place person here...
STR_1926 :{SMALLFONT}
STR_1927 :{YELLOW}{STRINGID} has broken down
STR_1928 :{RED}{STRINGID} has crashed!
STR_1927 :{YELLOW}{STRINGID} ha roto
STR_1928 :¡{RED}{STRINGID} ha chocado!
STR_1929 :{RED}{STRINGID} still hasn't been fixed{NEWLINE}Check where your mechanics are and consider organising them better
STR_1930 :{SMALLFONT}{BLACK}Turn on/off tracking information for this guest - (If tracking is on, guest's movements will be reported in the message area)
STR_1931 :{STRINGID} has joined the queue line for {STRINGID}
STR_1932 :{STRINGID} is on {STRINGID}
STR_1933 :{STRINGID} is in {STRINGID}
STR_1934 :{STRINGID} has left {STRINGID}
STR_1935 :{STRINGID} has left the park
STR_1936 :{STRINGID} has bought {STRINGID}
STR_1932 :{STRINGID} está en {STRINGID}
STR_1933 :{STRINGID} está en {STRINGID}
STR_1934 :{STRINGID} se va de {STRINGID}
STR_1935 :{STRINGID} se va del parque
STR_1936 :{STRINGID} compra {STRINGID}
STR_1937 :{SMALLFONT}{BLACK}Show information about the subject of this message
STR_1938 :{SMALLFONT}{BLACK}Show view of guest
STR_1939 :{SMALLFONT}{BLACK}Show view of staff member
@ -1992,93 +1992,93 @@ STR_1984 :{WINDOW_COLOUR_2}Fried Chicken price:
STR_1985 :{WINDOW_COLOUR_2}Lemonade price:
STR_1986 :{WINDOW_COLOUR_2}
STR_1987 :{WINDOW_COLOUR_2}
STR_1988 :Balloon
STR_1989 :Cuddly Toy
STR_1990 :Park Map
STR_1988 :Globo
STR_1989 :Juguete Mimoso
STR_1990 :Mapa del Parque
STR_1991 :On-Ride Photo
STR_1992 :Umbrella
STR_1993 :Drink
STR_1994 :Burger
STR_1995 :Chips
STR_1996 :Ice Cream
STR_1992 :Sombrilla
STR_1993 :Bebida
STR_1994 :Hamburguesa
STR_1995 :Patatas Fritas
STR_1996 :Helado
STR_1997 :Candyfloss
STR_1998 :Empty Can
STR_1999 :Rubbish
STR_1999 :Basura
STR_2000 :Empty Burger Box
STR_2001 :Pizza
STR_2002 :Voucher
STR_2003 :Popcorn
STR_2004 :Hot Dog
STR_2005 :Tentacle
STR_2006 :Hat
STR_2003 :Palomitas de Maíz
STR_2004 :Perrito Caliente
STR_2005 :Tentáculo
STR_2006 :Gorra
STR_2007 :Toffee Apple
STR_2008 :T-Shirt
STR_2009 :Doughnut
STR_2010 :Coffee
STR_2008 :Camiseta
STR_2009 :Rosquilla
STR_2010 :Café
STR_2011 :Empty Cup
STR_2012 :Fried Chicken
STR_2013 :Lemonade
STR_2012 :Pollo Frito
STR_2013 :Limonada
STR_2014 :Empty Box
STR_2015 :Empty Bottle
STR_2016 :Balloons
STR_2017 :Cuddly Toys
STR_2018 :Park Maps
STR_2016 :Globos
STR_2017 :Juguetes Mimosos
STR_2018 :Mapas del parque
STR_2019 :On-Ride Photos
STR_2020 :Umbrellas
STR_2021 :Drinks
STR_2022 :Burgers
STR_2023 :Chips
STR_2024 :Ice Creams
STR_2020 :Sombrillas
STR_2021 :Bebidas
STR_2022 :Hamburguesas
STR_2023 :Patatas Fritas
STR_2024 :Helados
STR_2025 :Candyfloss
STR_2026 :Empty Cans
STR_2027 :Rubbish
STR_2027 :Basuras
STR_2028 :Empty Burger Boxes
STR_2029 :Pizzas
STR_2030 :Vouchers
STR_2031 :Popcorn
STR_2032 :Hot Dogs
STR_2033 :Tentacles
STR_2034 :Hats
STR_2031 :Palomitas de Maíz
STR_2032 :Perritos Calientes
STR_2033 :Tentáculos
STR_2034 :Gorras
STR_2035 :Toffee Apples
STR_2036 :T-Shirts
STR_2037 :Doughnuts
STR_2038 :Coffees
STR_2036 :Camisetas
STR_2037 :Rosquillas
STR_2038 :Cafés
STR_2039 :Empty Cups
STR_2040 :Fried Chicken
STR_2041 :Lemonade
STR_2040 :Pollo Frito
STR_2041 :Limonada
STR_2042 :Empty Boxes
STR_2043 :Empty Bottles
STR_2044 :a Balloon
STR_2045 :a Cuddly Toy
STR_2046 :a Park Map
STR_2044 :un Globo
STR_2045 :un Juguete Mimoso
STR_2046 :un Mapa del Parque
STR_2047 :an On-Ride Photo
STR_2048 :an Umbrella
STR_2049 :a Drink
STR_2050 :a Burger
STR_2051 :some Chips
STR_2052 :an Ice Cream
STR_2048 :una Sombrilla
STR_2049 :una Bebida
STR_2050 :una Hamburguesa
STR_2051 :unas Patatas Fritas
STR_2052 :un Helado
STR_2053 :some Candyfloss
STR_2054 :an Empty Can
STR_2055 :some Rubbish
STR_2055 :una Basura
STR_2056 :an Empty Burger Box
STR_2057 :a Pizza
STR_2057 :una Pizza
STR_2058 :a Voucher
STR_2059 :some Popcorn
STR_2060 :a Hot Dog
STR_2061 :a Tentacle
STR_2062 :a Hat
STR_2059 :unas Palomitas de Maíz
STR_2060 :un Perrito Caliente
STR_2061 :un Tentáculo
STR_2062 :una Gorra
STR_2063 :a Toffee Apple
STR_2064 :a T-Shirt
STR_2065 :a Doughnut
STR_2066 :a Coffee
STR_2064 :una Camiseta
STR_2065 :una Rosquilla
STR_2066 :un Café
STR_2067 :an Empty Cup
STR_2068 :some Fried Chicken
STR_2069 :some Lemonade
STR_2068 :unos Pollos Fritos
STR_2069 :una Limonada
STR_2070 :an Empty Box
STR_2071 :an Empty Bottle
STR_2072 :{OPENQUOTES}{STRINGID}{ENDQUOTES} Balloon
STR_2073 :{OPENQUOTES}{STRINGID}{ENDQUOTES} Cuddly Toy
STR_2074 :Map of {STRINGID}
STR_2074 :Mapa de {STRINGID}
STR_2075 :On-Ride Photo of {STRINGID}
STR_2076 :{OPENQUOTES}{STRINGID}{ENDQUOTES} Umbrella
STR_2077 :Drink
@ -2240,18 +2240,18 @@ STR_2232 :Cable lift hill
STR_2233 :{SMALLFONT}{BLACK}Park information
STR_2234 :Recent Messages
STR_2235 :{SMALLFONT}{STRINGID} {STRINGID}
STR_2236 :January
STR_2237 :February
STR_2238 :March
STR_2239 :April
STR_2240 :May
STR_2241 :June
STR_2242 :July
STR_2243 :August
STR_2244 :September
STR_2245 :October
STR_2246 :November
STR_2247 :December
STR_2236 :Enero
STR_2237 :Febrero
STR_2238 :Marzo
STR_2239 :Abril
STR_2240 :Mayo
STR_2241 :Junio
STR_2242 :Julio
STR_2243 :Agosto
STR_2244 :Septiembre
STR_2245 :Octubre
STR_2246 :Noviembre
STR_2247 :Diciembre
STR_2248 :Can't demolish ride/attraction...
STR_2249 :{BABYBLUE}New ride/attraction now available:{NEWLINE}{STRINGID}
STR_2250 :{BABYBLUE}New scenery/themeing now available:{NEWLINE}{STRINGID}
@ -2269,7 +2269,7 @@ STR_2261 :Minimum funding
STR_2262 :Normal funding
STR_2263 :Maximum funding
STR_2264 :Research funding
STR_2265 :{WINDOW_COLOUR_2}Cost: {BLACK}{CURRENCY} per month
STR_2265 :{WINDOW_COLOUR_2}Precio: {BLACK}{CURRENCY} por mes
STR_2266 :Research priorities
STR_2267 :Currently in development
STR_2268 :Last development
@ -2331,13 +2331,13 @@ STR_2323 :{WINDOW_COLOUR_2}Park size: {BLACK}{COMMA32}m{SQUARED}
STR_2324 :{WINDOW_COLOUR_2}Park size: {BLACK}{COMMA32}sq.ft.
STR_2325 :{SMALLFONT}{BLACK}Buy land to extend park
STR_2326 :{SMALLFONT}{BLACK}Buy construction rights to allow construction above or below land outside the park
STR_2327 :Options
STR_2328 :{WINDOW_COLOUR_2}Currency:
STR_2329 :{WINDOW_COLOUR_2}Distance and Speed:
STR_2330 :{WINDOW_COLOUR_2}Temperature:
STR_2331 :{WINDOW_COLOUR_2}Height Labels:
STR_2332 :Units
STR_2333 :Sound
STR_2327 :Opciones
STR_2328 :{WINDOW_COLOUR_2}Moneda:
STR_2329 :{WINDOW_COLOUR_2}Distancia y Velocidad:
STR_2330 :{WINDOW_COLOUR_2}Temperatura:
STR_2331 :{WINDOW_COLOUR_2}Etiquetas de altitud:
STR_2332 :Unidades
STR_2333 :Sonido
STR_2334 :Pounds ({POUND})
STR_2335 :Dollars ($)
STR_2336 :Franc (F)
@ -2349,9 +2349,9 @@ STR_2341 :Guilders (fl.)
STR_2342 :Krona (kr)
STR_2343 :Euros ({EURO})
STR_2344 :Imperial
STR_2345 :Metric
STR_2346 :Display
STR_2347 :{RED}{STRINGID} has drowned!
STR_2345 :Métrico
STR_2346 :Monitor
STR_2347 :{RED}{STRINGID} se ahoga!
STR_2348 :{SMALLFONT}{BLACK}Show statistics for this staff member
STR_2349 :{WINDOW_COLOUR_2}Wages: {BLACK}{CURRENCY} per month
STR_2350 :{WINDOW_COLOUR_2}Employed: {BLACK}{MONTHYEAR}
@ -2361,9 +2361,9 @@ STR_2353 :{WINDOW_COLOUR_2}Litter swept: {BLACK}{COMMA16}
STR_2354 :{WINDOW_COLOUR_2}Bins emptied: {BLACK}{COMMA16}
STR_2355 :{WINDOW_COLOUR_2}Rides fixed: {BLACK}{COMMA16}
STR_2356 :{WINDOW_COLOUR_2}Rides inspected: {BLACK}{COMMA16}
STR_2357 :House
STR_2358 :Units
STR_2359 :Real Values
STR_2357 :Casa
STR_2358 :Unidas
STR_2359 :Valores Real
STR_2360 :{WINDOW_COLOUR_2}Display Resolution:
STR_2361 :Landscape Smoothing
STR_2362 :{SMALLFONT}{BLACK}Toggle landscape tile edge smoothing on/off

View File

@ -49,6 +49,7 @@
<ClCompile Include="src\editor.c" />
<ClCompile Include="src\game.c" />
<ClCompile Include="src\hook.c" />
<ClCompile Include="src\image_io.c" />
<ClCompile Include="src\input.c" />
<ClCompile Include="src\interface\chat.c" />
<ClCompile Include="src\interface\colour.c" />
@ -210,6 +211,7 @@
<ClInclude Include="src\core\Memory.hpp" />
<ClInclude Include="src\core\StringBuilder.hpp" />
<ClInclude Include="src\core\StringReader.hpp" />
<ClInclude Include="src\core\Util.hpp" />
<ClInclude Include="src\cursors.h" />
<ClInclude Include="src\diagnostic.h" />
<ClInclude Include="src\drawing\drawing.h" />
@ -218,6 +220,7 @@
<ClInclude Include="src\editor.h" />
<ClInclude Include="src\game.h" />
<ClInclude Include="src\hook.h" />
<ClInclude Include="src\image_io.h" />
<ClInclude Include="src\input.h" />
<ClInclude Include="src\interface\chat.h" />
<ClInclude Include="src\interface\colour.h" />

View File

@ -558,7 +558,12 @@
<ClCompile Include="src\drawing\supports.c">
<Filter>Source\Drawing</Filter>
</ClCompile>
<ClCompile Include="src\windows\news_options.c" />
<ClCompile Include="src\windows\news_options.c">
<Filter>Source\Windows</Filter>
</ClCompile>
<ClCompile Include="src\image_io.c">
<Filter>Source</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\management\award.h">
@ -843,5 +848,11 @@
<ClInclude Include="src\version.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="src\core\Util.hpp">
<Filter>Source\Core</Filter>
</ClInclude>
<ClInclude Include="src\image_io.h">
<Filter>Source</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -15,9 +15,9 @@ fi
# keep in sync with version in install.sh
if [[ $(uname -s) == "Darwin" ]]; then
# keep in sync with version in Xcode project
sha256sum=2cec3958352477fbb876a5b6398722077084b5ff7e95a7d3cd67492abf5012fc
sha256sum=02ebc8e7fd8b9b02b7144721784c5d96202a17398bc8652da163c8c85b66a7db
else
sha256sum=69ff98c9544838fb16384bc78af9dc1c452b9d01d919e43f5fec686d02c9bdd8
sha256sum=31c5e19d9f794bd5f0e75f20c2b4c3c4664d736b0a4d50c8cde14a9a9007b62d
fi
libVFile="./libversion"
libdir="./lib"
@ -62,10 +62,12 @@ pushd build
PARENT=$(readlink -f ../)
chmod a+rwx $(pwd)
chmod g+s $(pwd)
docker run -u travis -v $PARENT:/work/openrct2 -w /work/openrct2/build -i -t openrct2/openrct2:32bit-only bash -c "cmake ../ $OPENRCT2_CMAKE_OPTS && make"
# CMAKE and MAKE opts from environment
docker run -u travis -v $PARENT:/work/openrct2 -w /work/openrct2/build -i -t openrct2/openrct2:32bit-only bash -c "cmake ../ $OPENRCT2_CMAKE_OPTS && make $OPENRCT_MAKE_OPTS"
else
cmake -DCMAKE_BUILD_TYPE=Debug $OPENRCT2_CMAKE_OPTS ..
make
# NOT the same variable as above
make $OPENRCT2_MAKE_OPTS
fi
popd

View File

@ -170,8 +170,9 @@ elif [[ $(uname) == "Linux" ]]; then
case "$TARGET" in
"linux")
sudo dpkg --add-architecture i386
sudo add-apt-repository -y ppa:djcj/tools
sudo apt-get update
sudo apt-get install --no-install-recommends -y --force-yes cmake libsdl2-dev:i386 libsdl2-ttf-dev:i386 gcc-4.8 pkg-config:i386 g++-4.8-multilib gcc-4.8-multilib libjansson-dev:i386 libspeex-dev:i386 libspeexdsp-dev:i386 libcurl4-openssl-dev:i386 libcrypto++-dev:i386 clang libfontconfig1-dev:i386 libfreetype6-dev:i386 libpng-dev:i386
sudo apt-get install --no-install-recommends -y --force-yes cmake libsdl2-dev:i386 libsdl2-ttf-dev:i386 gcc-4.8 pkg-config:i386 g++-4.8-multilib gcc-4.8-multilib libjansson-dev:i386 libspeex-dev:i386 libspeexdsp-dev:i386 libcurl4-openssl-dev:i386 libcrypto++-dev:i386 clang libfontconfig1-dev:i386 libfreetype6-dev:i386 libpng-dev:i386 libpng16-dev:i386
download https://launchpad.net/ubuntu/+archive/primary/+files/libjansson4_2.7-1ubuntu1_i386.deb libjansson4_2.7-1ubuntu1_i386.deb
download https://launchpad.net/ubuntu/+archive/primary/+files/libjansson-dev_2.7-1ubuntu1_i386.deb libjansson-dev_2.7-1ubuntu1_i386.deb
sudo dpkg -i libjansson4_2.7-1ubuntu1_i386.deb

View File

@ -18,12 +18,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#include <lodepng/lodepng.h>
#include "cmdline.h"
#include "drawing/drawing.h"
#include "image_io.h"
#include "openrct2.h"
#include "platform/platform.h"
#include "util/util.h"
#include "openrct2.h"
#define MODE_DEFAULT 0
#define MODE_CLOSEST 1
@ -168,33 +168,11 @@ bool sprite_file_export(int spriteIndex, const char *outPath)
memcpy(spriteFilePalette, _standardPalette, 256 * 4);
gfx_rle_sprite_to_buffer(spriteHeader->offset, pixels, (uint8*)spriteFilePalette, &dpi, IMAGE_TYPE_NO_BACKGROUND, 0, spriteHeader->height, 0, spriteHeader->width);
LodePNGState pngState;
unsigned int pngError;
unsigned char* pngData;
size_t pngSize;
lodepng_state_init(&pngState);
pngState.info_raw.colortype = LCT_PALETTE;
lodepng_palette_add(&pngState.info_raw, 0, 0, 0, 0);
for (int i = 1; i < 256; i++) {
lodepng_palette_add(
&pngState.info_raw,
spriteFilePalette[i].r,
spriteFilePalette[i].g,
spriteFilePalette[i].b,
255
);
}
pngError = lodepng_encode(&pngData, &pngSize, pixels, spriteHeader->width, spriteHeader->height, &pngState);
if (pngError != 0) {
free(pngData);
fprintf(stderr, "Error creating PNG data, %u: %s", pngError, lodepng_error_text(pngError));
return false;
} else {
lodepng_save_file(pngData, pngSize, outPath);
free(pngData);
if (image_io_png_write(&dpi, (rct_palette*)spriteFilePalette, outPath)) {
return true;
} else {
fprintf(stderr, "Error writing PNG");
return false;
}
}
@ -261,16 +239,10 @@ typedef struct {
bool sprite_file_import(const char *path, rct_g1_element *outElement, uint8 **outBuffer, int *outBufferLength, int mode)
{
unsigned char *pixels;
unsigned int width, height;
unsigned int pngError;
memcpy(spriteFilePalette, _standardPalette, 256 * 4);
pngError = lodepng_decode_file(&pixels, &width, &height, path, LCT_RGBA, 8);
if (pngError != 0) {
free(pixels);
fprintf(stderr, "Error creating PNG data, %u: %s", pngError, lodepng_error_text(pngError));
uint8 *pixels;
uint32 width, height;
if (!image_io_png_read(&pixels, &width, &height, path)) {
fprintf(stderr, "Error reading PNG");
return false;
}
@ -280,6 +252,8 @@ bool sprite_file_import(const char *path, rct_g1_element *outElement, uint8 **ou
return false;
}
memcpy(spriteFilePalette, _standardPalette, 256 * 4);
uint8 *buffer = malloc((height * 2) + (width * height * 16));
memset(buffer, 0, (height * 2) + (width * height * 16));
uint16 *yOffsets = (uint16*)buffer;

View File

@ -1479,16 +1479,13 @@ static void title_sequence_open(const char *path, const char *customName)
gConfigTitleSequences.presets = realloc(gConfigTitleSequences.presets, sizeof(title_sequence) * (size_t)gConfigTitleSequences.num_presets);
if (customName == NULL) {
char nameBuffer[MAX_PATH], *name;
char nameBuffer[MAX_PATH];
safe_strncpy(nameBuffer, path, MAX_PATH);
name = nameBuffer + strlen(nameBuffer) - 1;
while (*name == '\\' || *name == '/') {
*name = 0;
name--;
}
while (*(name - 1) != '\\' && *(name - 1) != '/') {
name--;
}
// Get folder name
// First strip off the last folder separator
*strrchr(nameBuffer, platform_get_path_separator()) = '\0';
// Then find the name of the folder
char *name = strrchr(nameBuffer, platform_get_path_separator()) + 1;
safe_strncpy(gConfigTitleSequences.presets[preset].name, name, TITLE_SEQUENCE_NAME_SIZE);
gConfigTitleSequences.presets[preset].path[0] = 0;
}
@ -1587,7 +1584,7 @@ void title_sequence_save_preset_script(int preset)
platform_get_user_directory(path, "title sequences");
strcat(path, path_get_filename(gConfigTitleSequences.presets[preset].name));
strcat(path, gConfigTitleSequences.presets[preset].name);
strncat(path, &separator, 1);
strcat(path, "script.txt");

View File

@ -69,6 +69,17 @@ typedef struct {
void *data;
} rct_gx;
typedef struct {
uint8 blue;
uint8 green;
uint8 red;
uint8 alpha;
} rct_palette_entry;
typedef struct {
rct_palette_entry entries[256];
} rct_palette;
#define SPRITE_ID_PALETTE_COLOUR_1(colourId) ((IMAGE_TYPE_USE_PALETTE << 28) | ((colourId) << 19))
extern const uint16 palette_to_g1_offset[];

View File

@ -1056,7 +1056,7 @@ void save_game()
}
void save_game_as()
{
window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_GAME, gScenarioSavePath);
window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_GAME, (char*)path_get_filename(gScenarioSavePath));
}
@ -1130,7 +1130,6 @@ void game_load_or_quit_no_save_prompt()
game_do_command(0, 1, 0, 1, GAME_COMMAND_LOAD_OR_QUIT, 0, 0);
tool_cancel();
if (RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) & INPUT_FLAG_5) {
// RCT2_CALLPROC_EBPSAFE(0x0040705E); Function not required resets cursor position.
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) &= ~INPUT_FLAG_5;
}
gGameSpeed = 1;

371
src/image_io.c Normal file
View File

@ -0,0 +1,371 @@
#ifdef USE_LIBPNG
#include <png.h>
#else
#include <lodepng/lodepng.h>
#endif
#include "image_io.h"
#ifdef USE_LIBPNG
static void my_png_read_data(png_structp png_ptr, png_bytep data, png_size_t length);
static void my_png_write_data(png_structp png_ptr, png_bytep data, png_size_t length);
static void my_png_flush(png_structp png_ptr);
#endif
bool image_io_png_read(uint8 **pixels, uint32 *width, uint32 *height, const utf8 *path)
{
#ifdef USE_LIBPNG
png_structp png_ptr;
png_infop info_ptr;
unsigned int sig_read = 0;
// Setup PNG structures
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png_ptr == NULL) {
return false;
}
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) {
png_destroy_read_struct(&png_ptr, NULL, NULL);
return false;
}
// Open PNG file
SDL_RWops *fp = SDL_RWFromFile(path, "rb");
if (fp == NULL) {
return false;
}
// Set error handling
if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
SDL_RWclose(fp);
return false;
}
// Setup png reading
png_set_read_fn(png_ptr, fp, my_png_read_data);
png_set_sig_bytes(png_ptr, sig_read);
// To simplify the reading process, convert 4-16 bit data to 24-32 bit data
png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_PACKING | PNG_TRANSFORM_EXPAND, NULL);
// Read header
png_uint_32 pngWidth, pngHeight;
int bit_depth, color_type, interlace_type;
png_get_IHDR(png_ptr, info_ptr, &pngWidth, &pngHeight, &bit_depth, &color_type, &interlace_type, NULL, NULL);
// Read pixels as 32bpp RGBA data
png_size_t rowBytes = png_get_rowbytes(png_ptr, info_ptr);
png_bytepp rowPointers = png_get_rows(png_ptr, info_ptr);
uint8 *pngPixels = (uint8*)malloc(pngWidth * pngHeight * 4);
uint8 *dst = pngPixels;
if (color_type == PNG_COLOR_TYPE_RGB) {
// 24-bit PNG (no alpha)
const png_size_t expectedRowSize = pngWidth * 3;
for (png_uint_32 i = 0; i < pngHeight; i++) {
assert(rowBytes == expectedRowSize);
uint8 *src = rowPointers[i];
for (png_uint_32 x = 0; x < pngWidth; x++) {
*dst++ = *src++;
*dst++ = *src++;
*dst++ = *src++;
*dst++ = 255;
}
}
} else {
// 32-bit PNG (with alpha)
const png_size_t expectedRowSize = pngWidth * 4;
for (png_uint_32 i = 0; i < pngHeight; i++) {
assert(rowBytes == expectedRowSize);
memcpy(dst, rowPointers[i], rowBytes);
dst += rowBytes;
}
}
// Close the PNG
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
SDL_RWclose(fp);
// Return the output data
*pixels = (uint8*)pngPixels;
if (width != NULL) *width = pngWidth;
if (height != NULL) *height = pngHeight;
return true;
#else
// Read the pixels as 32bpp RGBA
unsigned char *pngPixels;
unsigned int pngWidth, pngHeight;
unsigned int pngError = lodepng_decode_file(&pngPixels, &pngWidth, &pngHeight, path, LCT_RGBA, 8);
if (pngError != 0) {
free(pngPixels);
log_error("Error creating PNG data, %u: %s", pngError, lodepng_error_text(pngError));
return false;
}
// Return the output data
*pixels = (uint8*)pngPixels;
if (width != NULL) *width = pngWidth;
if (height != NULL) *height = pngHeight;
return true;
#endif
}
bool image_io_png_write(const rct_drawpixelinfo *dpi, const rct_palette *palette, const utf8 *path)
{
#ifdef USE_LIBPNG
// Get image size
int stride = dpi->width + dpi->pitch;
// Setup PNG
png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png_ptr == NULL) {
return false;
}
png_infop info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) {
png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
return false;
}
png_colorp png_palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH * sizeof(png_color));
for (int i = 0; i < 256; i++) {
const rct_palette_entry *entry = &palette->entries[i];
png_palette[i].blue = entry->blue;
png_palette[i].green = entry->green;
png_palette[i].red = entry->red;
}
png_set_PLTE(png_ptr, info_ptr, png_palette, PNG_MAX_PALETTE_LENGTH);
// Open file for writing
SDL_RWops *file = SDL_RWFromFile(path, "wb");
if (file == NULL) {
png_free(png_ptr, png_palette);
png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
return false;
}
png_set_write_fn(png_ptr, file, my_png_write_data, my_png_flush);
// Set error handler
if (setjmp(png_jmpbuf(png_ptr))) {
png_free(png_ptr, png_palette);
png_destroy_write_struct(&png_ptr, &info_ptr);
SDL_RWclose(file);
return false;
}
// Write header
png_set_IHDR(
png_ptr, info_ptr, dpi->width, dpi->height, 8,
PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT
);
png_byte transparentIndex = 0;
png_set_tRNS(png_ptr, info_ptr, &transparentIndex, 1, NULL);
png_write_info(png_ptr, info_ptr);
// Write pixels
uint8 *bits = dpi->bits;
for (int y = 0; y < dpi->height; y++) {
png_write_row(png_ptr, (png_const_bytep)bits);
bits += stride;
}
// Finish
png_write_end(png_ptr, NULL);
SDL_RWclose(file);
png_free(png_ptr, png_palette);
png_destroy_write_struct(&png_ptr, &info_ptr);
return true;
#else
unsigned int error;
unsigned char* png;
size_t pngSize;
LodePNGState state;
lodepng_state_init(&state);
state.info_raw.colortype = LCT_PALETTE;
// Get image size
int stride = dpi->width + dpi->pitch;
lodepng_palette_add(&state.info_raw, 0, 0, 0, 0);
for (int i = 1; i < 256; i++) {
const rct_palette_entry *entry = &palette->entries[i];
uint8 r = entry->red;
uint8 g = entry->green;
uint8 b = entry->blue;
uint8 a = 255;
lodepng_palette_add(&state.info_raw, r, g, b, a);
}
error = lodepng_encode(&png, &pngSize, dpi->bits, stride, dpi->height, &state);
if (error != 0) {
log_error("Error creating PNG data, %u: %s", error, lodepng_error_text(error));
free(png);
return false;
} else {
SDL_RWops *file = SDL_RWFromFile(path, "wb");
if (file == NULL) {
free(png);
return false;
}
SDL_RWwrite(file, png, pngSize, 1);
SDL_RWclose(file);
}
free(png);
return true;
#endif
}
#ifdef USE_LIBPNG
static void my_png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
SDL_RWops *file = (SDL_RWops*)png_get_io_ptr(png_ptr);
SDL_RWread(file, data, length, 1);
}
static void my_png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
SDL_RWops *file = (SDL_RWops*)png_get_io_ptr(png_ptr);
SDL_RWwrite(file, data, length, 1);
}
static void my_png_flush(png_structp png_ptr)
{
}
#endif
// Bitmap header structs, for cross platform purposes
typedef struct {
uint16 bfType;
uint32 bfSize;
uint16 bfReserved1;
uint16 bfReserved2;
uint32 bfOffBits;
} BitmapFileHeader;
typedef struct {
uint32 biSize;
sint32 biWidth;
sint32 biHeight;
uint16 biPlanes;
uint16 biBitCount;
uint32 biCompression;
uint32 biSizeImage;
sint32 biXPelsPerMeter;
sint32 biYPelsPerMeter;
uint32 biClrUsed;
uint32 biClrImportant;
} BitmapInfoHeader;
/**
*
* rct2: 0x00683D20
*/
bool image_io_bmp_write(const rct_drawpixelinfo *dpi, const rct_palette *palette, const utf8 *path)
{
BitmapFileHeader header;
BitmapInfoHeader info;
int i, y, width, height, stride;
uint8 *buffer, *row;
SDL_RWops *fp;
unsigned int bytesWritten;
// Open binary file for writing
if ((fp = SDL_RWFromFile(path, "wb")) == NULL){
return false;
}
// Allocate buffer
buffer = malloc(0xFFFF);
if (buffer == NULL) {
SDL_RWclose(fp);
return false;
}
// Get image size
width = dpi->width;
height = dpi->height;
stride = dpi->width + dpi->pitch;
// File header
memset(&header, 0, sizeof(header));
header.bfType = 0x4D42;
header.bfSize = height * stride + 1038;
header.bfOffBits = 1038;
bytesWritten = SDL_RWwrite(fp, &header, sizeof(BitmapFileHeader), 1);
if (bytesWritten != 1) {
SDL_RWclose(fp);
SafeFree(buffer);
log_error("failed to save screenshot");
return false;
}
// Info header
memset(&info, 0, sizeof(info));
info.biSize = sizeof(info);
info.biWidth = width;
info.biHeight = height;
info.biPlanes = 1;
info.biBitCount = 8;
info.biXPelsPerMeter = 2520;
info.biYPelsPerMeter = 2520;
info.biClrUsed = 246;
bytesWritten = SDL_RWwrite(fp, &info, sizeof(BitmapInfoHeader), 1);
if (bytesWritten != 1) {
SDL_RWclose(fp);
SafeFree(buffer);
log_error("failed to save screenshot");
return false;
}
// Palette
memset(buffer, 0, 246 * 4);
for (i = 0; i < 246; i++) {
const rct_palette_entry *entry = &palette->entries[i];
buffer[i * 4 + 0] = entry->blue;
buffer[i * 4 + 1] = entry->green;
buffer[i * 4 + 2] = entry->red;
}
bytesWritten = SDL_RWwrite(fp, buffer, sizeof(char), 246 * 4);
if (bytesWritten != 246*4){
SDL_RWclose(fp);
SafeFree(buffer);
log_error("failed to save screenshot");
return false;
}
// Image, save upside down
for (y = dpi->height - 1; y >= 0; y--) {
row = dpi->bits + y * (dpi->width + dpi->pitch);
memset(buffer, 0, stride);
memcpy(buffer, row, dpi->width);
bytesWritten = SDL_RWwrite(fp, buffer, sizeof(char), stride);
if (bytesWritten != stride){
SDL_RWclose(fp);
SafeFree(buffer);
log_error("failed to save screenshot");
return false;
}
}
SDL_RWclose(fp);
free(buffer);
return true;
}

12
src/image_io.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef _IMAGE_IO_H_
#define _IMAGE_IO_H_
#include "common.h"
#include "drawing/drawing.h"
bool image_io_png_read(uint8 **pixels, uint32 *width, uint32 *height, const utf8 *path);
bool image_io_png_write(const rct_drawpixelinfo *dpi, const rct_palette *palette, const utf8 *path);
bool image_io_bmp_write(const rct_drawpixelinfo *dpi, const rct_palette *palette, const utf8 *path);
#endif

View File

@ -93,7 +93,6 @@ static void input_scroll_part_update_vtop(rct_window *w, int widgetIndex, int sc
static void input_scroll_part_update_vbottom(rct_window *w, int widgetIndex, int scroll_id);
static void input_update_tooltip(rct_window *w, int widgetIndex, int x, int y);
static void update_cursor_position();
static void sub_6EA2AA(rct_window *w, int widgetIndex, int x, int y, int edi);
#pragma region Mouse input
@ -1479,11 +1478,9 @@ void game_handle_keyboard_input()
w = window_find_by_class(WC_CHANGE_KEYBOARD_SHORTCUT);
if (w != NULL) {
keyboard_shortcut_set(key);
}
else if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) == 1) {
} else if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) == 1) {
tutorial_stop();
}
else {
} else {
w = window_find_by_class(WC_TEXTINPUT);
if (w != NULL) {
window_text_input_key(w, key);
@ -1493,77 +1490,9 @@ void game_handle_keyboard_input()
}
}
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) == 0)
return;
// Tutorial and the modifier key
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) == 1) {
int eax, ebx, ecx, edx, esi, edi, ebp;
RCT2_CALLFUNC_X(0x0066EEB4, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
eax &= 0xFF;
RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) = eax;
if (RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) & 4) {
window_tooltip_close();
if ((w = window_get_main()) != NULL) {
RCT2_CALLPROC_X(0x006EA2AA, 0, 0, 0, 0, (int)w, RCT2_GLOBAL(0x009DEA72, uint16), 0);
RCT2_GLOBAL(0x009DEA72, uint16)++;
}
}
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) != 0) {
game_handle_keyboard_input_for_tutorial();
}
else {
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) & 4)) {
window_tooltip_close();
if ((w = window_get_main()) != NULL) {
sub_6EA2AA(w, 0, 0, 0, RCT2_GLOBAL(0x009DEA72, uint16));
RCT2_GLOBAL(0x009DEA72, uint16)++;
}
}
// Write tutorial input
RCT2_CALLPROC_X(0x0066EEE1, RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8), 0, 0, 0, 0, 0, 0);
}
}
static void sub_6EA2AA(rct_window *w, int widgetIndex, int x, int y, int edi)
{
RCT2_CALLPROC_X(0x006EA2AA, 0, 0, 0, 0, (int)w, RCT2_GLOBAL(0x009DEA72, uint16), 0);
return;
rct_window *tooltipWindow;
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WINDOW_CLASS, rct_windowclass) = w->classification;
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WINDOW_NUMBER, rct_windownumber) = w->number;
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WIDGET_INDEX, uint16) = widgetIndex;
rct_string_id stringId = window_event_tooltip_call(w, widgetIndex);
if (stringId == (rct_string_id)STR_NONE)
return;
tooltipWindow = window_find_by_class(WC_TOOLTIP);
if (tooltipWindow == NULL)
return;
char *buffer = (char*)RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER;
RCT2_GLOBAL(0x0142006C, uint32) = edi;
format_string(buffer, edi, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS);
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
int width = gfx_get_string_width_new_lined(buffer);
width = min(width, 196);
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
int numLines, fontHeight;
gfx_wrap_string(buffer, width + 1, &numLines, &fontHeight);
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_TEXT_HEIGHT, uint16) = numLines;
tooltipWindow->widgets[0].right = width + 3;
tooltipWindow->widgets[0].bottom = ((numLines + 1) * 10) + 4;
char *tooltipBuffer = (char*)RCT2_ADDRESS_TOOLTIP_TEXT_BUFFER;
memcpy(tooltipBuffer, buffer, 512);
window_tooltip_open(w, widgetIndex, x, y);
}
/**

View File

@ -50,6 +50,7 @@ enum {
void title_handle_keyboard_input();
void game_handle_input();
void game_handle_keyboard_input();
void game_handle_keyboard_input_for_tutorial();
void store_mouse_input(int state);

View File

@ -1045,8 +1045,10 @@ void console_execute_silent(const utf8 *src)
return;
// Aliases for hiding the console
if(strcmp(argv[0],"quit") == 0 || strcmp(argv[0],"exit") == 0)
argv[0]="hide";
if(strcmp(argv[0],"quit") == 0 || strcmp(argv[0],"exit") == 0) {
free(argv[0]);
argv[0] = _strdup("hide");
}
bool validCommand = false;
for (int i = 0; i < countof(console_command_table); i++) {

View File

@ -17,13 +17,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#pragma pack(1)
#include <lodepng/lodepng.h>
#include "../addresses.h"
#include "../config.h"
#include "../drawing/drawing.h"
#include "../game.h"
#include "../image_io.h"
#include "../localisation/localisation.h"
#include "../openrct2.h"
#include "../platform/platform.h"
@ -109,250 +108,44 @@ int screenshot_dump()
}
}
// Bitmap header structs, for cross platform purposes
typedef struct {
uint16 bfType;
uint32 bfSize;
uint16 bfReserved1;
uint16 bfReserved2;
uint32 bfOffBits;
} BitmapFileHeader;
typedef struct {
uint32 biSize;
sint32 biWidth;
sint32 biHeight;
uint16 biPlanes;
uint16 biBitCount;
uint32 biCompression;
uint32 biSizeImage;
sint32 biXPelsPerMeter;
sint32 biYPelsPerMeter;
uint32 biClrUsed;
uint32 biClrImportant;
} BitmapInfoHeader;
/**
*
* rct2: 0x00683D20
*/
int screenshot_dump_bmp()
{
BitmapFileHeader header;
BitmapInfoHeader info;
int i, y, index, width, height, stride;
char path[MAX_PATH];
uint8 *buffer, *row;
SDL_RWops *fp;
unsigned int bytesWritten;
// Get a free screenshot path
if ((index = screenshot_get_next_path(path, SCREENSHOT_FORMAT_BMP)) == -1)
return -1;
// Open binary file for writing
if ((fp = SDL_RWFromFile(path, "wb")) == NULL){
int index;
char path[MAX_PATH] = "";
if ((index = screenshot_get_next_path(path, SCREENSHOT_FORMAT_BMP)) == -1) {
return -1;
}
// Allocate buffer
buffer = malloc(0xFFFF);
if (buffer == NULL) {
SDL_RWclose(fp);
return -1;
}
// Get image size
width = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16);
height = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, uint16);
stride = (width + 3) & 0xFFFFFFFC;
// File header
memset(&header, 0, sizeof(header));
header.bfType = 0x4D42;
header.bfSize = height * stride + 1038;
header.bfOffBits = 1038;
bytesWritten = SDL_RWwrite(fp, &header, sizeof(BitmapFileHeader), 1);
if (bytesWritten != 1) {
SDL_RWclose(fp);
SafeFree(buffer);
log_error("failed to save screenshot");
return -1;
}
// Info header
memset(&info, 0, sizeof(info));
info.biSize = sizeof(info);
info.biWidth = width;
info.biHeight = height;
info.biPlanes = 1;
info.biBitCount = 8;
info.biXPelsPerMeter = 2520;
info.biYPelsPerMeter = 2520;
info.biClrUsed = 246;
bytesWritten = SDL_RWwrite(fp, &info, sizeof(BitmapInfoHeader), 1);
if (bytesWritten != 1) {
SDL_RWclose(fp);
SafeFree(buffer);
log_error("failed to save screenshot");
return -1;
}
// Palette
memset(buffer, 0, 246 * 4);
for (i = 0; i < 246; i++) {
buffer[i * 4 + 0] = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8)[i * 4 + 0];
buffer[i * 4 + 1] = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8)[i * 4 + 1];
buffer[i * 4 + 2] = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8)[i * 4 + 2];
}
bytesWritten = SDL_RWwrite(fp, buffer, sizeof(char), 246 * 4);
if (bytesWritten != 246*4){
SDL_RWclose(fp);
SafeFree(buffer);
log_error("failed to save screenshot");
return -1;
}
// Image, save upside down
rct_drawpixelinfo *dpi = RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo);
for (y = dpi->height - 1; y >= 0; y--) {
row = dpi->bits + y * (dpi->width + dpi->pitch);
memset(buffer, 0, stride);
memcpy(buffer, row, dpi->width);
bytesWritten = SDL_RWwrite(fp, buffer, sizeof(char), stride);
if (bytesWritten != stride){
SDL_RWclose(fp);
SafeFree(buffer);
log_error("failed to save screenshot");
return -1;
}
rct_palette *palette = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, rct_palette);
if (image_io_bmp_write(dpi, palette, path)) {
return index;
} else {
return -1;
}
SDL_RWclose(fp);
free(buffer);
return index;
}
int screenshot_dump_png()
{
rct_drawpixelinfo *dpi = RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo);
int i, index, width, height, padding;
char path[MAX_PATH] = "";
unsigned int error;
unsigned char r, g, b, a = 255;
unsigned char* png;
size_t pngSize;
LodePNGState state;
// Get a free screenshot path
if ((index = screenshot_get_next_path(path, SCREENSHOT_FORMAT_PNG)) == -1)
int index;
char path[MAX_PATH] = "";
if ((index = screenshot_get_next_path(path, SCREENSHOT_FORMAT_PNG)) == -1) {
return -1;
lodepng_state_init(&state);
state.info_raw.colortype = LCT_PALETTE;
// Get image size
width = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16);
height = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, uint16);
padding = dpi->pitch;
for (i = 0; i < 256; i++) {
b = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8)[i * 4 + 0];
g = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8)[i * 4 + 1];
r = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8)[i * 4 + 2];
lodepng_palette_add(&state.info_raw, r, g, b, a);
}
uint8* pixels = dpi->bits;
if (padding > 0) {
pixels = malloc(width * height);
if (!pixels) {
return -1;
}
uint8* src = dpi->bits;
uint8* dst = pixels;
for (int y = height; y > 0; y--) {
for (int x = width; x > 0; x--) {
*dst++ = *src++;
}
src += padding;
}
}
error = lodepng_encode(&png, &pngSize, pixels, width, height, &state);
if (error) {
log_error("Unable to save screenshot, %u: %s", lodepng_error_text(error));
index = -1;
rct_drawpixelinfo *dpi = RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo);
rct_palette *palette = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, rct_palette);
if (image_io_png_write(dpi, palette, path)) {
return index;
} else {
SDL_RWops *file = SDL_RWFromFile(path, "wb");
if (file == NULL) {
log_error("Unable to save screenshot, %s", SDL_GetError());
index = -1;
} else {
SDL_RWwrite(file, png, pngSize, 1);
SDL_RWclose(file);
}
return -1;
}
free(png);
if ((utf8*)pixels != (utf8*)dpi->bits) {
free(pixels);
}
return index;
}
bool screenshot_write_png(rct_drawpixelinfo *dpi, const char *path)
{
unsigned int error;
unsigned char* png;
size_t pngSize;
LodePNGState state;
lodepng_state_init(&state);
state.info_raw.colortype = LCT_PALETTE;
// Get image size
int stride = (dpi->width + 3) & ~3;
for (int i = 0; i < 256; i++) {
unsigned char r, g, b, a = 255;
b = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8)[i * 4 + 0];
g = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8)[i * 4 + 1];
r = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8)[i * 4 + 2];
lodepng_palette_add(&state.info_raw, r, g, b, a);
}
error = lodepng_encode(&png, &pngSize, dpi->bits, stride, dpi->height, &state);
if (error != 0) {
free(png);
return false;
} else {
SDL_RWops *file = SDL_RWFromFile(path, "wb");
if (file == NULL) {
free(png);
return false;
}
SDL_RWwrite(file, png, pngSize, 1);
SDL_RWclose(file);
}
free(png);
return true;
}
void screenshot_giant()
@ -436,7 +229,8 @@ void screenshot_giant()
return;
}
screenshot_write_png(&dpi, path);
rct_palette *palette = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, rct_palette);
image_io_png_write(&dpi, palette, path);
free(dpi.bits);
@ -570,7 +364,8 @@ int cmdline_for_screenshot(const char **argv, int argc)
viewport_render(&dpi, &viewport, 0, 0, viewport.width, viewport.height);
screenshot_write_png(&dpi, outputPath);
rct_palette *palette = RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, rct_palette);
image_io_png_write(&dpi, palette, outputPath);
free(dpi.bits);
}

View File

@ -153,8 +153,6 @@ void window_dispatch_update_all()
//RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_NOT_SHOWN_TICKS, sint16)++;
for (w = RCT2_LAST_WINDOW; w >= g_window_list; w--)
window_event_update_call(w);
RCT2_CALLPROC_EBPSAFE(0x006EE411); // handle_text_input
}
void window_update_all_viewports()
@ -1459,16 +1457,6 @@ void window_zoom_out(rct_window *w)
window_zoom_set(w, w->viewport->zoom + 1);
}
/**
*
* rct2: 0x006EE308
* DEPRECIATED please use the new text_input window.
*/
void window_show_textinput(rct_window *w, int widgetIndex, uint16 title, uint16 text, int value)
{
RCT2_CALLPROC_X(0x006EE308, title, text, value, widgetIndex, (int)w, 0, 0);
}
/**
* Draws a window that is in the specified region.
* rct2: 0x006E756C
@ -1778,7 +1766,7 @@ void tool_cancel()
// Reset map selection
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) = 0;
if (RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WIDGETINDEX, uint16) >= 0) {
if (RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WIDGETINDEX, uint16) != 0xFFFF) {
// Invalidate tool widget
widget_invalidate_by_number(
RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass),
@ -2425,7 +2413,6 @@ void textinput_cancel()
window_close_by_class(WC_TEXTINPUT);
if (RCT2_GLOBAL(RCT2_ADDRESS_TEXTINPUT_WINDOWCLASS, uint8) != 255) {
RCT2_CALLPROC_EBPSAFE(0x006EE4E2);
w = window_find_by_number(
RCT2_GLOBAL(RCT2_ADDRESS_TEXTINPUT_WINDOWCLASS, rct_windowclass),
RCT2_GLOBAL(RCT2_ADDRESS_TEXTINPUT_WINDOWNUMBER, rct_windownumber)

View File

@ -57,7 +57,7 @@ enum {
FORMAT_INLINE_SPRITE = 23,
// Argument format codes
FORMAT_ARGUMENT_CODE_START = 123,
FORMAT_ARGUMENT_CODE_START = 123, // 'z' == 122 or 0x7A
FORMAT_COMMA32 = 123,
FORMAT_INT32,
FORMAT_COMMA2DP32,

View File

@ -750,7 +750,7 @@ void format_string_part_from_raw(utf8 **dest, const utf8 *src, char **args)
}
} else if (code <= 'z') {
*(*dest)++ = code;
} else if (code < 142 || code == FORMAT_COMMA1DP16) {
} else if (code < FORMAT_COLOUR_CODE_START || code == FORMAT_COMMA1DP16) {
format_string_code(code, dest, args);
} else {
*dest = utf8_write_codepoint(*dest, code);

View File

@ -473,6 +473,9 @@ enum {
STR_WATER_RIDES_TIP = 1227,
STR_SHOPS_STALLS_TIP = 1228,
STR_X_PLAYER = 1317,
STR_X_PLAYERS = 1318,
STR_ROTATE_OBJECTS_90 = 1327,
STR_LEVEL_LAND_REQUIRED = 1328,
STR_LAUNCH_SPEED = 1329,

View File

@ -557,13 +557,13 @@ static void sub_68F41A(rct_peep *peep, int index)
switch (chosen_thought){
case PEEP_THOUGHT_TYPE_HUNGRY:
peep_head_for_nearest_ride_with_flags(peep, 0x00800000);
peep_head_for_nearest_ride_with_flags(peep, RIDE_TYPE_FLAG_SELLS_FOOD);
break;
case PEEP_THOUGHT_TYPE_THIRSTY:
peep_head_for_nearest_ride_with_flags(peep, 0x01000000);
peep_head_for_nearest_ride_with_flags(peep, RIDE_TYPE_FLAG_SELLS_DRINKS);
break;
case PEEP_THOUGHT_TYPE_BATHROOM:
peep_head_for_nearest_ride_with_flags(peep, 0x00200000);
peep_head_for_nearest_ride_with_flags(peep, RIDE_TYPE_FLAG_IS_BATHROOM);
break;
case PEEP_THOUGHT_RUNNING_OUT:
peep_head_for_nearest_ride_type(peep, RIDE_TYPE_CASH_MACHINE);
@ -1912,7 +1912,7 @@ void peep_update_ride_sub_state_1(rct_peep* peep){
peep->destination_y = y;
peep->destination_tolerence = 3;
ride->var_120++;
ride->cur_num_customers++;
peep_on_enter_or_exit_ride(peep, peep->current_ride, 0);
peep->sub_state = 17;
return;
@ -1939,7 +1939,7 @@ void peep_update_ride_sub_state_1(rct_peep* peep){
peep->destination_y = y;
peep->current_car = 0;
ride->var_120++;
ride->cur_num_customers++;
peep_on_enter_or_exit_ride(peep, peep->current_ride, 0);
peep->sub_state = 14;
return;
@ -2297,7 +2297,7 @@ static void peep_update_ride_sub_state_5(rct_peep* peep){
return;
vehicle->num_peeps++;
ride->var_120++;
ride->cur_num_customers++;
vehicle->friction += seated_peep->var_41;
invalidate_sprite_2((rct_sprite*)seated_peep);
@ -2312,7 +2312,7 @@ static void peep_update_ride_sub_state_5(rct_peep* peep){
}
vehicle->num_peeps++;
ride->var_120++;
ride->cur_num_customers++;
vehicle->friction += peep->var_41;
invalidate_sprite_2((rct_sprite*)vehicle);
@ -6767,13 +6767,13 @@ static int peep_interact_with_shop(rct_peep* peep, sint16 x, sint16 y, rct_map_e
peep_window_state_update(peep);
peep->time_on_ride = 0;
ride->var_120++;
ride->cur_num_customers++;
if (peep->flags & PEEP_FLAGS_TRACKING){
RCT2_GLOBAL(0x0013CE952, rct_string_id) = peep->name_string_idx;
RCT2_GLOBAL(0x0013CE954, uint32) = peep->id;
RCT2_GLOBAL(0x0013CE958, rct_string_id) = ride->name;
RCT2_GLOBAL(0x0013CE95A, uint32) = ride->name_arguments;
rct_string_id string_id = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE) ? 1933 : 1932;
rct_string_id string_id = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE) ? STR_PEEP_TRACKING_PEEP_IS_IN_X : STR_PEEP_TRACKING_PEEP_IS_ON_X;
if (gConfigNotifications.guest_used_facility) {
news_item_add_to_queue(NEWS_ITEM_PEEP_ON_RIDE, string_id, peep->sprite_index);
}
@ -8358,7 +8358,7 @@ loc_69B221:
ride->total_profit += (price - get_shop_item_cost(shopItem));
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
ride->var_120++;
ride->cur_num_customers++;
ride->total_customers++;
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER;
@ -8379,7 +8379,7 @@ static bool peep_should_use_cash_machine(rct_peep *peep, int rideIndex)
rct_ride *ride = GET_RIDE(rideIndex);
ride_update_satisfaction(ride, peep->happiness >> 6);
ride->var_120++;
ride->cur_num_customers++;
ride->total_customers++;
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER;
return true;
@ -9053,12 +9053,12 @@ static void peep_head_for_nearest_ride_with_flags(rct_peep *peep, int rideTypeFl
if (peep->x == (sint16)0x8000) return;
if (peep->guest_heading_to_ride_id != 255) {
ride = GET_RIDE(peep->guest_heading_to_ride_id);
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & 0x03800000) {
if (RCT2_ADDRESS(RCT2_ADDRESS_RIDE_FLAGS, uint32)[ride->type * 2] & (RIDE_TYPE_FLAG_IS_BATHROOM | RIDE_TYPE_FLAG_SELLS_DRINKS | RIDE_TYPE_FLAG_SELLS_FOOD)) {
return;
}
}
if ((rideTypeFlags & 0x002000000) && peep_has_food(peep)) {
if ((rideTypeFlags & RIDE_TYPE_FLAG_IS_BATHROOM) && peep_has_food(peep)) {
return;
}

View File

@ -57,8 +57,8 @@ void platform_get_exe_path(utf8 *outPath)
}
int exeDelimiterIndex = (int)(exeDelimiter - exePath);
exePath[exeDelimiterIndex] = '\0';
safe_strncpy(outPath, exePath, exeDelimiterIndex + 1);
outPath[exeDelimiterIndex] = '\0';
}
bool platform_check_steam_overlay_attached() {

View File

@ -50,10 +50,6 @@ utf8 _openrctDataDirectoryPath[MAX_PATH] = { 0 };
*/
int main(int argc, const char **argv)
{
//RCT2_GLOBAL(RCT2_ADDRESS_HINSTANCE, HINSTANCE) = hInstance;
//RCT2_GLOBAL(RCT2_ADDRESS_CMDLINE, LPSTR) = lpCmdLine;
STUB();
int run_game = cmdline_run(argv, argc);
if (run_game == 1)
{
@ -372,7 +368,7 @@ int platform_enumerate_directories_begin(const utf8 *directory)
char *npattern = malloc(length+1);
int converted;
converted = wcstombs(npattern, wpattern, length);
npattern[length] = '\0';
npattern[length - 1] = '\0';
if (converted == MAX_PATH) {
log_warning("truncated string %s", npattern);
}

View File

@ -58,6 +58,11 @@ utf8 **windows_get_command_line_args(int *outNumArgs);
// return 0;
// }
/* DllMain is already defined in one of static libraries we implicitly depend
* on (libcrypto), which is their bug really, but since we don't do anything in
* here, just comment it out.
*/
#ifndef __MINGW32__
/**
* Entry point for when the DLL is loaded. This will be removed when OpenRCT2 can be built as a stand alone application.
*/
@ -65,6 +70,7 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
{
return TRUE;
}
#endif // __MINGW32__
/**
* The function that is called directly from the host application (rct2.exe)'s WinMain. This will be removed when OpenRCT2 can
@ -900,7 +906,7 @@ void platform_get_exe_path(utf8 *outPath)
bool platform_get_font_path(TTFFontDescriptor *font, utf8 *buffer)
{
#ifndef __MINGW32__
#if !defined(__MINGW32__) && ((NTDDI_VERSION >= NTDDI_VISTA) && !defined(_USING_V110_SDK71_) && !defined(_ATL_XP_TARGETING))
wchar_t *fontFolder;
if (SUCCEEDED(SHGetKnownFolderPath(&FOLDERID_Fonts, 0, NULL, &fontFolder)))
{
@ -922,7 +928,7 @@ bool platform_get_font_path(TTFFontDescriptor *font, utf8 *buffer)
return false;
}
#else
log_warning("MINGW-compatibility hack: falling back to C:\\Windows\\Fonts");
log_warning("Compatibility hack: falling back to C:\\Windows\\Fonts");
strcat(buffer, "C:\\Windows\\Fonts\\");
strcat(buffer, font->filename);
return true;

View File

@ -276,22 +276,11 @@ money16 get_shop_hot_value(int shopItem)
money32 ride_calculate_income_per_hour(rct_ride *ride)
{
rct_ride_type *entry;
money32 incomePerHour, priceMinusCost;
money32 customersPerHour, priceMinusCost;
int currentShopItem;
entry = GET_RIDE_ENTRY(ride->subtype);
incomePerHour =
ride->var_124 +
ride->var_126 +
ride->var_128 +
ride->var_12A +
ride->var_12C +
ride->var_12E +
ride->age +
ride->running_cost +
ride->var_134 +
ride->var_136;
incomePerHour *= 12;
customersPerHour = ride_customers_per_hour(ride);
priceMinusCost = ride->price;
currentShopItem = entry->shop_item;
@ -311,8 +300,7 @@ money32 ride_calculate_income_per_hour(rct_ride *ride)
priceMinusCost /= 2;
}
incomePerHour *= priceMinusCost;
return incomePerHour;
return customersPerHour * priceMinusCost;
}
/**
@ -1845,21 +1833,17 @@ static void ride_update(int rideIndex)
ride_update_station(ride, i);
// Update financial statistics
ride->var_122++;
if (ride->var_122 >= 960) {
ride->var_122 = 0;
ride->num_customers_timeout++;
ride->var_136 = ride->var_134;
ride->var_134 = ride->running_cost;
ride->running_cost = ride->age;
ride->age = ride->var_12E;
ride->var_12E = ride->var_12C;
ride->var_12C = ride->var_12A;
ride->var_12A = ride->var_128;
ride->var_128 = ride->var_126;
ride->var_126 = ride->var_124;
ride->var_124 = ride->var_120;
ride->var_120 = 0;
if (ride->num_customers_timeout >= 960) {
// This is meant to update about every 30 seconds
ride->num_customers_timeout = 0;
// Shift number of customers history, start of the array is the most recent one
memmove(ride->num_customers + 1, ride->num_customers, 9 * sizeof(*(ride->num_customers)));
ride->num_customers[0] = ride->cur_num_customers;
ride->cur_num_customers = 0;
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER;
ride->income_per_hour = ride_calculate_income_per_hour(ride);
@ -5396,8 +5380,8 @@ foundRideEntry:
ride->measurement_index = 255;
ride->excitement = (ride_rating)-1;
ride->var_120 = 0;
ride->var_122 = 0;
ride->cur_num_customers = 0;
ride->num_customers_timeout = 0;
ride->var_148 = 0;
ride->price = 0;
@ -5449,19 +5433,7 @@ foundRideEntry:
}
}
// The next 10 variables are treated like an array of 10 items
ride->var_124 = 0;
ride->var_124 = 0;
ride->var_126 = 0;
ride->var_128 = 0;
ride->var_12A = 0;
ride->var_12C = 0;
ride->var_12E = 0;
ride->age = 0;
ride->running_cost = 0;
ride->var_134 = 0;
ride->var_136 = 0;
memset(ride->num_customers, 0, sizeof(ride->num_customers));
ride->value = 0xFFFF;
ride->satisfaction = 255;
ride->satisfaction_time_out = 0;
@ -7513,3 +7485,23 @@ const uint8* ride_seek_available_modes(rct_ride *ride)
return availableModes;
}
// Gets the approximate value of customers per hour for this ride. Multiplies ride_customers_in_last_5_minutes() by 12.
const uint32 ride_customers_per_hour(const rct_ride *ride) {
return ride_customers_in_last_5_minutes(ride) * 12;
}
// Calculates the number of customers for this ride in the last 5 minutes (or more correctly 9600 game ticks)
const uint32 ride_customers_in_last_5_minutes(const rct_ride *ride) {
uint32 sum = ride->num_customers[0]
+ ride->num_customers[1]
+ ride->num_customers[2]
+ ride->num_customers[3]
+ ride->num_customers[4]
+ ride->num_customers[5]
+ ride->num_customers[6]
+ ride->num_customers[7]
+ ride->num_customers[8]
+ ride->num_customers[9];
return sum;
}

View File

@ -218,18 +218,12 @@ typedef struct {
uint8 num_sheltered_sections; // 0x11E (?abY YYYY)
// z related to var_10C
uint8 var_11F;
sint16 var_120;
sint16 var_122;
sint16 var_124;
sint16 var_126;
sint16 var_128;
sint16 var_12A;
sint16 var_12C;
sint16 var_12E;
uint16 age; // 0x130
sint16 running_cost; // 0x132
sint16 var_134;
sint16 var_136;
// Customer counter in the current 960 game tick (about 30 seconds) interval
uint16 cur_num_customers; // 0x120
// Counts ticks to update customer intervals, resets each 960 game ticks.
uint16 num_customers_timeout; // 0x122
// Customer count in the last 10 * 960 game ticks (sliding window)
uint16 num_customers[10]; // 0x124
money16 price; // 0x138
sint16 var_13A;
sint16 var_13C;
@ -1055,4 +1049,7 @@ const uint8* ride_seek_available_modes(rct_ride *ride);
void window_ride_construction_mouseup_demolish_next_piece(int x, int y, int z, int direction, int type);
const uint32 ride_customers_per_hour(const rct_ride *ride);
const uint32 ride_customers_in_last_5_minutes(const rct_ride *ride);
#endif

View File

@ -586,6 +586,100 @@ const uint8 rideUnknownData3[0x60] = {
10, // 59 LIM Launched Roller Coaster
};
// Data at 0x0097D21E
const uint8 rideBonusValue[0x60] = {
85, // 00 Spiral Roller coaster
90, // 01 Stand Up Coaster
90, // 02 Suspended Swinging
100, // 03 Inverted
60, // 04 Steel Mini Coaster
50, // 05 Mini Railroad
60, // 06 Monorail
50, // 07 Mini Suspended Coaster
40, // 08 Boat Ride
55, // 09 Wooden Wild Mine/Mouse
60, // 0a Steeplechase/Motorbike/Soap
50, // 0b Car Ride
65, // 0c Launched Freefall
75, // 0d Bobsleigh Coaster
45, // 0e Observation Tower
95, // 0f Looping Roller Coaster
55, // 10 Dinghy Slide
85, // 11 Mine Train Coaster
55, // 12 Chairlift
100, // 13 Corkscrew Roller Coaster
40, // 14 Maze
40, // 15 Spiral Slide
55, // 16 Go Karts
65, // 17 Log Flume
70, // 18 River Rapids
35, // 19 Bumper Cars
35, // 1a Pirate Ship
35, // 1b Swinging Inverter Ship
15, // 1c Food Stall
15, // 1d (none)
15, // 1e Drink Stall
15, // 1f (none)
15, // 20 Shop (all types)
45, // 21 Merry Go Round
15, // 22 Balloon Stall (maybe)
15, // 23 Information Kiosk
5, // 24 Bathroom
45, // 25 Ferris Wheel
45, // 26 Motion Simulator
45, // 27 3D Cinema
55, // 28 Topspin
30, // 29 Space Rings
70, // 2a Reverse Freefall Coaster
45, // 2b Elevator
95, // 2c Vertical Drop Roller Coaster
5, // 2d ATM
40, // 2e Twist
22, // 2f Haunted House
5, // 30 First Aid
39, // 31 Circus Show
50, // 32 Ghost Train
120, // 33 Twister Roller Coaster
105, // 34 Wooden Roller Coaster
65, // 35 Side-Friction Roller Coaster
55, // 36 Wild Mouse
100, // 37 Multi Dimension Coaster
100, // 38 (none)
100, // 39 Flying Roller Coaster
100, // 3a (none)
50, // 3b Virginia Reel
65, // 3c Splash Boats
45, // 3d Mini Helicopters
100, // 3e Lay-down Roller Coaster
60, // 3f Suspended Monorail
100, // 40 (none)
65, // 41 Reverser Roller Coaster
35, // 42 Heartline Twister Roller Coaster
23, // 43 Mini Golf
120, // 44 Giga Coaster
45, // 45 Roto-Drop
35, // 46 Flying Saucers
22, // 47 Crooked House
45, // 48 Monorail Cycles
80, // 49 Compact Inverted Coaster
60, // 4a Water Coaster
70, // 4b Air Powered Vertical Coaster
55, // 4c Inverted Hairpin Coaster
35, // 4d Magic Carpet
40, // 4e Submarine Ride
65, // 4f River Rafts
15, // 50 (none)
45, // 51 Enterprise
15, // 52 (none)
15, // 53 (none)
15, // 54 (none)
100, // 55 (none)
75, // 56 Inverted Impulse Coaster
60, // 57 Mini Roller Coaster
70, // 58 Mine Ride
55, // 59 LIM Launched Roller Coaster
};
const rct_ride_name_convention RideNameConvention[96] = {
{ 1229, 1243, 1257, 0 }, // 00 Spiral Roller coaster
{ 1229, 1243, 1257, 0 }, // 01 Stand Up Coaster

View File

@ -86,6 +86,7 @@ extern const uint8 costPerTrackPiece[0x60];
extern const uint8 rideUnknownData1[0x60];
extern const bool rideUnknownData2[0x60];
extern const uint8 rideUnknownData3[0x60];
extern const uint8 rideBonusValue[0x60];
extern const rct_ride_name_convention RideNameConvention[96];
extern const uint8 RideAvailableModes[];

View File

@ -3076,8 +3076,6 @@ int save_track_design(uint8 rideIndex){
char path[MAX_PATH];
substitute_path(path, RCT2_ADDRESS(RCT2_ADDRESS_TRACKS_PATH, char), track_name);
strcat(path, ".TD6");
// Save track design
format_string(RCT2_ADDRESS(0x141ED68, char), 2306, NULL);
@ -3184,6 +3182,7 @@ void window_track_list_format_name(utf8 *dst, const utf8 *src, int colour, bool
{
const utf8 *ch;
int codepoint;
char *lastDot = strrchr(src, '.');
if (colour != 0) {
dst = utf8_write_codepoint(dst, colour);
@ -3192,8 +3191,8 @@ void window_track_list_format_name(utf8 *dst, const utf8 *src, int colour, bool
if (quotes) dst = utf8_write_codepoint(dst, FORMAT_OPENQUOTES);
ch = src;
while ((codepoint = utf8_get_next(ch, &ch)) != 0) {
if (codepoint == '.') break;
while (lastDot > ch) {
codepoint = utf8_get_next(ch, &ch);
dst = utf8_write_codepoint(dst, codepoint);
}

View File

@ -19,9 +19,13 @@
*****************************************************************************/
#include "addresses.h"
#include "interface/window.h"
#include "localisation/localisation.h"
#include "tutorial.h"
#include "windows/error.h"
#include "windows/tooltip.h"
static void sub_6EA2AA(rct_window *w, int widgetIndex, int x, int y, int edi);
/**
*
@ -39,5 +43,90 @@ void tutorial_start(int type)
*/
void tutorial_stop()
{
RCT2_CALLPROC_EBPSAFE(0x0066EE25);
// RCT2_CALLPROC_EBPSAFE(0x0066EE25);
}
void game_handle_keyboard_input_for_tutorial()
{
#ifdef ENABLE_TUTORIAL
rct_window *w;
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) == 1) {
int eax, ebx, ecx, edx, esi, edi, ebp;
RCT2_CALLFUNC_X(0x0066EEB4, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
eax &= 0xFF;
RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) = eax;
if (RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) & 4) {
window_tooltip_close();
if ((w = window_get_main()) != NULL) {
RCT2_CALLPROC_X(0x006EA2AA, 0, 0, 0, 0, (int)w, RCT2_GLOBAL(0x009DEA72, uint16), 0);
RCT2_GLOBAL(0x009DEA72, uint16)++;
}
}
} else {
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) & 4)) {
window_tooltip_close();
if ((w = window_get_main()) != NULL) {
sub_6EA2AA(w, 0, 0, 0, RCT2_GLOBAL(0x009DEA72, uint16));
RCT2_GLOBAL(0x009DEA72, uint16)++;
}
}
// Write tutorial input
RCT2_CALLPROC_X(0x0066EEE1, RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8), 0, 0, 0, 0, 0, 0);
}
#endif
}
static void sub_6EA2AA(rct_window *w, int widgetIndex, int x, int y, int edi)
{
#ifdef ENABLE_TUTORIAL
RCT2_CALLPROC_X(0x006EA2AA, 0, 0, 0, 0, (int)w, RCT2_GLOBAL(0x009DEA72, uint16), 0);
return;
rct_window *tooltipWindow;
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WINDOW_CLASS, rct_windowclass) = w->classification;
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WINDOW_NUMBER, rct_windownumber) = w->number;
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WIDGET_INDEX, uint16) = widgetIndex;
rct_string_id stringId = window_event_tooltip_call(w, widgetIndex);
if (stringId == (rct_string_id)STR_NONE)
return;
tooltipWindow = window_find_by_class(WC_TOOLTIP);
if (tooltipWindow == NULL)
return;
char *buffer = (char*)RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER;
RCT2_GLOBAL(0x0142006C, uint32) = edi;
format_string(buffer, edi, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS);
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
int width = gfx_get_string_width_new_lined(buffer);
width = min(width, 196);
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
int numLines, fontHeight;
gfx_wrap_string(buffer, width + 1, &numLines, &fontHeight);
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_TEXT_HEIGHT, uint16) = numLines;
tooltipWindow->widgets[0].right = width + 3;
tooltipWindow->widgets[0].bottom = ((numLines + 1) * 10) + 4;
char *tooltipBuffer = (char*)RCT2_ADDRESS_TOOLTIP_TEXT_BUFFER;
memcpy(tooltipBuffer, buffer, 512);
window_tooltip_open(w, widgetIndex, x, y);
#endif
}
/**
*
* rct2: 0x0066EE54
*/
void sub_66EE54()
{
// RCT2_CALLPROC_EBPSAFE(0x0066EE54);
}

View File

@ -23,5 +23,6 @@
void tutorial_start(int type);
void tutorial_stop();
void sub_66EE54();
#endif

View File

@ -61,62 +61,55 @@ bool filename_valid_characters(const utf8 *filename)
const char *path_get_filename(const utf8 *path)
{
const char *result, *ch;
// Find last slash or backslash in the path
char *filename = strrchr(path, platform_get_path_separator());
result = path;
for (ch = path; *ch != 0; ch++) {
if (*ch == '/' || *ch == '\\') {
if (*(ch + 1) != 0)
result = ch + 1;
}
// Checks if the path is valid (e.g. not just a file name)
if (filename == NULL)
{
log_warning("Invalid path given: %s", path);
// Return the input string to keep things working
return path;
}
return result;
// Increase pointer by one, to get rid of the slashes
filename++;
return filename;
}
const char *path_get_extension(const utf8 *path)
{
const char *extension = NULL;
const char *ch = path;
while (*ch != 0) {
if (*ch == '.')
extension = ch;
// Get the filename from the path
const char *filename = path_get_filename(path);
ch++;
}
// Try to find the most-right dot in the filename
char *extension = strrchr(filename, '.');
// When no dot was found, return a pointer to the null-terminator
if (extension == NULL)
extension = ch;
extension = strrchr(filename, '\0');
return extension;
}
void path_set_extension(utf8 *path, const utf8 *newExtension)
{
char *extension = NULL;
char *ch = path;
while (*ch != 0) {
if (*ch == '.')
extension = ch;
ch++;
}
if (extension == NULL)
extension = ch;
// Append a dot to the filename if the new extension doesn't start with it
char *endOfString = strrchr(path, '\0');
if (newExtension[0] != '.')
*extension++ = '.';
*endOfString++ = '.';
strcpy(extension, newExtension);
// Append the extension to the path
// No existing extensions should be removed ("ride.TD6" -> "ride.TD6.TD6")
safe_strncpy(endOfString, newExtension, MAX_PATH - (endOfString - path) - 1);
}
void path_remove_extension(utf8 *path)
{
char *ch = path + strlen(path);
for (--ch; ch >= path; --ch) {
if (*ch == '.') {
*ch = '\0';
break;
}
}
// Find last dot in filename, and replace it with a null-terminator
char *lastDot = strrchr(path, '.');
if (*lastDot) *lastDot = '\0';
}
bool readentirefile(const utf8 *path, void **outBuffer, int *outLength)
@ -212,7 +205,7 @@ char *safe_strncpy(char * destination, const char * source, size_t size)
if (!terminated)
{
result[size - 1] = '\0';
log_warning("Truncating string %s to %d bytes.", destination, size);
log_warning("Truncating string \"%s\" to %d bytes.", result, size);
}
return result;
}

View File

@ -543,15 +543,23 @@ static void window_editor_scenario_options_financial_mousedown(int widgetIndex,
break;
case WIDX_INTEREST_RATE_INCREASE:
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32) < 80) {
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32)++;
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32) < 0) {
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32) = 0;
} else {
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32)++;
}
} else {
window_error_open(3254, STR_NONE);
}
window_invalidate(w);
break;
case WIDX_INTEREST_RATE_DECREASE:
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32) >= 0) {
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32)--;
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32) > 0) {
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32) > 80) {
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32) = 80;
} else {
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32)--;
}
} else {
window_error_open(3255, STR_NONE);
}
@ -676,7 +684,9 @@ static void window_editor_scenario_options_financial_paint(rct_window *w, rct_dr
x = w->x + w->widgets[WIDX_INTEREST_RATE].left + 1;
y = w->y + w->widgets[WIDX_INTEREST_RATE].top;
gfx_draw_string_left(dpi, 3247, &RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32), 0, x, y);
money16 interestRate = (money16)clamp(INT16_MIN, RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, money32), INT16_MAX);
gfx_draw_string_left(dpi, 3247, &interestRate, 0, x, y);
}
}

View File

@ -603,7 +603,7 @@ static void window_guest_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
i = (_window_guest_list_selected_tab == 1 ? w->list_information_type / 4 : 0);
gfx_draw_sprite(
dpi,
5568 + i,
SPR_TAB_GUESTS_0 + i,
window_guest_list_widgets[WIDX_TAB_2].left + w->x,
window_guest_list_widgets[WIDX_TAB_2].top + w->y, 0
);

View File

@ -137,9 +137,7 @@ void window_install_track_open(const char* path)
strncpy(track_path, path, MAX_PATH);
track_path[MAX_PATH - 1] = '\0';
char* track_name_pointer = track_path;
while (*track_name_pointer++ != '\0');
while (*--track_name_pointer != '\\');
char* track_name_pointer = strrchr(track_path, platform_get_path_separator());
track_name_pointer++;
strncpy(track_dest_name, track_name_pointer, MAX_PATH);

View File

@ -159,7 +159,7 @@ rct_window *window_loadsave_open(int type, char *defaultName)
_defaultName[0] = 0;
if (!str_is_null_or_empty(defaultName)) {
safe_strncpy(_defaultName, path_get_filename(defaultName), sizeof(_defaultName));
safe_strncpy(_defaultName, defaultName, sizeof(_defaultName));
path_remove_extension(_defaultName);
}
@ -277,7 +277,7 @@ static void window_loadsave_close(rct_window *w)
static void window_loadsave_mouseup(rct_window *w, int widgetIndex)
{
int result;
char filename[MAX_PATH], filter[MAX_PATH];
char path[MAX_PATH], filter[MAX_PATH];
switch (widgetIndex){
case WIDX_CLOSE:
@ -305,9 +305,9 @@ static void window_loadsave_mouseup(rct_window *w, int widgetIndex)
break;
}
case WIDX_BROWSE:
safe_strncpy(filename, _directory, MAX_PATH);
safe_strncpy(path, _directory, MAX_PATH);
if (_type & LOADSAVETYPE_SAVE)
strcat(filename, (char*)RCT2_ADDRESS_SCENARIO_NAME);
strcat(path, (char*)RCT2_ADDRESS_SCENARIO_NAME);
memset(filter, '\0', MAX_PATH);
safe_strncpy(filter, "*", MAX_PATH);
@ -315,30 +315,30 @@ static void window_loadsave_mouseup(rct_window *w, int widgetIndex)
switch (_type) {
case (LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME) :
result = platform_open_common_file_dialog(1, (char*)language_get_string(STR_LOAD_GAME), filename, filter, _extension);
result = platform_open_common_file_dialog(1, (char*)language_get_string(STR_LOAD_GAME), path, filter, _extension);
break;
case (LOADSAVETYPE_SAVE | LOADSAVETYPE_GAME) :
result = platform_open_common_file_dialog(0, (char*)language_get_string(STR_SAVE_GAME), filename, filter, _extension);
result = platform_open_common_file_dialog(0, (char*)language_get_string(STR_SAVE_GAME), path, filter, _extension);
break;
case (LOADSAVETYPE_LOAD | LOADSAVETYPE_LANDSCAPE) :
result = platform_open_common_file_dialog(1, (char*)language_get_string(STR_LOAD_LANDSCAPE), filename, filter, _extension);
result = platform_open_common_file_dialog(1, (char*)language_get_string(STR_LOAD_LANDSCAPE), path, filter, _extension);
break;
case (LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE) :
result = platform_open_common_file_dialog(0, (char*)language_get_string(STR_SAVE_LANDSCAPE), filename, filter, _extension);
result = platform_open_common_file_dialog(0, (char*)language_get_string(STR_SAVE_LANDSCAPE), path, filter, _extension);
break;
case (LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO) :
result = platform_open_common_file_dialog(0, (char*)language_get_string(STR_SAVE_SCENARIO), filename, filter, _extension);
result = platform_open_common_file_dialog(0, (char*)language_get_string(STR_SAVE_SCENARIO), path, filter, _extension);
break;
case (LOADSAVETYPE_LOAD | LOADSAVETYPE_TRACK) :
result = platform_open_common_file_dialog(1, (char*)language_get_string(1039), filename, filter, _extension);
result = platform_open_common_file_dialog(1, (char*)language_get_string(1039), path, filter, _extension);
break;
}
if (result) {
if (!has_extension(filename, _extension)) {
strncat(filename, _extension, MAX_PATH);
if (!has_extension(path, _extension)) {
strncat(path, _extension, MAX_PATH);
}
window_loadsave_select(w, filename);
window_loadsave_select(w, path);
}
break;
case WIDX_SORT_NAME:
@ -573,15 +573,6 @@ static void window_loadsave_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, i
}
}
static int compare_string_case_insensitive(char const *a, char const *b)
{
for (;; a++, b++) {
int d = tolower(*a) - tolower(*b);
if (d != 0 || !*a)
return d;
}
}
static int list_item_sort(const void *a, const void *b)
{
const loadsave_list_item *itemA = (loadsave_list_item*)a;
@ -592,15 +583,15 @@ static int list_item_sort(const void *a, const void *b)
switch (gConfigGeneral.load_save_sort){
case SORT_NAME_ASCENDING:
return compare_string_case_insensitive(itemA->name, itemB->name);
return strcicmp(itemA->name, itemB->name);
case SORT_NAME_DESCENDING:
return -compare_string_case_insensitive(itemA->name, itemB->name);
return -strcicmp(itemA->name, itemB->name);
case SORT_DATE_DESCENDING:
return (int) -difftime(itemA->date_modified, itemB->date_modified);
case SORT_DATE_ASCENDING:
return (int) difftime(itemA->date_modified, itemB->date_modified);
default:
return compare_string_case_insensitive(itemA->name, itemB->name);
return strcicmp(itemA->name, itemB->name);
}
}
@ -745,7 +736,7 @@ static void window_loadsave_select(rct_window *w, const char *path)
case (LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME) :
if (gLoadSaveTitleSequenceSave) {
utf8 newName[MAX_PATH];
char *extension = (char*)path_get_extension(path_get_filename(path));
char *extension = (char*)path_get_extension(path);
safe_strncpy(newName, path_get_filename(path), MAX_PATH);
if (_stricmp(extension, ".sv6") != 0 && _stricmp(extension, ".sc6") != 0)
strcat(newName, ".sv6");

View File

@ -1547,11 +1547,10 @@ static uint16 map_window_get_pixel_colour_peep(int x, int y)
if (!(mapElement->properties.surface.ownership & OWNERSHIP_OWNED))
colour = 10 | (colour & 0xFF00);
const size_t count = countof(ElementTypeAddColour);
const int maxSupportedMapElementType = (int)countof(ElementTypeAddColour);
while (!map_element_is_last_for_tile(mapElement++)) {
int mapElementType = map_element_get_type(mapElement) >> 2;
if (mapElementType >= count)
{
if (mapElementType >= maxSupportedMapElementType) {
mapElementType = MAP_ELEMENT_TYPE_CORRUPT >> 2;
}
colour &= ElementTypeMaskColour[mapElementType];

View File

@ -391,7 +391,7 @@ static uint32 window_mapgen_page_hold_down_widgets[] = {
#pragma endregion
const int window_mapgen_tab_animation_loops[] = { 16, 16 };
const int window_mapgen_tab_animation_loops[] = { 16, 16, 16 };
#define MINIMUM_MAP_SIZE_TECHNICAL 15
#define MAXIMUM_MAP_SIZE_TECHNICAL 256
@ -429,7 +429,7 @@ static int _placeTrees = 1;
static int _simplex_low = 6;
static int _simplex_high = 10;
static sint16 _simplex_base_freq = 60;
static sint32 _simplex_base_freq = 60;
static int _simplex_octaves = 4;
rct_window *window_mapgen_open()

View File

@ -2,6 +2,7 @@
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../sprites.h"
enum {
NOTIFICATION_CATEGORY_PARK,
@ -105,6 +106,7 @@ static rct_window_event_list window_news_options_events = {
NULL
};
static void window_news_options_set_page(rct_window *w, int page);
static void window_news_options_draw_tab_images(rct_window *w, rct_drawpixelinfo *dpi);
static bool *get_notification_value_ptr(const notification_def *ndef);
@ -144,9 +146,7 @@ static void window_news_options_mouseup(rct_window *w, int widgetIndex)
case WIDX_TAB_PARK:
case WIDX_TAB_RIDE:
case WIDX_TAB_GUEST:
w->page = widgetIndex - WIDX_TAB_PARK;
w->frame_no = 0;
window_invalidate(w);
window_news_options_set_page(w, widgetIndex - WIDX_TAB_PARK);
break;
default:
{
@ -245,6 +245,15 @@ static void window_news_options_paint(rct_window *w, rct_drawpixelinfo *dpi)
window_news_options_draw_tab_images(w, dpi);
}
static void window_news_options_set_page(rct_window *w, int page)
{
if (w->page != page) {
w->page = page;
w->frame_no = 0;
window_invalidate(w);
}
}
const int window_news_option_tab_animation_divisor[] = { 1, 4, 4 };
const int window_news_option_tab_animation_frames[] = { 1, 16, 8 };
@ -267,9 +276,9 @@ static void window_news_options_draw_tab_image(rct_window *w, rct_drawpixelinfo
static void window_news_options_draw_tab_images(rct_window *w, rct_drawpixelinfo *dpi)
{
window_news_options_draw_tab_image(w, dpi, NOTIFICATION_CATEGORY_PARK, 5466);
window_news_options_draw_tab_image(w, dpi, NOTIFICATION_CATEGORY_RIDE, 5442);
window_news_options_draw_tab_image(w, dpi, NOTIFICATION_CATEGORY_GUEST, 5568);
window_news_options_draw_tab_image(w, dpi, NOTIFICATION_CATEGORY_PARK, SPR_TAB_PARK);
window_news_options_draw_tab_image(w, dpi, NOTIFICATION_CATEGORY_RIDE, SPR_TAB_RIDE_0);
window_news_options_draw_tab_image(w, dpi, NOTIFICATION_CATEGORY_GUEST, SPR_TAB_GUESTS_0);
}
static bool *get_notification_value_ptr(const notification_def *ndef)

View File

@ -93,7 +93,11 @@ enum {
DDIDX_KICK
};
const int window_player_list_animation_divisor[] = { 4 };
const int window_player_list_animation_frames[] = { 8 };
static void window_player_list_refresh_list(rct_window *w);
static void window_player_list_draw_tab_images(rct_window *w, rct_drawpixelinfo *dpi);
static int _dropdownPlayerId;
@ -175,6 +179,7 @@ static void window_player_list_dropdown(rct_window *w, int widgetIndex, int drop
static void window_player_list_update(rct_window *w)
{
w->frame_no++;
widget_invalidate(w, WIDX_TAB1 + w->page);
}
@ -258,11 +263,21 @@ static void window_player_list_invalidate(rct_window *w)
static void window_player_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
window_draw_widgets(w, dpi);
gfx_draw_string_left(dpi, STR_PLAYER, w, w->colours[2], w->x + 6, 58 - 12 + w->y + 1);
gfx_draw_string_left(dpi, STR_PING, w, w->colours[2], w->x + 246, 58 - 12 + w->y + 1);
rct_string_id stringId;
int x, y;
gfx_draw_sprite(dpi, SPR_TAB_GUESTS_0, w->x + w->widgets[WIDX_TAB1].left, w->y + w->widgets[WIDX_TAB1].top, 0);
window_draw_widgets(w, dpi);
window_player_list_draw_tab_images(w, dpi);
// Columns
gfx_draw_string_left(dpi, STR_PLAYER, NULL, w->colours[2], w->x + 6, 58 - 12 + w->y + 1);
gfx_draw_string_left(dpi, STR_PING, NULL, w->colours[2], w->x + 246, 58 - 12 + w->y + 1);
// Number of players
stringId = w->no_list_items == 1 ? STR_X_PLAYER : STR_X_PLAYERS;
x = w->x + 4;
y = w->y + w->widgets[WIDX_LIST].bottom + 2;
gfx_draw_string_left(dpi, stringId, &w->no_list_items, w->colours[2], x, y);
}
static void window_player_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int scrollIndex)
@ -320,3 +335,25 @@ static void window_player_list_refresh_list(rct_window *w)
w->selected_list_item = -1;
window_invalidate(w);
}
static void window_player_list_draw_tab_image(rct_window *w, rct_drawpixelinfo *dpi, int page, int spriteIndex)
{
int widgetIndex = WIDX_TAB1 + page;
if (!(w->disabled_widgets & (1LL << widgetIndex))) {
if (w->page == page) {
int numFrames = window_player_list_animation_frames[w->page];
if (numFrames > 1) {
int frame = w->frame_no / window_player_list_animation_divisor[w->page];
spriteIndex += (frame % numFrames);
}
}
gfx_draw_sprite(dpi, spriteIndex, w->x + w->widgets[widgetIndex].left, w->y + w->widgets[widgetIndex].top, 0);
}
}
static void window_player_list_draw_tab_images(rct_window *w, rct_drawpixelinfo *dpi)
{
window_player_list_draw_tab_image(w, dpi, 0, SPR_TAB_GUESTS_0);
}

View File

@ -5975,9 +5975,7 @@ static void window_ride_customer_paint(rct_window *w, rct_drawpixelinfo *dpi)
y = w->y + window_ride_customer_widgets[WIDX_PAGE_BACKGROUND].top + 4;
// Customers per hour
customersPerHour = ride->var_124 + ride->var_126 + ride->var_128 + ride->var_12A + ride->var_12C +
ride->var_12E + ride->age + ride->running_cost + ride->var_134 + ride->var_136;
customersPerHour *= 12;
customersPerHour = ride_customers_per_hour(ride);
gfx_draw_string_left(dpi, STR_CUSTOMERS_PER_HOUR, &customersPerHour, 0, x, y);
y += 10;

View File

@ -493,7 +493,7 @@ static int ride_get_alternative_type(rct_ride *ride)
{
return _currentTrackCovered & 2 ?
RCT2_ADDRESS(0x0097D4F5, uint8)[ride->type * 8] :
ride->type;;
ride->type;
}
/**
@ -945,6 +945,11 @@ static void window_ride_construction_resize(rct_window *w)
if (_currentTrackSlopeEnd == TRACK_SLOPE_UP_90 || _previousTrackSlopeEnd == TRACK_SLOPE_UP_90) {
disabledWidgets |= (1ULL << WIDX_CHAIN_LIFT);
}
if (!is_track_enabled(TRACK_LIFT_HILL_STEEP)) {
if (_previousTrackSlopeEnd == TRACK_SLOPE_UP_60 || _currentTrackSlopeEnd == TRACK_SLOPE_UP_60) {
disabledWidgets |= (1ULL << WIDX_CHAIN_LIFT);
}
}
if (_previousTrackBankEnd == TRACK_BANK_UPSIDE_DOWN) {
disabledWidgets |=
(1ULL << WIDX_LEFT_CURVE_SMALL) |

View File

@ -23,12 +23,12 @@
#include "../config.h"
#include "../game.h"
#include "../localisation/localisation.h"
#include "../interface/themes.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../openrct2.h"
#include "../sprites.h"
#include "../tutorial.h"
#include "../interface/themes.h"
enum WINDOW_SAVE_PROMPT_WIDGET_IDX {
WIDX_BACKGROUND,
@ -136,7 +136,7 @@ void window_save_prompt_open()
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) != 0) {
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) != 1) {
RCT2_CALLPROC_EBPSAFE(0x0066EE54);
sub_66EE54();
game_load_or_quit_no_save_prompt();
return;
}
@ -252,7 +252,7 @@ static void window_save_prompt_mouseup(rct_window *w, int widgetIndex)
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) != 0) {
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) != 1) {
RCT2_CALLPROC_EBPSAFE(0x0066EE54);
sub_66EE54();
game_load_or_quit_no_save_prompt();
return;
} else {

View File

@ -403,13 +403,11 @@ static void window_server_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi
}
// Draw server information
if (highlighted) {
gfx_draw_string(dpi, serverDetails->address, colour, 3, y + 3);
if (highlighted && !str_is_null_or_empty(serverDetails->description)) {
gfx_draw_string(dpi, serverDetails->description, colour, 3, y + 3);
} else {
gfx_draw_string(dpi, serverDetails->name, colour, 3, y + 3);
}
//gfx_draw_string(dpi, serverDetails->description, w->colours[1], 3, y + 14);
int right = width - 3 - 14;

View File

@ -3794,7 +3794,6 @@ static void map_obstruction_set_error_text(rct_map_element *mapElement)
*/
int map_can_construct_with_clear_at(int x, int y, int zLow, int zHigh, void *clearFunc, uint8 bl)
{
// return (RCT2 CALLPROC X(0x0068B932, x, bl, y, (zHigh << 8) | zLow, 0, 0, (int)clearFunc) & 0x100) == 0;
RCT2_GLOBAL(0x00F1AD40, void*) = clearFunc;
RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8) = 1;
if (x >= RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, sint16) || y >= RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, sint16) || x < 32 || y < 32) {

View File

@ -30,6 +30,7 @@
#include "../management/research.h"
#include "../peep/peep.h"
#include "../ride/ride.h"
#include "../ride/ride_data.h"
#include "../scenario.h"
#include "../world/map.h"
#include "park.h"
@ -285,12 +286,7 @@ money32 calculate_ride_value(rct_ride *ride)
return 0;
// Fair value * (...)
return (ride->value * 10) * (
ride->var_124 + ride->var_126 + ride->var_128 + ride->var_12A +
ride->var_12C + ride->var_12E + ride->age + ride->running_cost +
ride->var_134 + ride->var_136 +
*((uint8*)(0x0097D21E + (ride->type * 8))) * 4
);
return (ride->value * 10) * (ride_customers_in_last_5_minutes(ride) + rideBonusValue[ride->type] * 4);
}
/**
@ -371,7 +367,7 @@ static int park_calculate_guest_generation_probability()
continue;
// Add guest score for ride type
suggestedMaxGuests += RCT2_GLOBAL(0x0097D21E + (ride->type * 8), uint8);
suggestedMaxGuests += rideBonusValue[ride->type];
// Add ride value
if (ride->value != RIDE_VALUE_UNDEFINED) {
@ -402,7 +398,7 @@ static int park_calculate_guest_generation_probability()
continue;
// Bonus guests for good ride
suggestedMaxGuests += RCT2_GLOBAL(0x0097D21E + (ride->type * 8), uint8) * 2;
suggestedMaxGuests += rideBonusValue[ride->type] * 2;
}
}