Merge branch 'develop' into pathfind_history_fixes

This commit is contained in:
Michael Steenbeek 2016-12-12 13:44:19 +01:00 committed by GitHub
commit 73a131e87f
123 changed files with 3707 additions and 2304 deletions

16
.clang-format Normal file
View File

@ -0,0 +1,16 @@
---
BasedOnStyle: LLVM
AccessModifierOffset: '-4'
AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true'
AllowShortFunctionsOnASingleLine: Empty
BreakBeforeBraces: Allman
ColumnLimit: '128'
Cpp11BracedListStyle: 'false'
IndentWidth: '4'
PointerAlignment: Middle
SortIncludes: 'true'
Standard: Cpp11
TabWidth: '4'
...

View File

@ -115,6 +115,7 @@ option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags")
option(DISABLE_OPENGL "Disable OpenGL support.")
option(DISABLE_RCT2 "Build a standalone version, without using code and data segments from vanilla. On by default." ON)
option(USE_MMAP "Use mmap to try loading rct2's data segment into memory.")
option(WITH_TESTS "Build tests")
set(COMMON_COMPILE_OPTIONS "${COMMON_COMPILE_OPTIONS} -fstrict-aliasing -Werror -Wundef -Wmissing-declarations -Winit-self -Wall -Wno-unknown-pragmas -Wno-unused-function -Wno-missing-braces -Wno-comment")
@ -407,6 +408,11 @@ install(FILES resources/logo/icon_x256.png DESTINATION share/icons/hicolor/256x2
install(FILES resources/logo/icon_flag.svg DESTINATION share/icons/hicolor/scalable/apps RENAME openrct2.svg)
install(FILES distribution/linux/openrct2.desktop DESTINATION share/applications)
if (WITH_TESTS)
enable_testing()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/tests/)
endif ()
if (UNIX AND (NOT USE_MMAP) AND (NOT DISABLE_RCT2) AND (FORCE32))
file(GLOB_RECURSE ORCT2_RIDE_SOURCES "src/ride/*/*.c")
file(GLOB_RECURSE ORCT2_RIDE_DEP_SOURCES "src/ride/ride_data.c" "src/ride/track_data.c" "src/ride/track_data_old.c" "src/ride/track_paint.c" "src/addresses.c" "src/diagnostic.c" "src/hook.c" "src/paint/map_element/map_element.c" "src/paint/paint_helpers.c")

View File

@ -8,6 +8,8 @@ To report a bug, ensure you have a GitHub account. Search the issues page to see
If not, create a new issue and write the steps to reproduce. Upload a saved game if possible and this is very helpful
for users to replicate the bug. Please state which version of the game you are running and where you downloaded it from, e.g. *openrct2.com develop 0.0.3 build 1255 (ec25b2f)*.
For Windows builds, OpenRCT2 will generate a memory dump and saved game when the game crashes unexpectedly. The game will open explorer to these files automatically for you. They are placed inside your configured user directory which by default is `%HOMEPATH%\Documents\OpenRCT2`.
# Translation
Translation is managed in a separate repository, [OpenRCT2/Localisation](https://github.com/OpenRCT2/Localisation).
You will find more information there.
@ -37,6 +39,6 @@ When coding, please also add a string constant for your strings to ```./src/loca
### Coding style / language
OpenRCT2 currently does not have a strict coding style. This will be implemented after the entire game is implemented and
undergoes heavy refactoring. For now, it is recommended that you only write C files as the majority of the game is currenlty in
undergoes heavy refactoring. For now, it is recommended that you only write C files as the majority of the game is currently in
C. Exceptions are to modules that have no direct relationship to original code such as the new software audio mixer, the
HTTP integration and the Twitch integration.

View File

@ -37,6 +37,7 @@
C606CD261DB5120C00FE4015 /* TestPaint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C606CD231DB5120900FE4015 /* TestPaint.cpp */; };
C612A8991D64825300B634CA /* vehicle_data.c in Sources */ = {isa = PBXBuildFile; fileRef = C612A8971D64825300B634CA /* vehicle_data.c */; };
C61FB7241CF86356004CE991 /* NetworkUser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61FB7221CF86356004CE991 /* NetworkUser.cpp */; };
C649B3D41DF04ED2008AC826 /* format_codes.c in Sources */ = {isa = PBXBuildFile; fileRef = C649B3D31DF04ED2008AC826 /* format_codes.c */; };
C64FDA641D6D9A2100F259B9 /* air_powered_vertical_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8BB1CDBC3B7009F9BFC /* air_powered_vertical_coaster.c */; };
C64FDA651D6D9A2100F259B9 /* bobsleigh_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8BC1CDBC3B7009F9BFC /* bobsleigh_coaster.c */; };
C64FDA661D6D9A2100F259B9 /* compact_inverted_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8BD1CDBC3B7009F9BFC /* compact_inverted_coaster.c */; };
@ -123,6 +124,7 @@
C650B21A1CCABBDD00B4D91C /* tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C650B2171CCABBDD00B4D91C /* tables.cpp */; };
C650B21C1CCABC4400B4D91C /* ConvertCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C650B21B1CCABC4400B4D91C /* ConvertCommand.cpp */; };
C6575A371D46AFBA00C3E79F /* debug_paint.c in Sources */ = {isa = PBXBuildFile; fileRef = C6575A361D46AFBA00C3E79F /* debug_paint.c */; };
C6834A111DFDE8E300CE933A /* interop.c in Sources */ = {isa = PBXBuildFile; fileRef = C6834A0F1DFDE8E300CE933A /* interop.c */; };
C686F8AC1CDBC37E009F9BFC /* banner.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8981CDBC37E009F9BFC /* banner.c */; };
C686F8AD1CDBC37E009F9BFC /* entrance.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8991CDBC37E009F9BFC /* entrance.c */; };
C686F8AE1CDBC37E009F9BFC /* fence.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F89A1CDBC37E009F9BFC /* fence.c */; };
@ -403,6 +405,7 @@
D44272A51CC81B3200D84D28 /* particle.c in Sources */ = {isa = PBXBuildFile; fileRef = D44271EF1CC81B3200D84D28 /* particle.c */; };
D44272A61CC81B3200D84D28 /* scenery.c in Sources */ = {isa = PBXBuildFile; fileRef = D44271F01CC81B3200D84D28 /* scenery.c */; };
D44272A71CC81B3200D84D28 /* sprite.c in Sources */ = {isa = PBXBuildFile; fileRef = D44271F21CC81B3200D84D28 /* sprite.c */; };
D4469DAD1DEF84480039A779 /* Fonts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4469DAB1DEF84480039A779 /* Fonts.cpp */; };
D45A38BC1CF3006400659A24 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D45A38B31CF3006400659A24 /* libcrypto.dylib */; };
D45A38BE1CF3006400659A24 /* libjansson.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D45A38B51CF3006400659A24 /* libjansson.dylib */; };
D45A38C01CF3006400659A24 /* libSDL2_ttf.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D45A38B71CF3006400659A24 /* libSDL2_ttf.dylib */; };
@ -534,6 +537,7 @@
C612A8981D64825300B634CA /* vehicle_data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vehicle_data.h; sourceTree = "<group>"; };
C61FB7221CF86356004CE991 /* NetworkUser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkUser.cpp; sourceTree = "<group>"; usesTabs = 0; };
C61FB7231CF86356004CE991 /* NetworkUser.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = NetworkUser.h; sourceTree = "<group>"; usesTabs = 0; };
C649B3D31DF04ED2008AC826 /* format_codes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = format_codes.c; sourceTree = "<group>"; };
C64FDA5D1D6D99F400F259B9 /* PaintTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = PaintTest; sourceTree = BUILT_PRODUCTS_DIR; };
C650B2151CCABBDD00B4D91C /* S4Importer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = S4Importer.cpp; sourceTree = "<group>"; usesTabs = 0; };
C650B2161CCABBDD00B4D91C /* S4Importer.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = S4Importer.h; sourceTree = "<group>"; usesTabs = 0; };
@ -541,6 +545,8 @@
C650B2181CCABBDD00B4D91C /* Tables.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = Tables.h; sourceTree = "<group>"; usesTabs = 0; };
C650B21B1CCABC4400B4D91C /* ConvertCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConvertCommand.cpp; sourceTree = "<group>"; usesTabs = 0; };
C6575A361D46AFBA00C3E79F /* debug_paint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = debug_paint.c; sourceTree = "<group>"; };
C6834A0F1DFDE8E300CE933A /* interop.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = interop.c; sourceTree = "<group>"; usesTabs = 1; };
C6834A101DFDE8E300CE933A /* interop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = interop.h; sourceTree = "<group>"; };
C686F8981CDBC37E009F9BFC /* banner.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = banner.c; sourceTree = "<group>"; };
C686F8991CDBC37E009F9BFC /* entrance.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = entrance.c; sourceTree = "<group>"; };
C686F89A1CDBC37E009F9BFC /* fence.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fence.c; sourceTree = "<group>"; };
@ -941,6 +947,8 @@
D44271F21CC81B3200D84D28 /* sprite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sprite.c; sourceTree = "<group>"; };
D44271F31CC81B3200D84D28 /* sprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sprite.h; sourceTree = "<group>"; };
D44271F41CC81B3200D84D28 /* water.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = water.h; sourceTree = "<group>"; };
D4469DAB1DEF84480039A779 /* Fonts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Fonts.cpp; sourceTree = "<group>"; };
D4469DAC1DEF84480039A779 /* Fonts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Fonts.h; sourceTree = "<group>"; };
D45A38B31CF3006400659A24 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libcrypto.dylib; sourceTree = "<group>"; };
D45A38B41CF3006400659A24 /* libfreetype.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libfreetype.dylib; sourceTree = "<group>"; };
D45A38B51CF3006400659A24 /* libjansson.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libjansson.dylib; sourceTree = "<group>"; };
@ -1404,6 +1412,8 @@
C6B5A7CF1CDFE4CB00C9C006 /* rct2 */ = {
isa = PBXGroup;
children = (
C6834A0F1DFDE8E300CE933A /* interop.c */,
C6834A101DFDE8E300CE933A /* interop.h */,
C6B5A7D01CDFE4CB00C9C006 /* S6Exporter.cpp */,
C6B5A7D11CDFE4CB00C9C006 /* S6Exporter.h */,
C6B5A7D21CDFE4CB00C9C006 /* S6Importer.cpp */,
@ -1616,6 +1626,8 @@
D4F5B5EC1DAD8A4300AB6075 /* CursorData.cpp */,
D4F5B5ED1DAD8A4300AB6075 /* Cursors.cpp */,
D4F5B5EE1DAD8A4300AB6075 /* Cursors.h */,
D4469DAB1DEF84480039A779 /* Fonts.cpp */,
D4469DAC1DEF84480039A779 /* Fonts.h */,
D442711F1CC81B3200D84D28 /* graph.c */,
D44271201CC81B3200D84D28 /* graph.h */,
D44271211CC81B3200D84D28 /* keyboard_shortcut.c */,
@ -1645,6 +1657,7 @@
D44271351CC81B3200D84D28 /* currency.h */,
D44271361CC81B3200D84D28 /* date.c */,
D44271371CC81B3200D84D28 /* date.h */,
C649B3D31DF04ED2008AC826 /* format_codes.c */,
D44271381CC81B3200D84D28 /* format_codes.h */,
D44271391CC81B3200D84D28 /* language.cpp */,
D442713A1CC81B3200D84D28 /* language.h */,
@ -2572,6 +2585,7 @@
C686F93A1CDBC3B7009F9BFC /* spiral_slide.c in Sources */,
C686F9421CDBC3B7009F9BFC /* magic_carpet.c in Sources */,
D44272021CC81B3200D84D28 /* Json.cpp in Sources */,
C649B3D41DF04ED2008AC826 /* format_codes.c in Sources */,
D44272591CC81B3200D84D28 /* dropdown.c in Sources */,
D43407DF1D0E14BE00C2B3D4 /* SwapFramebuffer.cpp in Sources */,
C686F8AF1CDBC37E009F9BFC /* map_element.c in Sources */,
@ -2702,6 +2716,7 @@
C686F91A1CDBC3B7009F9BFC /* mine_train_coaster.c in Sources */,
D44272A11CC81B3200D84D28 /* map_helpers.c in Sources */,
C686F9431CDBC3B7009F9BFC /* motion_simulator.c in Sources */,
D4469DAD1DEF84480039A779 /* Fonts.cpp in Sources */,
D44272281CC81B3200D84D28 /* language.cpp in Sources */,
D442729B1CC81B3200D84D28 /* climate.c in Sources */,
D464FEC01D31A68800CBABAC /* Image.cpp in Sources */,
@ -2832,6 +2847,7 @@
C686F90E1CDBC3B7009F9BFC /* corkscrew_roller_coaster.c in Sources */,
D44272A61CC81B3200D84D28 /* scenery.c in Sources */,
C686F9111CDBC3B7009F9BFC /* heartline_twister_coaster.c in Sources */,
C6834A111DFDE8E300CE933A /* interop.c in Sources */,
C686F9231CDBC3B7009F9BFC /* steeplechase.c in Sources */,
D44271FE1CC81B3200D84D28 /* config.c in Sources */,
D44272871CC81B3200D84D28 /* staff_list.c in Sources */,

View File

@ -1,5 +1,5 @@
version: 0.0.5.{build}
os: Visual Studio 2015
os: Previous Visual Studio 2015
cache:
- C:\ProgramData\chocolatey\bin -> scripts\ps\appveyor_install.ps1
- C:\ProgramData\chocolatey\lib -> scripts\ps\appveyor_install.ps1
@ -22,6 +22,8 @@ platform:
configuration: Release
build:
project: openrct2.proj
test_script:
- ps: msbuild openrct2.proj /t:test /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
artifacts:
- path: .\artifacts\openrct2-portable*.zip
name: OpenRCT2-portable

View File

@ -556,7 +556,7 @@ STR_0551 :
STR_0552 :
STR_0553 :
STR_0554 :La voiture est propulsée hors de la station à l'aide de moteurs à induction linéaire puis, après avoir atteint une pointe verticale, revient à la station en chute libre
STR_0555 :Les passagers passent aux différents niveaux d'une tour verticale à bord d'un ascenceur
STR_0555 :Les passagers passent aux différents niveaux d'une tour verticale à bord d'un ascenseur
STR_0556 :Des voitures très larges descendent des voies en pente verticale. pour amateurs de chute libre
STR_0557 :
STR_0558 :
@ -3185,7 +3185,7 @@ STR_3173 :Cet objet est déjà utilisé
STR_3174 :Cet objet est requis par un autre objet
STR_3175 :Cet objet est toujours requis
STR_3176 :Impossible de sélectionner cet objet
STR_3177 :Impossible de déselectionner cet objet
STR_3177 :Impossible de désélectionner cet objet
STR_3178 :Au moins un objet d'allée doit être sélectionné
STR_3179 :Au moins un objet de véhicule ou d'attraction doit être sélectionné
STR_3180 :Sélection d'objets non valide
@ -3262,8 +3262,8 @@ STR_3250 :Impossible d'augmenter davantage l'emprunt initial !
STR_3251 :Impossible de diminuer davantage l'emprunt initial !
STR_3252 :Impossible d'augmenter davantage l'emprunt maximum !
STR_3253 :Impossible de diminuer davantage l'emprunt maximum !
STR_3254 :Impossible d'augmenter davantage le taux d'intérêts !
STR_3255 :Impossible de diminuer davantage le taux d'intérêts !
STR_3254 :Impossible d'augmenter davantage le taux d'intérêt !
STR_3255 :Impossible de diminuer davantage le taux d'intérêt !
STR_3256 :Attr. moins dures pour visiteurs
STR_3257 :{SMALLFONT}{BLACK}Choisir si vous souhaitez que les visiteurs préfèrent des attractions moins intenses
STR_3258 :Attr. plus dures pour visiteurs
@ -3392,7 +3392,7 @@ STR_3380 :Impossible d'installer ce modèle de circuit...
STR_3381 :Le fichier n'est pas compatible ou contient des données invalides
STR_3382 :Copie du fichier échouée
STR_3383 :Sélectionnez le nouveau nom pour le modèle de circuit
STR_3384 :Un modèle de circuit possède déjà ce nom - Veuillez en choisir un autre pour celui ci :
STR_3384 :Un modèle de circuit possède déjà ce nom - Veuillez en choisir un autre pour celui-ci :
STR_3385 :Didacticiel pour débutants
STR_3386 :Didacticiel attractions personnalisées
STR_3387 :Didacticiel construction des montagnes russes
@ -3431,7 +3431,7 @@ STR_3419 :{SMALLFONT}{BLACK}Pour construire du décor l'un au-dessus de l'aut
STR_3420 :{SMALLFONT}{BLACK}Certains éléments du décor peuvent être repeints après leur construction...
STR_3421 :{SMALLFONT}{BLACK}Ajoutons un peu de musique à notre attraction...
STR_3422 :{SMALLFONT}{BLACK}Construisons un montagne russe !
STR_3423 :{SMALLFONT}{BLACK}Il y a plein de modèles pré-définis, mais nous allons construire notre propre circuit...
STR_3423 :{SMALLFONT}{BLACK}Il y a plein de modèles prédéfinis, mais nous allons construire notre propre circuit...
STR_3424 :{SMALLFONT}{BLACK}Voilà la station construite. Maintenant la montée...
STR_3425 :{SMALLFONT}{BLACK}Les trains des montagnes russes ne sont pas propulsés, une 'échelle' est nécessaire pour tirer le train lors de la première montée...
STR_3426 :{SMALLFONT}{BLACK}La montée est terminée - Maintenant la descente...
@ -3523,7 +3523,7 @@ STR_5180 :{SMALLFONT}{BLACK}Afficher les options de triche du parc
STR_5181 :{SMALLFONT}{BLACK}Afficher les options de triche des attractions
STR_5182 :{INT32}
STR_5183 :Hauteur de base
STR_5184 :Entrez une hauter de base entre {COMMA16} et {COMMA16}
STR_5184 :Entrez une hauteur de base entre {COMMA16} et {COMMA16}
STR_5185 :Niveau de l'eau
STR_5186 :Entrez un niveau d'eau entre {COMMA16} et {COMMA16}
STR_5187 :Finances

View File

@ -3679,8 +3679,8 @@ STR_5337 :Entrada do parque
STR_5338 :Tipo de elemento
STR_5339 :{SMALLFONT}{BLACK}Altura da base
STR_5340 :{SMALLFONT}{BLACK}Altura de segurança
STR_5341 :Bandeiras
STR_5342 :Escolha o azulejo do mapa
STR_5341 :<removed string - do not use>
STR_5342 :<removed string - do not use>
STR_5343 :Colocar automaticamente funcionários
STR_5344 :Log de mudanças
STR_5345 :Trapaça financeira
@ -4187,7 +4187,7 @@ STR_5875 :Engine de desenho:
STR_5876 :{SMALLFONT}{BLACK}Engine que será usada para desenhar o jogo.
STR_5877 :Software
STR_5878 :Software (exibição por hardware)
STR_5879 :OpenGL
STR_5879 :OpenGL (experimental)
STR_5880 :Somente selecionados
STR_5881 :Somente não selecionados
STR_5882 :Moeda Personalizada
@ -4232,6 +4232,77 @@ STR_5920 :Renderizar efeitos climáticos
STR_5921 :{SMALLFONT}{BLACK}Se habilitado, chuva e cores escuras serão renderizadas durante tempestades.
STR_5922 :{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{SMALLFONT}{BLACK}Máx {STRINGID}
STR_5923 :{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{SMALLFONT}{BLACK}Máx {COMMA16} {STRINGID} por trem
STR_5924 :Detalhes de superfície
STR_5925 :Detalhes de caminho
STR_5926 :Detalhes de pista
STR_5927 :Detalhes de cenário
STR_5928 :Detalhes de entrada
STR_5929 :Detalhes de cerca
STR_5930 :Detalhes de cenário grande
STR_5931 :Detalhes de banner
STR_5932 :Detalhes de elemento corrompido
STR_5933 :Propriedades
STR_5934 :{WINDOW_COLOUR_2}Textura do terreno: {BLACK}{STRINGID}
STR_5935 :{WINDOW_COLOUR_2}Borda do terreno: {BLACK}{STRINGID}
STR_5936 :{WINDOW_COLOUR_2}Posse de terra: {BLACK}{STRINGID}
STR_5937 :Não comprado e não está à venda
STR_5938 :{WINDOW_COLOUR_2}Nível da água: {BLACK}{COMMA16}
STR_5939 :Remover cercas do parque
STR_5940 :Restaurar cercas do parque
STR_5941 :{WINDOW_COLOUR_2}Altura da base:
STR_5942 :{WINDOW_COLOUR_2}Nome do caminho: {BLACK}{STRINGID}
STR_5943 :{WINDOW_COLOUR_2}Adições: {BLACK}{STRINGID}
STR_5944 :{WINDOW_COLOUR_2}Adições: {BLACK}Nenhuma
STR_5945 :{WINDOW_COLOUR_2}Bordas conectadas:
STR_5946 :{WINDOW_COLOUR_2}Tipo de atração: {BLACK}{STRINGID}
STR_5947 :{WINDOW_COLOUR_2}ID da atração: {BLACK}{COMMA16}
STR_5948 :{WINDOW_COLOUR_2}Nome da atração: {BLACK}{STRINGID}
STR_5949 :{WINDOW_COLOUR_2}Corrente de elevação
STR_5950 :{WINDOW_COLOUR_2}Aplicar mudanças para a pista toda
STR_5951 :{WINDOW_COLOUR_2}ID do pedaço de pista: {BLACK}{COMMA16}
STR_5952 :{WINDOW_COLOUR_2}Número sequencial: {BLACK}{COMMA16}
STR_5953 :{SMALLFONT}{BLACK}Sortear os elementos do mapa no azulejo atual baseado em sua altura base.
STR_5954 :{WINDOW_COLOUR_2}Idade do cenário: {BLACK}{COMMA16}
STR_5955 :{WINDOW_COLOUR_2}Posicionamento em quadrante: {BLACK}{STRINGID}
STR_5956 :Sudoeste
STR_5957 :Noroeste
STR_5958 :Nordeste
STR_5959 :Sudeste
STR_5960 :{WINDOW_COLOUR_2}Posicionamento em quadrante:
STR_5961 :{WINDOW_COLOUR_2}Índice de entrada: {BLACK}{COMMA16}
STR_5962 :{WINDOW_COLOUR_2}Detecção de colisão:
STR_5963 :{WINDOW_COLOUR_2}Cantos elevados:
STR_5964 :{WINDOW_COLOUR_2}Diagonal
STR_5965 :{WINDOW_COLOUR_2}Tipo de entrada: {BLACK}{STRINGID}
STR_5966 :{WINDOW_COLOUR_2}Parte de entrada do parque: {BLACK}{STRINGID}
STR_5967 :Meio
STR_5968 :Esquerda
STR_5969 :Direita
STR_5970 :{WINDOW_COLOUR_2}ID da entrada: {BLACK}{COMMA16}
STR_5971 :{WINDOW_COLOUR_2}ID da saída: {BLACK}{COMMA16}
STR_5972 :{WINDOW_COLOUR_2}ID da atração: {BLACK}{COMMA16}
STR_5973 :Prender ao próximo
STR_5974 :{SMALLFONT}{BLACK}Muda a base e a altura de segurançapara que sejam as mesmas que o próximo elemento no azulejo atual. Fazendo isto fica mais fácil de construir neste azulejo.
STR_5975 :Inclinação:
STR_5976 :Reto
STR_5977 :Direita para cima
STR_5978 :Esquerda para cima
STR_5979 :{WINDOW_COLOUR_2}Tipo de cerca: {BLACK}{COMMA16}
STR_5980 :{WINDOW_COLOUR_2}Texto do banner: {BLACK}{STRINGID}
STR_5981 :{WINDOW_COLOUR_2}Não é um banner
STR_5982 :{WINDOW_COLOUR_2}Tipo de cenário grande: {BLACK}{COMMA16}
STR_5983 :{WINDOW_COLOUR_2}ID da peça de cenário grande: {BLACK}{COMMA16}
STR_5984 :Caminhos bloqueados:
STR_5985 :Nova pasta
STR_5986 :Insira o nome da nova pasta.
STR_5987 :Impossível criar pasta
STR_5988 :{SMALLFONT}{BLACK}Não há posse de terra à venda
STR_5989 :{SMALLFONT}{BLACK}Não há direitos de construção à venda
STR_5990 :{SMALLFONT}{BLACK}Não há posse de terra ou direitos de construção à venda
STR_5991 :Impossível colar elemento...
STR_5992 :O limite de elementos no mapa foi atingido
STR_5993 :{SMALLFONT}{BLACK}Copiar elemento selecionado
STR_5994 :{SMALLFONT}{BLACK}Colar elemento selecionado
#############
# Scenarios #

File diff suppressed because it is too large Load Diff

View File

@ -4188,7 +4188,7 @@ STR_5875 :渲染引擎:
STR_5876 :{SMALLFONT}{BLACK}選擇使用於渲染遊戲的引擎.
STR_5877 :軟件渲染
STR_5878 :軟件渲染 (使用硬件渲染)
STR_5879   :OpenGL (實驗性質)
STR_5879 :OpenGL (實驗性質)
STR_5880 :只顯示已選擇的物件
STR_5881 :只顯示未選擇的物件
STR_5882 :自訂貨幣
@ -4242,7 +4242,7 @@ STR_5929 :圍欄詳情
STR_5930 :巨型景物詳情
STR_5931 :橫額詳情
STR_5932 :已毀壞元素詳情
STR_5933   :屬性
STR_5933 :屬性
STR_5934 :{WINDOW_COLOUR_2}地型素材: {BLACK}{STRINGID}
STR_5935 :{WINDOW_COLOUR_2}地型邊緣: {BLACK}{STRINGID}
STR_5936 :{WINDOW_COLOUR_2}土地擁有權: {BLACK}{STRINGID}
@ -4252,9 +4252,9 @@ STR_5939 :移除樂園邊界
STR_5940 :還原樂園邊界
STR_5941 :{WINDOW_COLOUR_2}地面高度:
STR_5942 :{WINDOW_COLOUR_2}道路名稱: {BLACK}{STRINGID}
STR_5943   :{WINDOW_COLOUR_2}附加物品: {BLACK}{STRINGID}
STR_5943 :{WINDOW_COLOUR_2}附加物品: {BLACK}{STRINGID}
STR_5944 :{WINDOW_COLOUR_2}附加物品: {BLACK}暫無
STR_5945   :{WINDOW_COLOUR_2}已連接的邊緣:
STR_5945 :{WINDOW_COLOUR_2}已連接的邊緣:
STR_5946 :{WINDOW_COLOUR_2}遊樂設施種類: {BLACK}{STRINGID}
STR_5947 :{WINDOW_COLOUR_2}遊樂設施編號: {BLACK}{COMMA16}
STR_5948 :{WINDOW_COLOUR_2}遊樂設施名稱: {BLACK}{STRINGID}
@ -4262,7 +4262,7 @@ STR_5949 :{WINDOW_COLOUR_2}鏈條坡道
STR_5950 :{WINDOW_COLOUR_2}將改變應用於整個軌道組件中
STR_5951 :{WINDOW_COLOUR_2}軌道組件編號: {BLACK}{COMMA16}
STR_5952 :{WINDOW_COLOUR_2}次序數目: {BLACK}{COMMA16}
STR_5953   :{SMALLFONT}{BLACK}以底部高度排序目前網格上的地圖元素
STR_5953 :{SMALLFONT}{BLACK}以底部高度排序目前網格上的地圖元素
STR_5954 :{WINDOW_COLOUR_2}景物年齡: {BLACK}{COMMA16}
STR_5955 :{WINDOW_COLOUR_2}Quadrant放置: {BLACK}{STRINGID}
STR_5956 :西南
@ -4271,8 +4271,8 @@ STR_5958 :東北
STR_5959 :東南
STR_5960 :{WINDOW_COLOUR_2}Quadrant放置:
STR_5961 :{WINDOW_COLOUR_2}入口編號: {BLACK}{COMMA16}
STR_5962   :{WINDOW_COLOUR_2}衝突檢測:
STR_5963   :{WINDOW_COLOUR_2}已升起的角落:
STR_5962 :{WINDOW_COLOUR_2}衝突檢測:
STR_5963 :{WINDOW_COLOUR_2}已升起的角落:
STR_5964 :{WINDOW_COLOUR_2}斜角
STR_5965 :{WINDOW_COLOUR_2}入口類型: {BLACK}{STRINGID}
STR_5966 :{WINDOW_COLOUR_2}樂園入口部份: {BLACK}{STRINGID}
@ -4281,25 +4281,25 @@ STR_5968 :左
STR_5969 :右
STR_5970 :{WINDOW_COLOUR_2}入口編號: {BLACK}{COMMA16}
STR_5971 :{WINDOW_COLOUR_2}出口編號: {BLACK}{COMMA16}
STR_5972   :{WINDOW_COLOUR_2}遊樂設施編號: {BLACK}{COMMA16}
STR_5972 :{WINDOW_COLOUR_2}遊樂設施編號: {BLACK}{COMMA16}
STR_5973 :與下一地圖元素並列
STR_5974   :{SMALLFONT}{BLACK}將此元素的底部及清空高度與下一元素調整成一致. 此舉會讓於此網格上建造得更加容易.
STR_5974 :{SMALLFONT}{BLACK}將此元素的底部及清空高度與下一元素調整成一致. 此舉會讓於此網格上建造得更加容易.
STR_5975 :坡道:
STR_5976 :平坦
STR_5977   :右邊向上
STR_5977 :右邊向上
STR_5978 :左邊向上
STR_5979 :{WINDOW_COLOUR_2}圍欄類型: {BLACK}{COMMA16}
STR_5980 :{WINDOW_COLOUR_2}橫額文字: {BLACK}{STRINGID}
STR_5981 :{WINDOW_COLOUR_2}不是橫額
STR_5982 :{WINDOW_COLOUR_2}巨型景物類型: {BLACK}{COMMA16}
STR_5983 :{WINDOW_COLOUR_2}巨型景物組件編號: {BLACK}{COMMA16}
STR_5984   :被擋住的道路:
STR_5984 :被擋住的道路:
STR_5985 :建立新文件夾
STR_5986 :請輸入新文件夾的名字
STR_5987 :無法建立新文件夾
STR_5988 :{SMALLFONT}{BLACK}已經沒有可供購買的土地使用權
STR_5989 :{SMALLFONT}{BLACK}已經沒有可供購買的建造權
STR_5990   :{SMALLFONT}{BLACK}已經沒有可供購買的土地使用或建造權
STR_5990 :{SMALLFONT}{BLACK}已經沒有可供購買的土地使用或建造權
STR_5991 :無法貼上元素...
STR_5992 :此地圖元素的數量已達上限
STR_5993 :{SMALLFONT}{BLACK}複製所選元素

View File

@ -1,5 +1,7 @@
0.0.5 (in development)
------------------------------------------------------------------------
This is the first fully implemented version of OpenRCT2. RCT2.EXE is no longer required.
- Feature: Ability to disable rendering of weather effects and gloom
- Feature: New view option: "See-Through Paths"
- Feature: Add cheat to reset date.
@ -31,7 +33,7 @@
- Improved: In-game file dialog now shows more formats (sv6, sc6, sv4, etc.)
- Removed: BMP screenshots.
- Removed: Intamin and Phoenix easter eggs.
- Fix: [#933] On-ride photo price sometimes gets reset to £2 when using 'same price in whole park'
- Fix: [#933] On-ride photo price sometimes gets reset to £2 when using 'same price in whole park' (original bug).
- Fix: [#1038] Guest List is out of order.
- Fix: [#1238] Track place window does not fully adjust to custom colour scheme.
- Fix: [#2042] Guests entering queues are immediately annoyed when many entertainers are around (original bug).

View File

@ -1,8 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="'$(SolutionDir)'==''">..\..\</SolutionDir>
<Config Condition="'$(Configuration)'=='Debug' OR '$(Configuration)'=='DebugTests'">Debug</Config>
<Config Condition="'$(Configuration)'=='Release' OR '$(Configuration)'=='ReleaseTests'">Release</Config>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
<!-- Allow any version of VS and Windows SDK -->
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<TargetPlatformVersion>$(UCRTVersion)</TargetPlatformVersion>
<CharacterSet>MultiByte</CharacterSet>
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>$(SolutionDir)obj\$(ProjectName)\$(Config)_$(Platform)\</IntDir>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug'">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release'">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<DisableSpecificWarnings>4091;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<TreatSpecificWarningsAsErrors>4013</TreatSpecificWarningsAsErrors>
<TreatWarningAsError>true</TreatWarningAsError>
<AdditionalOptions>/utf-8</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Platform)'=='Win32'">openrct2-libs-vs2015-x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Platform)'=='x64'">openrct2-libs-vs2015-x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/OPT:NOLBR /ignore:4099 %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Config)'=='Debug'">
<ClCompile>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LinkTimeCodeGeneration>UseFastLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Config)'=='Release'">
<ClCompile>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck />
<OmitFramePointers />
<BufferSecurityCheck>false</BufferSecurityCheck>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='DebugTests'">
<ClCompile>
<PreprocessorDefinitions>__TEST__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='ReleaseTests'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;__TEST__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<!-- Debug|Win32 is reserved for RCT2 interop builds, this means it has to be a DLL -->
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'!='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>NO_RCT2;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<IncludePath>$(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)lib;$(LibraryPath)</LibraryPath>
<LinkIncremental />
</PropertyGroup>
<ItemDefinitionGroup>
<Manifest>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
</ItemDefinitionGroup>
</Project>

View File

@ -16,6 +16,7 @@
<PropertyGroup>
<Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
<Platform Condition="'$(PLATFORM)'==''">x64</Platform>
<TestConfig Condition="'$(Configuration)'=='DebugTests' OR '$(Configuration)'=='ReleaseTests'">true</TestConfig>
<GIT_COMMIT_SHA1_SHORT Condition="'$(GIT_COMMIT_SHA1)'!=''">$(GIT_COMMIT_SHA1.Substring(0, 7))</GIT_COMMIT_SHA1_SHORT>
<Version>0.0.5.0</Version>
@ -55,7 +56,6 @@
<UploadFilename>OpenRCT2-$(Version)$(VersionExtra)-windows-$(Platform.ToLower())</UploadFilename>
<!-- Set openrct2.sln properties -->
<SlnProperties>Configuration=$(Configuration)</SlnProperties>
<SlnProperties>$(SlnProperties);Platform=$(Platform)</SlnProperties>
<SlnProperties Condition="'$(BUILD_SERVER)'!=''">$(SlnProperties);OPENRCT2_CL_ADDITIONALOPTIONS=$(OPENRCT2_CL_ADDITIONALOPTIONS)</SlnProperties>
</PropertyGroup>
@ -65,6 +65,8 @@
<LibsUrl>https://github.com/OpenRCT2/Dependencies/releases/download/v$(TargetLibsVersion)/openrct2-libs-vs2015.zip</LibsUrl>
<LibsPath>$(RootDir)lib\</LibsPath>
<LibsVersionPath>$(LibsPath)libversion</LibsVersionPath>
<GtestVersion>1.8.0</GtestVersion>
<GtestUrl>https://github.com/google/googletest/archive/release-$(GtestVersion).zip</GtestUrl>
</PropertyGroup>
<ItemGroup>
@ -122,6 +124,7 @@
<Target Name="DownloadLibs">
<PropertyGroup>
<LibsZipPath>$(LibsPath)openrct2-libs-vs2015.zip</LibsZipPath>
<GtestZipPath>$(LibsPath)gtest.zip</GtestZipPath>
</PropertyGroup>
<!-- Clean libs directory -->
@ -129,15 +132,26 @@
<MakeDir Directories="$(LibsPath)" />
<Message Text="Downloading libraries..." Importance="normal" />
<!-- prebuilt libs -->
<Exec Command="powershell -ExecutionPolicy Unrestricted -Command &quot;Invoke-WebRequest '$(LibsUrl)' -OutFile '$(LibsZipPath)'&quot;" StandardOutputImportance="low" />
<Unzip Input="$(LibsZipPath)" OutputDirectory="$(LibsPath)" />
<Delete Files="$(LibsZipPath)" ContinueOnError="true" />
<!-- googletest -->
<Message Text="Downloading googletest..." Importance="normal" />
<Exec Command="powershell -ExecutionPolicy Unrestricted -Command &quot;Invoke-WebRequest '$(GtestUrl)' -OutFile '$(GtestZipPath)'&quot;" StandardOutputImportance="low" />
<Unzip Input="$(GtestZipPath)" OutputDirectory="$(LibsPath)" />
<Delete Files="$(GtestZipPath)" ContinueOnError="true" />
<Exec Command="cmd /c move &quot;$(LibsPath)googletest-release-$(GtestVersion)&quot; &quot;$(LibsPath)googletest&quot;" />
<!-- Update libversion file -->
<WriteLinesToFile Lines="$(TargetLibsVersion)" File="$(LibsVersionPath)" Overwrite="true" />
</Target>
<Target Name="Clean">
<PropertyGroup>
<SlnProperties>$(SlnProperties);Configuration=$(Configuration)</SlnProperties>
</PropertyGroup>
<ItemGroup>
<CleanItems Condition="'$(Platform)'=='Win32'" Include="$(OutputExe)" />
<CleanItems Include="$(g2Output)" />
@ -169,20 +183,39 @@
</Target>
<Target Name="Build">
<PropertyGroup>
<SlnProperties>$(SlnProperties);Configuration=$(Configuration)</SlnProperties>
</PropertyGroup>
<Message Text="SlnProperties: $(SlnProperties)" />
<MSBuild Projects="openrct2.sln" Targets="Build" Properties="$(SlnProperties)" />
</Target>
<Target Name="Rebuild">
<PropertyGroup>
<SlnProperties>$(SlnProperties);Configuration=$(Configuration)</SlnProperties>
</PropertyGroup>
<Message Text="SlnProperties: $(SlnProperties)" />
<MSBuild Projects="openrct2.sln" Targets="Rebuild" Properties="$(SlnProperties)" />
</Target>
<Target Name="BuildTests">
<PropertyGroup>
<Configuration Condition="'$(Configuration)'=='Debug'">DebugTests</Configuration>
<Configuration Condition="'$(Configuration)'=='Release'">ReleaseTests</Configuration>
<SlnProperties>$(SlnProperties);Configuration=$(Configuration)</SlnProperties>
</PropertyGroup>
<Message Text="SlnProperties: $(SlnProperties)" />
<MSBuild Projects="openrct2.sln" Targets="Build" Properties="$(SlnProperties)" />
</Target>
<Target Name="Test" DependsOnTargets="Build" Condition="'$(PLATFORM)'=='Win32'">
<Target Name="Test" DependsOnTargets="BuildTests">
<Exec Command="$(TargetDir)tests\tests.exe" />
</Target>
<Target Name="TestPaint" DependsOnTargets="Build" Condition="'$(Platform)'=='Win32'">
<Exec Command="$(TargetDir)testpaint\openrct2.exe" />
</Target>
<!-- Target to build g2.dat containing OpenRCT2 sprites -->
<Target Name="g2" DependsOnTargets="Build" AfterTargets="Build" Inputs="@(g2Inputs)" Outputs="$(g2Output)">
<Target Name="g2" DependsOnTargets="Build" AfterTargets="Build" Inputs="@(g2Inputs)" Outputs="$(g2Output)"
Condition="'$(TestConfig)'!='true'">
<Message Text="Building g2.dat..." />
<Exec Command="$(OutputExe) sprite build $(g2Output) $(RootDir)resources\g2"
StandardOutputImportance="low" />
@ -190,7 +223,8 @@
<!-- Target to sign OpenRCT2
This requires the project parameter SIGN_PASSWORD to be set -->
<Target Name="Sign" AfterTargets="Build" Inputs="@(SignItems)" Outputs="%(SignItems.Identity).signed">
<Target Name="Sign" AfterTargets="Build" Inputs="@(SignItems)" Outputs="%(SignItems.Identity).signed"
Condition="'$(TestConfig)'!='true'">
<Warning Condition="'$(SIGN_PASSWORD)'==''" Text="SIGN_PASSWORD was not set, skipping signing of %(SignItems.Filename)%(SignItems.Extension)." />
<Message Condition="'$(SIGN_PASSWORD)'!=''" Text="Signing %(SignItems.Filename)%(SignItems.Extension)"
Importance="high" />
@ -203,14 +237,16 @@
</Target>
<!-- Target to publish OpenRCT2 as a portable zip -->
<Target Name="PublishPortable" DependsOnTargets="Build;g2" Inputs="@(PublishItems)" Outputs="$(PublishZip)">
<Target Name="PublishPortable" DependsOnTargets="Build;g2" Inputs="@(PublishItems)" Outputs="$(PublishZip)"
Condition="'$(TestConfig)'!='true'">
<MakeDir Directories="$(ArtifactsDir)" />
<Message Importance="high" Text="Creating $([System.IO.Path]::GetFileName($(PublishZip)))..." />
<_7z Output="$(PublishZip)" Inputs="@(PublishItems)" />
</Target>
<!-- Target to publish the OpenRCT2 debug symbols -->
<Target Name="PublishSymbols" DependsOnTargets="Build" Inputs="@(SymbolItems)" Outputs="$(PublishSymbolsZip)">
<Target Name="PublishSymbols" DependsOnTargets="Build" Inputs="@(SymbolItems)" Outputs="$(PublishSymbolsZip)"
Condition="'$(TestConfig)'!='true'">
<MakeDir Directories="$(ArtifactsDir)" />
<Message Importance="high" Text="Creating $([System.IO.Path]::GetFileName($(PublishSymbolsZip)))..." />
<_7z Output="$(PublishSymbolsZip)" Inputs="@(SymbolItems)" />
@ -221,7 +257,7 @@
DependsOnTargets="Build;g2"
Inputs="@(PublishItems);$(NsisScript)"
Outputs="$(PublishInstallerExe)"
Condition="'$(NO_NSIS)'!='true'">
Condition="'$(NO_NSIS)'!='true' AND '$(TestConfig)'!='true'">
<PropertyGroup>
<PublishInstallerExeName>$([System.IO.Path]::GetFilename($(PublishInstallerExe)))</PublishInstallerExeName>
</PropertyGroup>
@ -249,7 +285,8 @@
DependsOnTargets="PublishSymbols;PublishPortable;PublishInstaller" />
<!-- Target to upload the artifacts to OpenRCT2.org -->
<Target Name="UploadArtifacts" DependsOnTargets="PublishAll">
<Target Name="UploadArtifacts" DependsOnTargets="PublishAll"
Condition="'$(TestConfig)'!='true'">
<PropertyGroup>
<UploadLink>https://openrct2.org/altapi/?command=push-build</UploadLink>
<UploadFileNameShort>%(UploadArtifacts.Filename)%(UploadArtifacts.Extension)</UploadFileNameShort>

View File

@ -7,6 +7,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openrct2", "openrct2.vcxpro
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpaint", "test\testpaint\testpaint.vcxproj", "{57E60BA1-FB76-4316-909E-C1449C142327}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "test\tests\tests.vcxproj", "{62B020FA-E4FB-4C6E-B32A-DC999470F155}"
ProjectSection(ProjectDependencies) = postProject
{D24D94F6-2A74-480C-B512-629C306CE92F} = {D24D94F6-2A74-480C-B512-629C306CE92F}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{2202A816-377D-4FA0-A7AF-7D4105F8A4FB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{480B577D-4E4A-4757-9A42-28A9AD33E6B0}"
@ -15,24 +20,51 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
DebugTests|Win32 = DebugTests|Win32
DebugTests|x64 = DebugTests|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
ReleaseTests|Win32 = ReleaseTests|Win32
ReleaseTests|x64 = ReleaseTests|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|Win32.ActiveCfg = Debug|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|Win32.Build.0 = Debug|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|x64.ActiveCfg = Debug|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|x64.Build.0 = Debug|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|Win32.ActiveCfg = DebugTests|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|Win32.Build.0 = DebugTests|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|x64.ActiveCfg = DebugTests|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|x64.Build.0 = DebugTests|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.Release|Win32.ActiveCfg = Release|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.Release|Win32.Build.0 = Release|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.Release|x64.ActiveCfg = Release|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.Release|x64.Build.0 = Release|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|Win32.ActiveCfg = ReleaseTests|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|Win32.Build.0 = ReleaseTests|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|x64.ActiveCfg = ReleaseTests|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|x64.Build.0 = ReleaseTests|x64
{57E60BA1-FB76-4316-909E-C1449C142327}.Debug|Win32.ActiveCfg = Debug|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.Debug|Win32.Build.0 = Debug|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.Debug|x64.ActiveCfg = Debug|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.DebugTests|Win32.ActiveCfg = Debug|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.DebugTests|x64.ActiveCfg = Debug|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.Release|Win32.ActiveCfg = Release|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.Release|Win32.Build.0 = Release|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.Release|x64.ActiveCfg = Release|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.ReleaseTests|Win32.ActiveCfg = Release|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.ReleaseTests|x64.ActiveCfg = Release|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|Win32.ActiveCfg = DebugTests|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|x64.ActiveCfg = DebugTests|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|Win32.ActiveCfg = DebugTests|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|Win32.Build.0 = DebugTests|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|x64.ActiveCfg = DebugTests|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|x64.Build.0 = DebugTests|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|Win32.ActiveCfg = ReleaseTests|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|x64.ActiveCfg = ReleaseTests|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|Win32.ActiveCfg = ReleaseTests|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|Win32.Build.0 = ReleaseTests|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|x64.ActiveCfg = ReleaseTests|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|x64.Build.0 = ReleaseTests|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -40,5 +72,6 @@ Global
GlobalSection(NestedProjects) = preSolution
{D24D94F6-2A74-480C-B512-629C306CE92F} = {2202A816-377D-4FA0-A7AF-7D4105F8A4FB}
{57E60BA1-FB76-4316-909E-C1449C142327} = {480B577D-4E4A-4757-9A42-28A9AD33E6B0}
{62B020FA-E4FB-4C6E-B32A-DC999470F155} = {480B577D-4E4A-4757-9A42-28A9AD33E6B0}
EndGlobalSection
EndGlobal

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="'$(SolutionDir)'==''">.\</SolutionDir>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -9,6 +12,14 @@
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugTests|Win32">
<Configuration>DebugTests</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugTests|x64">
<Configuration>DebugTests</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -17,7 +28,52 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseTests|Win32">
<Configuration>ReleaseTests</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseTests|x64">
<Configuration>ReleaseTests</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D24D94F6-2A74-480C-B512-629C306CE92F}</ProjectGuid>
<RootNamespace>openrct2</RootNamespace>
<ProjectName>openrct2</ProjectName>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<!-- Debug|Win32 is reserved for RCT2 interop builds, this means it has to be a DLL -->
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='DebugTests' OR '$(Configuration)'=='ReleaseTests'">
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="openrct2.common.props" />
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions Condition="'$(Breakpad)'=='true'">USE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)'=='DebugTests' OR '$(Configuration)'=='ReleaseTests'">__NOENTRYPOINT__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<AdditionalOptions>$(OPENRCT2_CL_ADDITIONALOPTIONS) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem Condition="'$(Configuration)'!='Release'">Console</SubSystem>
<SubSystem Condition="'$(Configuration)'=='Release'">Windows</SubSystem>
</Link>
<Lib>
<TargetMachine Condition="'$(Platform)'=='Win32'">MachineX86</TargetMachine>
<TargetMachine Condition="'$(Platform)'=='x64'">MachineX64</TargetMachine>
</Lib>
</ItemDefinitionGroup>
<!-- Files -->
<ItemGroup>
<None Include="data\shaders\copyframebuffer.frag" />
<None Include="data\shaders\copyframebuffer.vert" />
@ -89,6 +145,7 @@
<ClCompile Include="src\interface\colour.c" />
<ClCompile Include="src\interface\Theme.cpp" />
<ClCompile Include="src\interface\console.c" />
<ClCompile Include="src\interface\Fonts.cpp" />
<ClCompile Include="src\interface\graph.c" />
<ClCompile Include="src\interface\keyboard_shortcut.c" />
<ClCompile Include="src\interface\screenshot.c" />
@ -101,6 +158,7 @@
<ClCompile Include="src\localisation\convert.c" />
<ClCompile Include="src\localisation\currency.c" />
<ClCompile Include="src\localisation\date.c" />
<ClCompile Include="src\localisation\format_codes.c" />
<ClCompile Include="src\localisation\language.cpp" />
<ClCompile Include="src\localisation\LanguagePack.cpp" />
<ClCompile Include="src\localisation\localisation.c" />
@ -170,6 +228,7 @@
<ClCompile Include="src\rct1\S4Importer.cpp" />
<ClCompile Include="src\rct1\Tables.cpp" />
<ClCompile Include="src\rct2.c" />
<ClCompile Include="src\rct2\interop.c" />
<ClCompile Include="src\rct2\S6Exporter.cpp" />
<ClCompile Include="src\rct2\S6Importer.cpp" />
<ClCompile Include="src\ride\cable_lift.c" />
@ -417,6 +476,7 @@
<ClInclude Include="src\interface\colour.h" />
<ClInclude Include="src\interface\themes.h" />
<ClInclude Include="src\interface\console.h" />
<ClInclude Include="src\interface\Fonts.h" />
<ClInclude Include="src\interface\graph.h" />
<ClInclude Include="src\interface\keyboard_shortcut.h" />
<ClInclude Include="src\interface\screenshot.h" />
@ -485,6 +545,7 @@
<ClInclude Include="src\rct1\Tables.h" />
<ClInclude Include="src\rct1\S4Importer.h" />
<ClInclude Include="src\rct2.h" />
<ClInclude Include="src\rct2\interop.h" />
<ClInclude Include="src\rct2\S6Exporter.h" />
<ClInclude Include="src\rct2\S6Importer.h" />
<ClInclude Include="src\ride\cable_lift.h" />
@ -532,186 +593,5 @@
<ItemGroup>
<Image Include="resources\logo\icon.ico" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D24D94F6-2A74-480C-B512-629C306CE92F}</ProjectGuid>
<RootNamespace>openrct2</RootNamespace>
<ProjectName>openrct2</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(SolutionDir)\openrct2.common.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)lib;$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>$(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\</IntDir>
<LinkIncremental />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)lib;$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>$(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)lib;$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>$(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\</IntDir>
<LinkIncremental />
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(SolutionDir)lib\include;$(SolutionDir)lib\include\breakpad;$(SolutionDir)lib\include\libspeex;$(SolutionDir)lib\include\sdl;$(SolutionDir)lib\include\jansson;$(SolutionDir)lib\include\sdl_ttf;$(SolutionDir)lib\include\libpng;$(SolutionDir)lib\include\zlib;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)lib;$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>$(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\</IntDir>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Breakpad)'=='true'">
<ClCompile>
<PreprocessorDefinitions>USE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<DisableSpecificWarnings>4091;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>DEBUG;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<TreatSpecificWarningsAsErrors>4013</TreatSpecificWarningsAsErrors>
<MinimalRebuild>false</MinimalRebuild>
<TreatWarningAsError>true</TreatWarningAsError>
<AdditionalOptions>$(OPENRCT2_CL_ADDITIONALOPTIONS)</AdditionalOptions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>openrct2-libs-vs2015-x86.lib;imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>UseFastLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<AdditionalOptions>/OPT:NOLBR /ignore:4099 %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<DisableSpecificWarnings>4091;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<WarningLevel>Level3</WarningLevel>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck />
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatSpecificWarningsAsErrors>4013</TreatSpecificWarningsAsErrors>
<OmitFramePointers />
<BufferSecurityCheck>false</BufferSecurityCheck>
<PreprocessorDefinitions>NO_RCT2;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<TreatWarningAsError>true</TreatWarningAsError>
<AdditionalOptions>$(OPENRCT2_CL_ADDITIONALOPTIONS)</AdditionalOptions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>openrct2-libs-vs2015-x86.lib;imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
<SubSystem>Windows</SubSystem>
</Link>
<Manifest>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<DisableSpecificWarnings>4091;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>DEBUG;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<TreatSpecificWarningsAsErrors>4013</TreatSpecificWarningsAsErrors>
<MinimalRebuild>false</MinimalRebuild>
<TreatWarningAsError>true</TreatWarningAsError>
<AdditionalOptions>$(OPENRCT2_CL_ADDITIONALOPTIONS)</AdditionalOptions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>openrct2-libs-vs2015-x64.lib;imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>UseFastLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<AdditionalOptions>/OPT:NOLBR /ignore:4099 %(AdditionalOptions)</AdditionalOptions>
<SubSystem>Console</SubSystem>
</Link>
<Manifest>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<DisableSpecificWarnings>4091;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<WarningLevel>Level3</WarningLevel>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck />
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatSpecificWarningsAsErrors>4013</TreatSpecificWarningsAsErrors>
<OmitFramePointers />
<BufferSecurityCheck>false</BufferSecurityCheck>
<PreprocessorDefinitions>OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<TreatWarningAsError>true</TreatWarningAsError>
<AdditionalOptions>$(OPENRCT2_CL_ADDITIONALOPTIONS)</AdditionalOptions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>openrct2-libs-vs2015-x64.lib;imm32.lib;version.lib;winmm.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
<SubSystem>Windows</SubSystem>
</Link>
<Manifest>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>

View File

@ -79,7 +79,7 @@ All libs listed here (bar cmake) required in 32 bit variants.
### Windows:
1. Check out the repository. This can be done using [GitHub Desktop](https://desktop.github.com) or [other tools](https://help.github.com/articles/which-remote-url-should-i-use).
2. Open a new Developer Command Prompt for VS2015, then navigate to the repository (e.g. `cd C:\GitHub\OpenRCT2`).
3. Run `msbuild openrct2.proj /t:build /t:platform=x64`.
3. Run `msbuild openrct2.proj /t:build /p:platform=x64`.
4. Run the game, `bin\openrct2`
Once you have ran msbuild once, further development can be done within Visual Studio by opening `openrct2.sln`.

View File

@ -75,7 +75,7 @@ pushd build
chmod a+rwx $(pwd)
chmod g+s $(pwd)
# CMAKE and MAKE opts from environment
docker run -v $PARENT:/work/openrct2 -w /work/openrct2/build -i -t openrct2/openrct2:64bit-only bash -c "cmake ../ $OPENRCT2_CMAKE_OPTS && make $OPENRCT_MAKE_OPTS"
docker run -v $PARENT:/work/openrct2 -w /work/openrct2/build -i -t openrct2/openrct2:64bit-only bash -c "cmake ../ -DWITH_TESTS=on $OPENRCT2_CMAKE_OPTS && make $OPENRCT_MAKE_OPTS && make test ARGS=\"-V\""
elif [[ $TARGET == "linux" ]]
then
cmake $OPENRCT2_CMAKE_OPTS .. -DCMAKE_BUILD_TYPE=debug

View File

@ -2,20 +2,24 @@
# Script to deploy OpenRCT2 from AppVeyor #
###########################################
# Check if OpenRCT2.org API security token is available
if (${env:OPENRCT2_ORG_TOKEN})
$testing = (${env:Configuration} -like "*tests")
if (-not $testing)
{
# Only upload tagged builds, develop branch or push/ branches
if (${env:APPVEYOR_REPO_TAG} -eq "true" -or ${env:APPVEYOR_REPO_BRANCH} -match "^develop$|^push/")
# Check if OpenRCT2.org API security token is available
if (${env:OPENRCT2_ORG_TOKEN})
{
msbuild openrct2.proj /t:UploadArtifacts /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
# Only upload tagged builds, develop branch or push/ branches
if (${env:APPVEYOR_REPO_TAG} -eq "true" -or ${env:APPVEYOR_REPO_BRANCH} -match "^develop$|^push/")
{
msbuild openrct2.proj /t:UploadArtifacts /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
}
else
{
Write-Host "No deployment: Non-tagged or push branch." -ForegroundColor Yellow
}
}
else
{
Write-Host "No deployment: Non-tagged or push branch." -ForegroundColor Yellow
Write-Host "No deployment: %OPENRCT2_ORG_TOKEN% not available." -ForegroundColor Yellow
}
}
else
{
Write-Host "No deployment: %OPENRCT2_ORG_TOKEN% not available." -ForegroundColor Yellow
}

View File

@ -2,6 +2,8 @@
# Script to setup OpenRCT2 for building on AppVeyor
#########################################################
$testing = (${env:Configuration} -like "*tests")
function Check-ExitCode
{
if ($LASTEXITCODE -ne 0)
@ -10,7 +12,7 @@ function Check-ExitCode
}
}
if ($env:ENCKEY)
if ($env:ENCKEY -and -not $testing)
{
if (-not (Test-Path "secure-file"))
{
@ -24,7 +26,7 @@ if ($env:ENCKEY)
}
# Check if OpenRCT2.org API security token is available
if (${env:OPENRCT2_ORG_TOKEN})
if (${env:OPENRCT2_ORG_TOKEN} -and -not $testing)
{
if (-not (Test-Path "C:\ProgramData\chocolatey\lib\nsis.portable"))
{

View File

@ -31,6 +31,7 @@ extern "C"
#include "config.h"
#include "localisation/localisation.h"
#include "scenario.h"
#include "rct2.h"
}
static int ScenarioCategoryCompare(int categoryA, int categoryB)

View File

@ -16,18 +16,13 @@
#include "../config.h"
#include "../interface/viewport.h"
#include "../interface/window.h"
#include "../intro.h"
#include "../localisation/language.h"
#include "../platform/platform.h"
#include "../ride/ride.h"
#include "../world/map.h"
#include "../world/sprite.h"
#include "audio.h"
#include "mixer.h"
#include "../localisation/string_ids.h"
#include "../openrct2.h"
#include "../util/util.h"
#include "../localisation/string_ids.h"
#include "../intro.h"
#include "audio.h"
#include "mixer.h"
typedef struct rct_audio_params {
bool in_range;

View File

@ -17,9 +17,10 @@
#include "../core/Guard.hpp"
extern "C" {
#include "../config.h"
#include "../platform/platform.h"
#include "../localisation/localisation.h"
#include "../openrct2.h"
#include "../platform/platform.h"
#include "../rct2.h"
#include "audio.h"
}
#include "mixer.h"

View File

@ -25,9 +25,9 @@
extern "C"
{
#include "../game.h"
#include "../scenario.h"
#include "../openrct2.h"
#include "../interface/window.h"
#include "../openrct2.h"
#include "../rct2.h"
}
static void WriteConvertFromAndToMessage(uint32 sourceFileType, uint32 destinationFileType);

View File

@ -17,8 +17,166 @@
#ifndef _COMMON_H_
#define _COMMON_H_
#include <SDL_platform.h>
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#undef M_PI
#ifdef _MSC_VER
#include <time.h>
#endif
#include <assert.h>
#include <limits.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "diagnostic.h"
#include "rct2.h"
typedef int8_t sint8;
typedef int16_t sint16;
typedef int32_t sint32;
typedef int64_t sint64;
typedef uint8_t uint8;
typedef uint16_t uint16;
typedef uint32_t uint32;
typedef uint64_t uint64;
typedef char utf8;
typedef utf8* utf8string;
typedef const utf8* const_utf8string;
#ifdef __WINDOWS__
typedef wchar_t utf16;
typedef utf16* utf16string;
#endif
typedef uint32 codepoint_t;
typedef uint8 colour_t;
#define rol8(x, shift) (((uint8)(x) << (shift)) | ((uint8)(x) >> (8 - (shift))))
#define ror8(x, shift) (((uint8)(x) >> (shift)) | ((uint8)(x) << (8 - (shift))))
#define rol16(x, shift) (((uint16)(x) << (shift)) | ((uint16)(x) >> (16 - (shift))))
#define ror16(x, shift) (((uint16)(x) >> (shift)) | ((uint16)(x) << (16 - (shift))))
#define rol32(x, shift) (((uint32)(x) << (shift)) | ((uint32)(x) >> (32 - (shift))))
#define ror32(x, shift) (((uint32)(x) >> (shift)) | ((uint32)(x) << (32 - (shift))))
#define rol64(x, shift) (((uint64)(x) << (shift)) | ((uint32)(x) >> (64 - (shift))))
#define ror64(x, shift) (((uint64)(x) >> (shift)) | ((uint32)(x) << (64 - (shift))))
#ifndef __cplusplus
// in C++ you should be using Math::Min and Math::Max
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#endif // __cplusplus
#define sgn(x) ((x > 0) ? 1 : ((x < 0) ? -1 : 0))
#define clamp(l, x, h) (min(h, max(l, x)))
// Rounds an integer down to the given power of 2. y must be a power of 2.
#define floor2(x, y) ((x) & (~((y) - 1)))
// Rounds an integer up to the given power of 2. y must be a power of 2.
#define ceil2(x, y) (((x) + (y) - 1) & (~((y) - 1)))
#ifndef __cplusplus
// in C++ you should be using Util::CountOf
#ifdef __GNUC__
/**
* Force a compilation error if condition is true, but also produce a
* result (of value 0 and type size_t), so the expression can be used
* e.g. in a structure initializer (or where-ever else comma expressions
* aren't permitted).
*/
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
/* &a[0] degrades to a pointer: a different type from an array */
#define __must_be_array(a) \
BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
// based on http://lxr.free-electrons.com/source/include/linux/kernel.h#L54
#define countof(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
#elif defined (_MSC_VER)
#define countof(arr) _countof(arr)
#else
#define countof(arr) (sizeof(arr) / sizeof((arr)[0]))
#endif // __GNUC__
#endif // __cplusplus
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
#include <unistd.h>
#define STUB() log_warning("Function %s at %s:%d is a stub.\n", __PRETTY_FUNCTION__, __FILE__, __LINE__)
#define _strcmpi _stricmp
#define _stricmp(x, y) strcasecmp((x), (y))
#define _strnicmp(x, y, n) strncasecmp((x), (y), (n))
#define _strdup(x) strdup((x))
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define RCT2_ENDIANESS __ORDER_LITTLE_ENDIAN__
#define LOBYTE(w) ((uint8)(w))
#define HIBYTE(w) ((uint8)(((uint16)(w)>>8)&0xFF))
#endif // __BYTE_ORDER__
#ifndef RCT2_ENDIANESS
#error Unknown endianess!
#endif // RCT2_ENDIANESS
#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
#if !((defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700))
char *strndup(const char *src, size_t size);
#endif // !(POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)
// BSD and macOS have MAP_ANON instead of MAP_ANONYMOUS
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif
#include "version.h"
#define OPENRCT2_MASTER_SERVER_URL "https://servers.openrct2.website"
// Time (represented as number of 100-nanosecond intervals since 0001-01-01T00:00:00Z)
typedef uint64 datetime64;
#define DATETIME64_MIN ((datetime64)0)
// Represent fixed point numbers. dp = decimal point
typedef uint8 fixed8_1dp;
typedef uint8 fixed8_2dp;
typedef sint16 fixed16_1dp;
typedef sint16 fixed16_2dp;
typedef sint32 fixed32_1dp;
typedef sint32 fixed32_2dp;
// Money is stored as a multiple of 0.10.
typedef fixed8_1dp money8;
typedef fixed16_1dp money16;
typedef fixed32_1dp money32;
// Construct a fixed point number. For example, to create the value 3.65 you
// would write FIXED_2DP(3,65)
#define FIXED_XDP(x, whole, fraction) ((whole) * (10 * x) + (fraction))
#define FIXED_1DP(whole, fraction) FIXED_XDP(1, whole, fraction)
#define FIXED_2DP(whole, fraction) FIXED_XDP(10, whole, fraction)
// Construct a money value in the format MONEY(10,70) to represent 10.70. Fractional part must be two digits.
#define MONEY(whole, fraction) ((whole) * 10 + ((fraction) / 10))
#define MONEY_FREE MONEY(0,00)
#define MONEY32_UNDEFINED ((money32)0x80000000)
typedef void (EMPTY_ARGS_VOID_POINTER)();
typedef unsigned short rct_string_id;
#define SafeFree(x) do { free(x); (x) = NULL; } while (0)

View File

@ -334,7 +334,6 @@ sound_configuration gConfigSound;
twitch_configuration gConfigTwitch;
network_configuration gConfigNetwork;
notification_configuration gConfigNotifications;
font_configuration gConfigFonts;
title_sequences_configuration gConfigTitleSequences;
static bool config_open(const utf8string path);

View File

@ -21,6 +21,8 @@ extern "C"
#include "../common.h"
}
#include <cstdarg>
namespace Console
{
void Write(char c);

View File

@ -26,6 +26,11 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#elif defined(__WINDOWS__)
extern "C" {
// Windows needs this for widechar <-> utf8 conversion utils
#include "../localisation/language.h"
}
#endif
#include <stack>
@ -37,7 +42,6 @@
extern "C"
{
#include "../localisation/localisation.h"
#include "../platform/platform.h"
}

View File

@ -18,11 +18,6 @@
#include "../common.h"
struct DirectoryInfo
{
const utf8 * Name;
};
struct FileInfo
{
const utf8 * Name;

View File

@ -78,7 +78,12 @@ namespace Guard
char *bufend = (char *)strchr(buffer, 0);
vsnprintf(bufend, sizeof(buffer) - (bufend - buffer), message, args);
}
int result = MessageBox(nullptr, buffer, OPENRCT2_NAME, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION);
#ifdef __TEST__
// Abort if we are building for testing
abort();
#else
// Show message box if we are not building for testing
int result = MessageBoxA(nullptr, buffer, OPENRCT2_NAME, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION);
if (result == IDABORT)
{
#ifdef USE_BREAKPAD
@ -88,6 +93,7 @@ namespace Guard
assert(false);
#endif
}
#endif
#else
assert(false);
#endif

View File

@ -16,9 +16,10 @@
#pragma once
#include <cstring>
#include <typeinfo>
#include "../common.h"
#include "Guard.hpp"
#include <typeinfo>
/**
* Utility methods for memory management. Typically helpers and wrappers around the C standard library.

View File

@ -61,7 +61,7 @@ namespace DrawingEngineFactory
IDrawingEngine * CreateSoftware();
IDrawingEngine * CreateSoftwareWithHardwareDisplay();
IDrawingEngine * CreateOpenGL();
};
}
interface IRainDrawer
{

View File

@ -26,6 +26,7 @@ extern "C"
#include "../interface/screenshot.h"
#include "../localisation/string_ids.h"
#include "../platform/platform.h"
#include "../rct2.h"
}
static sint32 _drawingEngineType = DRAWING_ENGINE_SOFTWARE;

View File

@ -16,11 +16,16 @@
#pragma once
#include <SDL_video.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include "../rct2.h"
#include "drawing.h"
extern rct_string_id DrawingEngineStringIds[3];
sint32 drawing_engine_get_type();

View File

@ -15,10 +15,11 @@
#pragma endregion
#include "../common.h"
#include "../localisation/localisation.h"
#include "../interface/window.h"
#include "../platform/platform.h"
#include "../localisation/localisation.h"
#include "../object.h"
#include "../platform/platform.h"
#include "../rct2.h"
#include "../world/water.h"
#include "drawing.h"

View File

@ -29,6 +29,7 @@ extern "C"
#include "../../interface/viewport.h"
#include "../../interface/window.h"
#include "../../intro.h"
#include "../../rct2.h"
#include "../drawing.h"
#include "../lightfx.h"
}

View File

@ -19,6 +19,7 @@
#include "../../../common.h"
#include "OpenGLAPI.h"
#include "GLSLTypes.h"
#include "TextureCache.h"
struct DrawRectCommand {
uint32 flags;
@ -43,4 +44,4 @@ struct DrawImageCommand {
CachedTextureInfo texPalette;
sint32 bounds[4];
bool mask;
};
};

View File

@ -16,6 +16,7 @@
#ifndef DISABLE_OPENGL
#include "../../../common.h"
#include <SDL_video.h>
#include "../../../core/Memory.hpp"
#include "OpenGLFramebuffer.h"

View File

@ -17,7 +17,6 @@
#include "../addresses.h"
#include "../common.h"
#include "../openrct2.h"
#include "../platform/platform.h"
#include "../sprites.h"
#include "../util/util.h"
#include "drawing.h"

View File

@ -16,13 +16,9 @@
#include "../interface/colour.h"
#include "../interface/viewport.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../platform/platform.h"
#include "../sprites.h"
#include "../util/util.h"
#include "../world/map.h"
#include "drawing.h"
enum {
TEXT_DRAW_FLAG_INSET = 1 << 0,

View File

@ -27,9 +27,12 @@
#include "hook.h"
#include "platform/platform.h"
void* g_hooktableaddress = 0;
int g_hooktableoffset = 0;
int g_maxhooks = 1000;
void* _hookTableAddress = 0;
int _hookTableOffset = 0;
int _maxHooks = 1000;
#define HOOK_BYTE_COUNT (140)
registers gHookRegisters = {0};
// This macro writes a little-endian 4-byte long value into *data
// It is used to avoid type punning.
@ -39,165 +42,115 @@ int g_maxhooks = 1000;
*(data + 2) = ((addr) & 0x00ff0000) >> 16; \
*(data + 3) = ((addr) & 0xff000000) >> 24;
static void hookfunc(int address, int newaddress, int stacksize, int registerargs[], int registersreturned, int eaxDestinationRegister)
static void hookfunc(uintptr_t address, uintptr_t hookAddress, int stacksize)
{
int i = 0;
char data[100];
uint8 data[HOOK_BYTE_COUNT] = {0};
registersreturned |= eaxDestinationRegister;
uintptr_t registerAddress = (uintptr_t) &gHookRegisters;
int registerssaved = 7;
int n = registersreturned;
for (; n; registerssaved--) {
n &= n - 1;
}
int numrargs = 0;
for (int j = 0; ; j++) {
if (registerargs[j] != END) {
numrargs++;
} else {
break;
}
}
data[i++] = 0x89; // mov [gHookRegisters], eax
data[i++] = (0b000 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress);
i += 4;
int rargssize = numrargs * 4;
data[i++] = 0x89; // mov [gHookRegisters + 4], ebx
data[i++] = (0b011 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress + 4);
i += 4;
if (!(registersreturned & EAX)) {
data[i++] = 0x50; // push eax
}
if (!(registersreturned & EBX)) {
data[i++] = 0x53; // push ebx
}
if (!(registersreturned & ECX)) {
data[i++] = 0x51; // push ecx
}
if (!(registersreturned & EDX)) {
data[i++] = 0x52; // push edx
}
if (!(registersreturned & EBP)) {
data[i++] = 0x55; // push ebp
}
if (!(registersreturned & ESI)) {
data[i++] = 0x56; // push esi
}
if (!(registersreturned & EDI)) {
data[i++] = 0x57; // push edi
}
data[i++] = 0x89; // mov [gHookRegisters + 8], ecx
data[i++] = (0b001 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress + 8);
i += 4;
data[i++] = 0x50; //push eax
data[i++] = 0x89; //mov eax, esp
data[i++] = 0xE0;
data[i++] = 0x83; //sub eax, (0xC + numargs*4) & 0xF
data[i++] = 0xE8;
data[i++] = (0xC + numrargs * 4) & 0xF;
data[i++] = 0x83; //and eax, 0xC
data[i++] = 0xE0;
data[i++] = 0x0C;
data[i++] = 0xA3; //mov [0x9ABDA8], eax
data[i++] = 0xA8;
data[i++] = 0xBD;
data[i++] = 0x9A;
data[i++] = 0x00;
data[i++] = 0x58; //pop eax
data[i++] = 0x2B; //sub esp, [0x9ABDA8]
data[i++] = 0x25;
data[i++] = 0xA8;
data[i++] = 0xBD;
data[i++] = 0x9A;
data[i++] = 0x00;
data[i++] = 0x89; // mov [gHookRegisters + 12], edx
data[i++] = (0b010 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress + 12);
i += 4;
data[i++] = 0x89; // mov [gHookRegisters + 16], esi
data[i++] = (0b110 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress + 16);
i += 4;
data[i++] = 0x89; // mov [gHookRegisters + 20], edi
data[i++] = (0b111 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress + 20);
i += 4;
data[i++] = 0x89; // mov [gHookRegisters + 24], ebp
data[i++] = (0b101 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress + 24);
i += 4;
// work out distance to nearest 0xC
// (esp - numargs * 4) & 0xC
// move to align - 4
// save that amount
if (numrargs > 0) {
// push the registers to be on the stack to access as arguments
for (signed int j = numrargs - 1; j >= 0; j--) {
switch (registerargs[j]) {
case EAX: data[i++] = 0x50; break;
case EBX: data[i++] = 0x53; break;
case ECX: data[i++] = 0x51; break;
case EDX: data[i++] = 0x52; break;
case ESI: data[i++] = 0x56; break;
case EDI: data[i++] = 0x57; break;
case EBP: data[i++] = 0x55; break;
}
}
}
// push the registers to be on the stack to access as arguments
data[i++] = 0x68; // push gHookRegisters
write_address_strictalias(&data[i], registerAddress);
i += 4;
data[i++] = 0xE8; // call
write_address_strictalias(&data[i], newaddress - address - i - 4);
write_address_strictalias(&data[i], hookAddress - address - i - 4);
i += 4;
// returnlocation:
switch (eaxDestinationRegister) {
case EBX:
// mov ebx, eax
data[i++] = 0x8B;
data[i++] = 0xD8;
break;
case ECX:
// mov ecx, eax
data[i++] = 0x8B;
data[i++] = 0xC8;
break;
case EDX:
// mov ecx, eax
data[i++] = 0x8B;
data[i++] = 0xD0;
break;
case ESI:
// mov ecx, eax
data[i++] = 0x8B;
data[i++] = 0xF0;
break;
case EDI:
// mov ecx, eax
data[i++] = 0x8B;
data[i++] = 0xF8;
break;
case EBP:
// mov ecx, eax
data[i++] = 0x8B;
data[i++] = 0xE8;
break;
}
data[i++] = 0x83; // add esp, 4
data[i++] = 0xC4;
data[i++] = 0x04;
data[i++] = 0x83; // sub esp, x
data[i++] = 0xEC;
data[i++] = (signed char)(stacksize * -4) - rargssize;
data[i++] = 0x03; //add esp, [0x9ABDA8]
data[i++] = 0x25;
data[i++] = 0xA8;
data[i++] = 0xBD;
data[i++] = 0x9A;
data[i++] = 0x25; // and eax,0xff
data[i++] = 0xff;
data[i++] = 0x00;
data[i++] = 0x00;
data[i++] = 0x00;
data[i++] = 0xc1; // shl eax, 8
data[i++] = 0xe0;
data[i++] = 0x08;
data[i++] = 0x9e; // sahf
data[i++] = 0x9c; // pushf
if (!(registersreturned & EDI)) {
data[i++] = 0x5F; // pop edi
}
if (!(registersreturned & ESI)) {
data[i++] = 0x5E; // pop esi
}
if (!(registersreturned & EBP)) {
data[i++] = 0x5D; // pop ebp
}
if (!(registersreturned & EDX)) {
data[i++] = 0x5A; // pop edx
}
if (!(registersreturned & ECX)) {
data[i++] = 0x59; // pop ecx
}
if (!(registersreturned & EBX)) {
data[i++] = 0x5B; // pop ebx
}
if (!(registersreturned & EAX)) {
data[i++] = 0x58; // pop eax
}
data[i++] = 0x8B; // mov eax, [gHookRegisters]
data[i++] = (0b000 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress);
i += 4;
data[i++] = 0x8B; // mov ebx, [gHookRegisters + 4]
data[i++] = (0b011 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress + 4);
i += 4;
data[i++] = 0x8B; // mov ecx, [gHookRegisters + 8]
data[i++] = (0b001 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress + 8);
i += 4;
data[i++] = 0x8B; // mov edx, [gHookRegisters + 12]
data[i++] = (0b010 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress + 12);
i += 4;
data[i++] = 0x8B; // mov esi, [gHookRegisters + 16]
data[i++] = (0b110 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress + 16);
i += 4;
data[i++] = 0x8B; // mov edi, [gHookRegisters + 20]
data[i++] = (0b111 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress + 20);
i += 4;
data[i++] = 0x8B; // mov ebp, [gHookRegisters + 24]
data[i++] = (0b101 << 3) | 0b101;
write_address_strictalias(&data[i], registerAddress + 24);
i += 4;
data[i++] = 0x9d; // popf
data[i++] = 0xC3; // retn
@ -209,26 +162,26 @@ static void hookfunc(int address, int newaddress, int stacksize, int registerarg
#endif // __WINDOWS__
}
void addhook(int address, int newaddress, int stacksize, int registerargs[], int registersreturned, int eaxDestinationRegister)
void addhook(uintptr_t address, hook_function *function)
{
if (!g_hooktableaddress) {
size_t size = g_maxhooks * 100;
if (!_hookTableAddress) {
size_t size = _maxHooks * HOOK_BYTE_COUNT;
#ifdef __WINDOWS__
g_hooktableaddress = VirtualAllocEx(GetCurrentProcess(), NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
_hookTableAddress = VirtualAllocEx(GetCurrentProcess(), NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
#else
g_hooktableaddress = mmap(NULL, size, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (g_hooktableaddress == MAP_FAILED)
_hookTableAddress = mmap(NULL, size, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (_hookTableAddress == MAP_FAILED)
{
perror("mmap");
exit(1);
}
#endif // __WINDOWS__
}
if (g_hooktableoffset > g_maxhooks) {
if (_hookTableOffset > _maxHooks) {
return;
}
unsigned int hookaddress = (unsigned int)g_hooktableaddress + (g_hooktableoffset * 100);
char data[9];
unsigned int hookaddress = (unsigned int)_hookTableAddress + (_hookTableOffset * HOOK_BYTE_COUNT);
uint8 data[9];
int i = 0;
data[i++] = 0xE9; // jmp
@ -254,8 +207,8 @@ void addhook(int address, int newaddress, int stacksize, int registerargs[], int
perror("mprotect");
}
#endif // __WINDOWS__
hookfunc(hookaddress, newaddress, stacksize, registerargs, registersreturned, eaxDestinationRegister);
g_hooktableoffset++;
hookfunc(hookaddress, (uintptr_t)function, 0);
_hookTableOffset++;
}
#endif

View File

@ -19,18 +19,21 @@
#ifndef NO_RCT2
enum REGISTER_ARGS {
EAX = 1 << 0,
EBX = 1 << 1,
ECX = 1 << 2,
EDX = 1 << 3,
ESI = 1 << 4,
EDI = 1 << 5,
EBP = 1 << 6,
END = 0
#include "common.h"
enum {
X86_FLAG_CARRY = 1 << 0,
X86_FLAG_PARITY = 1 << 2,
X86_FLAG_ADJUST = 1 << 4,
X86_FLAG_ZERO = 1 << 6,
X86_FLAG_SIGN = 1 << 7,
};
void addhook(int address, int newaddress, int stacksize, int registerargs[], int registersreturned, int eaxDestinationRegister);
typedef uint8 (hook_function)(registers *regs);
void addhook(uintptr_t address, hook_function *function);
#endif

View File

@ -37,6 +37,7 @@
#include "world/sprite.h"
#include "world/scenery.h"
#include "openrct2.h"
#include "rct2.h"
typedef struct rct_mouse_data {
uint32 x;
@ -103,7 +104,7 @@ static void input_window_resize_end();
static void input_viewport_drag_begin(rct_window *w, int x, int y);
static void input_viewport_drag_continue();
static void input_viewport_drag_end();
static void input_scroll_begin();
static void input_scroll_begin(rct_window *w, int widgetIndex, int x, int y);
static void input_scroll_continue(rct_window *w, int widgetIndex, int state, int x, int y);
static void input_scroll_end();
static void input_scroll_part_update_hthumb(rct_window *w, int widgetIndex, int x, int scroll_id);

157
src/interface/Fonts.cpp Normal file
View File

@ -0,0 +1,157 @@
#pragma region Copyright(c) 2014 - 2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include "../common.h"
#include "../core/Console.hpp"
#include "../core/String.hpp"
#include "../localisation/LanguagePack.h"
#include "Fonts.h"
extern "C" {
#include "../config.h"
#include "../drawing/drawing.h"
#include "../localisation/language.h"
font_configuration gConfigFonts;
}
static TTFFontSetDescriptor TTFFontMSGothic = { {
{ "msgothic.ttc", "MS PGothic", 9, 1, 0, 15, nullptr },
{ "msgothic.ttc", "MS PGothic", 12, 1, 0, 17, nullptr },
{ "msgothic.ttc", "MS PGothic", 12, 1, 0, 17, nullptr },
{ "msgothic.ttc", "MS PGothic", 13, 1, 0, 20, nullptr },
} };
static TTFFontSetDescriptor TTFFontMingLiu = { {
{ "msjh.ttc", "JhengHei", 9, -1, -3, 6, nullptr },
{ "mingliu.ttc", "MingLiU", 11, 1, 1, 12, nullptr },
{ "mingliu.ttc", "MingLiU", 12, 1, 0, 12, nullptr },
{ "mingliu.ttc", "MingLiU", 13, 1, 0, 20, nullptr },
} };
static TTFFontSetDescriptor TTFFontSimSun = { {
{ "msyh.ttc", "YaHei", 9, -1, -3, 6, nullptr },
{ "simsun.ttc", "SimSun", 11, 1, -1, 14, nullptr },
{ "simsun.ttc", "SimSun", 12, 1, -2, 14, nullptr },
{ "simsun.ttc", "SimSun", 13, 1, 0, 20, nullptr },
} };
static TTFFontSetDescriptor TTFFontGulim = { {
{ "gulim.ttc", "Gulim", 11, 1, 0, 15, nullptr },
{ "gulim.ttc", "Gulim", 12, 1, 0, 17, nullptr },
{ "gulim.ttc", "Gulim", 12, 1, 0, 17, nullptr },
{ "gulim.ttc", "Gulim", 13, 1, 0, 20, nullptr },
} };
static TTFFontSetDescriptor TTFFontArial = { {
{ "arial.ttf", "Arial", 8, 0, -1, 6, nullptr },
{ "arial.ttf", "Arial", 10, 0, -1, 12, nullptr },
{ "arial.ttf", "Arial", 11, 0, -1, 12, nullptr },
{ "arial.ttf", "Arial", 12, 0, -1, 20, nullptr },
} };
const language_descriptor LanguagesDescriptors[LANGUAGE_COUNT] = {
{ "", "", "", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_UNDEFINED
{ "en-GB", "English (UK)", "English (UK)", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_ENGLISH_UK
{ "en-US", "English (US)", "English (US)", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ENGLISH_US }, // LANGUAGE_ENGLISH_US
{ "de-DE", "German", "Deutsch", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_GERMAN }, // LANGUAGE_GERMAN
{ "nl-NL", "Dutch", "Nederlands", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_DUTCH }, // LANGUAGE_DUTCH
{ "fr-FR", "French", u8"Français", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_FRENCH }, // LANGUAGE_FRENCH
{ "hu-HU", "Hungarian", "Magyar", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_HUNGARIAN
{ "pl-PL", "Polish", "Polski", &TTFFontArial, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_POLISH
{ "es-ES", "Spanish", u8"Español", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_SPANISH }, // LANGUAGE_SPANISH
{ "sv-SE", "Swedish", "Svenska", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_SWEDISH }, // LANGUAGE_SWEDISH
{ "it-IT", "Italian", "Italiano", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ITALIAN }, // LANGUAGE_ITALIAN
{ "pt-BR", "Portuguese (BR)", u8"Português (BR)", FONT_OPENRCT2_SPRITE,
RCT2_LANGUAGE_ID_PORTUGUESE }, // LANGUAGE_PORTUGUESE_BR
{ "zh-TW", "Chinese (Traditional)", "Chinese (Traditional)", &TTFFontMingLiu,
RCT2_LANGUAGE_ID_CHINESE_TRADITIONAL }, // LANGUAGE_CHINESE_TRADITIONAL
{ "zh-CN", "Chinese (Simplified)", "Chinese (Simplified)", &TTFFontSimSun,
RCT2_LANGUAGE_ID_CHINESE_SIMPLIFIED }, // LANGUAGE_CHINESE_SIMPLIFIED
{ "fi-FI", "Finnish", "Suomi", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_FINNISH
{ "ko-KR", "Korean", "Korean", &TTFFontGulim, RCT2_LANGUAGE_ID_KOREAN }, // LANGUAGE_KOREAN
{ "ru-RU", "Russian", "Russian", &TTFFontArial, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_RUSSIAN
{ "cs-CZ", "Czech", "Czech", &TTFFontArial, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_CZECH
{ "ja-JP", "Japanese", "Japanese", &TTFFontMSGothic, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_JAPANESE
{
"nb-NO", "Norwegian", "Norsk", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ENGLISH_UK,
}, // LANGUAGE_NORWEGIAN
};
static void LoadSpriteFont()
{
ttf_dispose();
gUseTrueTypeFont = false;
gCurrentTTFFontSet = nullptr;
}
static bool LoadFont(TTFFontSetDescriptor * font)
{
gUseTrueTypeFont = true;
gCurrentTTFFontSet = font;
bool fontInitialised = ttf_initialise();
return fontInitialised;
}
static bool LoadCustomConfigFont()
{
static TTFFontSetDescriptor TTFFontCustom = { {
{ gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_tiny, gConfigFonts.x_offset, gConfigFonts.y_offset,
gConfigFonts.height_tiny, nullptr },
{ gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_small, gConfigFonts.x_offset, gConfigFonts.y_offset,
gConfigFonts.height_small, nullptr },
{ gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_medium, gConfigFonts.x_offset,
gConfigFonts.y_offset, gConfigFonts.height_medium, nullptr },
{ gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_big, gConfigFonts.x_offset, gConfigFonts.y_offset,
gConfigFonts.height_big, nullptr },
} };
ttf_dispose();
gUseTrueTypeFont = true;
gCurrentTTFFontSet = &TTFFontCustom;
bool fontInitialised = ttf_initialise();
return fontInitialised;
}
void TryLoadFonts()
{
TTFFontSetDescriptor * font = LanguagesDescriptors[gCurrentLanguage].font;
if (font != FONT_OPENRCT2_SPRITE)
{
if (!String::IsNullOrEmpty(gConfigFonts.file_name))
{
if (LoadCustomConfigFont())
{
return;
}
Console::Error::WriteLine("Unable to initialise configured TrueType font -- falling back to Language default.");
}
if (LoadFont(font))
{
return;
}
Console::Error::WriteLine("Unable to initialise prefered TrueType font -- falling back to Arial.");
if (LoadFont(&TTFFontArial))
{
return;
}
Console::Error::WriteLine("Unable to initialise prefered TrueType font -- Falling back to sprite font.");
}
LoadSpriteFont();
}

32
src/interface/Fonts.h Normal file
View File

@ -0,0 +1,32 @@
#pragma region Copyright(c) 2014 - 2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#ifndef OPENRCT2_FONTS_H
#define OPENRCT2_FONTS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../drawing/font.h"
#ifdef __cplusplus
}
#endif
void TryLoadFonts();
#endif // OPENRCT2_FONTS_H

View File

@ -14,14 +14,15 @@
*****************************************************************************/
#pragma endregion
#include "chat.h"
#include "../audio/audio.h"
#include "../audio/mixer.h"
#include "../interface/themes.h"
#include "../localisation/localisation.h"
#include "../network/network.h"
#include "../platform/platform.h"
#include "../rct2.h"
#include "../util/util.h"
#include "chat.h"
bool gChatOpen = false;
char _chatCurrentLine[CHAT_MAX_MESSAGE_LENGTH];

View File

@ -17,29 +17,30 @@
#include <stdarg.h>
#include <SDL_scancode.h>
#include "../drawing/drawing.h"
#include "../localisation/localisation.h"
#include "../localisation/user.h"
#include "../platform/platform.h"
#include "../world/park.h"
#include "../util/sawyercoding.h"
#include "../config.h"
#include "../drawing/drawing.h"
#include "../game.h"
#include "../input.h"
#include "../network/twitch.h"
#include "../localisation/localisation.h"
#include "../localisation/user.h"
#include "../management/finance.h"
#include "../management/research.h"
#include "../network/network.h"
#include "../network/twitch.h"
#include "../object.h"
#include "../object/ObjectManager.h"
#include "../object/ObjectRepository.h"
#include "../platform/platform.h"
#include "../rct2.h"
#include "../util/sawyercoding.h"
#include "../util/util.h"
#include "../world/banner.h"
#include "../world/climate.h"
#include "../world/park.h"
#include "../world/scenery.h"
#include "../management/finance.h"
#include "../management/research.h"
#include "../util/util.h"
#include "console.h"
#include "window.h"
#include "viewport.h"
#include "window.h"
#define CONSOLE_BUFFER_SIZE 8192
#define CONSOLE_BUFFER_2_SIZE 256

View File

@ -17,6 +17,8 @@
#ifndef _INTERFACE_KEYBOARD_SHORTCUT_H_
#define _INTERFACE_KEYBOARD_SHORTCUT_H_
#include "../common.h"
#define SHORTCUT_UNDEFINED 0xFFFF
/** The current shortcut being changed. */

View File

@ -23,6 +23,7 @@
#include "../localisation/localisation.h"
#include "../openrct2.h"
#include "../platform/platform.h"
#include "../rct2.h"
#include "../util/util.h"
#include "../windows/error.h"
#include "screenshot.h"

View File

@ -15,10 +15,11 @@
#pragma endregion
#include "../localisation/string_ids.h"
#include "window.h"
#include "title_sequences.h"
#include "../rct2.h"
#include "../title.h"
#include "../util/util.h"
#include "title_sequences.h"
#include "window.h"
uint16 gCurrentTitleSequence;

View File

@ -16,23 +16,24 @@
#include "../config.h"
#include "../drawing/drawing.h"
#include "../paint/supports.h"
#include "../game.h"
#include "../input.h"
#include "../localisation/localisation.h"
#include "../paint/paint.h"
#include "../paint/supports.h"
#include "../peep/staff.h"
#include "../rct2.h"
#include "../ride/ride_data.h"
#include "../ride/track_data.h"
#include "../sprites.h"
#include "../world/climate.h"
#include "../world/map.h"
#include "../world/sprite.h"
#include "../world/banner.h"
#include "../world/climate.h"
#include "../world/entrance.h"
#include "../world/footpath.h"
#include "../world/map.h"
#include "../world/scenery.h"
#include "../world/sprite.h"
#include "colour.h"
#include "../paint/paint.h"
#include "viewport.h"
#include "window.h"

View File

@ -18,8 +18,7 @@
#include "audio/mixer.h"
#include "drawing/drawing.h"
#include "intro.h"
#include "localisation/localisation.h"
#include "platform/platform.h"
#include "rct2.h"
#include "sprites.h"
#define BACKROUND_COLOUR_DARK 10

View File

@ -0,0 +1,142 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include "../common.h"
#include "format_codes.h"
#include "localisation.h"
#pragma region Format codes
typedef struct format_code_token {
uint32 code;
const char *token;
} format_code_token;
format_code_token format_code_tokens[] = {
{ FORMAT_MOVE_X, "MOVE_X" },
{ FORMAT_ADJUST_PALETTE, "ADJUST_PALETTE" },
{ FORMAT_NEWLINE, "NEWLINE" },
{ FORMAT_NEWLINE_SMALLER, "NEWLINE_SMALLER" },
{ FORMAT_TINYFONT, "TINYFONT" },
{ FORMAT_BIGFONT, "BIGFONT" },
{ FORMAT_MEDIUMFONT, "MEDIUMFONT" },
{ FORMAT_SMALLFONT, "SMALLFONT" },
{ FORMAT_OUTLINE, "OUTLINE" },
{ FORMAT_OUTLINE_OFF, "OUTLINE_OFF" },
{ FORMAT_WINDOW_COLOUR_1, "WINDOW_COLOUR_1" },
{ FORMAT_WINDOW_COLOUR_2, "WINDOW_COLOUR_2" },
{ FORMAT_WINDOW_COLOUR_3, "WINDOW_COLOUR_3" },
{ FORMAT_NEWLINE_X_Y, "NEWLINE_X_Y" },
{ FORMAT_INLINE_SPRITE, "INLINE_SPRITE" },
{ FORMAT_ENDQUOTES, "ENDQUOTES" },
{ FORMAT_COMMA32, "COMMA32" },
{ FORMAT_INT32, "INT32" },
{ FORMAT_COMMA2DP32, "COMMA2DP32" },
{ FORMAT_COMMA16, "COMMA16" },
{ FORMAT_UINT16, "UINT16" },
{ FORMAT_CURRENCY2DP, "CURRENCY2DP" },
{ FORMAT_CURRENCY, "CURRENCY" },
{ FORMAT_STRINGID, "STRINGID" },
{ FORMAT_STRINGID2, "STRINGID2" },
{ FORMAT_STRING, "STRING" },
{ FORMAT_MONTHYEAR, "MONTHYEAR" },
{ FORMAT_MONTH, "MONTH" },
{ FORMAT_VELOCITY, "VELOCITY" },
{ FORMAT_POP16, "POP16" },
{ FORMAT_PUSH16, "PUSH16" },
{ FORMAT_DURATION, "DURATION" },
{ FORMAT_REALTIME, "REALTIME" },
{ FORMAT_LENGTH, "LENGTH" },
{ FORMAT_SPRITE, "SPRITE" },
{ FORMAT_BLACK, "BLACK" },
{ FORMAT_GREY, "GREY" },
{ FORMAT_WHITE, "WHITE" },
{ FORMAT_RED, "RED" },
{ FORMAT_GREEN, "GREEN" },
{ FORMAT_YELLOW, "YELLOW" },
{ FORMAT_TOPAZ, "TOPAZ" },
{ FORMAT_CELADON, "CELADON" },
{ FORMAT_BABYBLUE, "BABYBLUE" },
{ FORMAT_PALELAVENDER, "PALELAVENDER" },
{ FORMAT_PALEGOLD, "PALEGOLD" },
{ FORMAT_LIGHTPINK, "LIGHTPINK" },
{ FORMAT_PEARLAQUA, "PEARLAQUA" },
{ FORMAT_PALESILVER, "PALESILVER" },
{ FORMAT_AMINUSCULE, "AMINUSCULE" },
{ FORMAT_UP, "UP" },
{ FORMAT_POUND, "POUND" },
{ FORMAT_YEN, "YEN" },
{ FORMAT_COPYRIGHT, "COPYRIGHT" },
{ FORMAT_DOWN, "DOWN" },
{ FORMAT_LEFTGUILLEMET, "LEFTGUILLEMET" },
{ FORMAT_TICK, "TICK" },
{ FORMAT_CROSS, "CROSS" },
{ FORMAT_RIGHT, "RIGHT" },
{ FORMAT_DEGREE, "DEGREE" },
{ FORMAT_SQUARED, "SQUARED" },
{ FORMAT_OPENQUOTES, "OPENQUOTES" },
{ FORMAT_EURO, "EURO" },
{ FORMAT_APPROX, "APPROX" },
{ FORMAT_POWERNEGATIVEONE, "POWERNEGATIVEONE" },
{ FORMAT_BULLET, "BULLET" },
{ FORMAT_RIGHTGUILLEMET, "RIGHTGUILLEMET" },
{ FORMAT_SMALLUP, "SMALLUP" },
{ FORMAT_SMALLDOWN, "SMALLDOWN" },
{ FORMAT_LEFT, "LEFT" },
{ FORMAT_INVERTEDQUESTION, "INVERTEDQUESTION" },
{ FORMAT_COMMA1DP16, "COMMA1DP16" }
};
uint32 format_get_code(const char *token)
{
int i;
for (i = 0; i < countof(format_code_tokens); i++)
if (_strcmpi(token, format_code_tokens[i].token) == 0)
return format_code_tokens[i].code;
return 0;
}
const char *format_get_token(uint32 code)
{
int i;
for (i = 0; i < countof(format_code_tokens); i++)
if (code == format_code_tokens[i].code)
return format_code_tokens[i].token;
return 0;
}
bool utf8_should_use_sprite_for_codepoint(int codepoint)
{
switch (codepoint) {
case FORMAT_UP:
case FORMAT_DOWN:
case FORMAT_LEFTGUILLEMET:
case FORMAT_TICK:
case FORMAT_CROSS:
case FORMAT_RIGHT:
case FORMAT_RIGHTGUILLEMET:
case FORMAT_SMALLUP:
case FORMAT_SMALLDOWN:
case FORMAT_LEFT:
case FORMAT_OPENQUOTES:
case FORMAT_ENDQUOTES:
return true;
default:
return false;
}
}
#pragma endregion

View File

@ -20,82 +20,14 @@
#include "../core/Path.hpp"
#include "../core/String.hpp"
#include "../core/StringBuilder.hpp"
#include "../interface/Fonts.h"
#include "../object/ObjectManager.h"
#include "LanguagePack.h"
extern "C" {
#include "../config.h"
#include "../drawing/drawing.h"
#include "../object.h"
#include "../openrct2.h"
#include "../util/util.h"
#include "localisation.h"
static TTFFontSetDescriptor TTFFontMSGothic =
{{
{ "msgothic.ttc", "MS PGothic", 9, 1, 0, 15, nullptr },
{ "msgothic.ttc", "MS PGothic", 12, 1, 0, 17, nullptr },
{ "msgothic.ttc", "MS PGothic", 12, 1, 0, 17, nullptr },
{ "msgothic.ttc", "MS PGothic", 13, 1, 0, 20, nullptr },
}};
static TTFFontSetDescriptor TTFFontMingLiu =
{{
{ "msjh.ttc", "JhengHei", 9, -1, -3, 6, nullptr },
{ "mingliu.ttc", "MingLiU", 11, 1, 1, 12, nullptr },
{ "mingliu.ttc", "MingLiU", 12, 1, 0, 12, nullptr },
{ "mingliu.ttc", "MingLiU", 13, 1, 0, 20, nullptr },
}};
static TTFFontSetDescriptor TTFFontSimSun =
{{
{ "msyh.ttc", "YaHei", 9, -1, -3, 6, nullptr },
{ "simsun.ttc", "SimSun", 11, 1, -1, 14, nullptr },
{ "simsun.ttc", "SimSun", 12, 1, -2, 14, nullptr },
{ "simsun.ttc", "SimSun", 13, 1, 0, 20, nullptr },
}};
static TTFFontSetDescriptor TTFFontGulim =
{{
{ "gulim.ttc", "Gulim", 11, 1, 0, 15, nullptr },
{ "gulim.ttc", "Gulim", 12, 1, 0, 17, nullptr },
{ "gulim.ttc", "Gulim", 12, 1, 0, 17, nullptr },
{ "gulim.ttc", "Gulim", 13, 1, 0, 20, nullptr },
}};
static TTFFontSetDescriptor TTFFontArial =
{{
{ "arial.ttf", "Arial", 8, 0, -1, 6, nullptr },
{ "arial.ttf", "Arial", 10, 0, -1, 12, nullptr },
{ "arial.ttf", "Arial", 11, 0, -1, 12, nullptr },
{ "arial.ttf", "Arial", 12, 0, -1, 20, nullptr },
}};
const language_descriptor LanguagesDescriptors[LANGUAGE_COUNT] =
{
{ "", "", "", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_UNDEFINED
{ "en-GB", "English (UK)", "English (UK)", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_ENGLISH_UK
{ "en-US", "English (US)", "English (US)", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ENGLISH_US }, // LANGUAGE_ENGLISH_US
{ "de-DE", "German", "Deutsch", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_GERMAN }, // LANGUAGE_GERMAN
{ "nl-NL", "Dutch", "Nederlands", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_DUTCH }, // LANGUAGE_DUTCH
{ "fr-FR", "French", u8"Français", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_FRENCH }, // LANGUAGE_FRENCH
{ "hu-HU", "Hungarian", "Magyar", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_HUNGARIAN
{ "pl-PL", "Polish", "Polski", &TTFFontArial, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_POLISH
{ "es-ES", "Spanish", u8"Español", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_SPANISH }, // LANGUAGE_SPANISH
{ "sv-SE", "Swedish", "Svenska", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_SWEDISH }, // LANGUAGE_SWEDISH
{ "it-IT", "Italian", "Italiano", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ITALIAN }, // LANGUAGE_ITALIAN
{ "pt-BR", "Portuguese (BR)", u8"Português (BR)", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_PORTUGUESE }, // LANGUAGE_PORTUGUESE_BR
{ "zh-TW", "Chinese (Traditional)", "Chinese (Traditional)", &TTFFontMingLiu, RCT2_LANGUAGE_ID_CHINESE_TRADITIONAL }, // LANGUAGE_CHINESE_TRADITIONAL
{ "zh-CN", "Chinese (Simplified)", "Chinese (Simplified)", &TTFFontSimSun, RCT2_LANGUAGE_ID_CHINESE_SIMPLIFIED }, // LANGUAGE_CHINESE_SIMPLIFIED
{ "fi-FI", "Finnish", "Suomi", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_FINNISH
{ "ko-KR", "Korean", "Korean", &TTFFontGulim, RCT2_LANGUAGE_ID_KOREAN }, // LANGUAGE_KOREAN
{ "ru-RU", "Russian", "Russian", &TTFFontArial, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_RUSSIAN
{ "cs-CZ", "Czech", "Czech", &TTFFontArial, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_CZECH
{ "ja-JP", "Japanese", "Japanese", &TTFFontMSGothic, RCT2_LANGUAGE_ID_ENGLISH_UK }, // LANGUAGE_JAPANESE
{ "nb-NO", "Norwegian", "Norsk", FONT_OPENRCT2_SPRITE, RCT2_LANGUAGE_ID_ENGLISH_UK, }, // LANGUAGE_NORWEGIAN
};
int gCurrentLanguage = LANGUAGE_UNDEFINED;
bool gUseTrueTypeFont = false;
@ -155,69 +87,6 @@ static utf8 * GetLanguagePath(utf8 * buffer, size_t bufferSize, uint32 languageI
return buffer;
}
static void LoadSpriteFont()
{
ttf_dispose();
gUseTrueTypeFont = false;
gCurrentTTFFontSet = nullptr;
}
static bool LoadFont(TTFFontSetDescriptor * font)
{
gUseTrueTypeFont = true;
gCurrentTTFFontSet = font;
bool fontInitialised = ttf_initialise();
return fontInitialised;
}
static bool LoadCustomConfigFont()
{
static TTFFontSetDescriptor TTFFontCustom =
{{
{ gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_tiny, gConfigFonts.x_offset, gConfigFonts.y_offset, gConfigFonts.height_tiny, nullptr },
{ gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_small, gConfigFonts.x_offset, gConfigFonts.y_offset, gConfigFonts.height_small, nullptr },
{ gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_medium, gConfigFonts.x_offset, gConfigFonts.y_offset, gConfigFonts.height_medium, nullptr },
{ gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_big, gConfigFonts.x_offset, gConfigFonts.y_offset, gConfigFonts.height_big, nullptr },
}};
ttf_dispose();
gUseTrueTypeFont = true;
gCurrentTTFFontSet = &TTFFontCustom;
bool fontInitialised = ttf_initialise();
return fontInitialised;
}
static void TryLoadFonts()
{
TTFFontSetDescriptor * font = LanguagesDescriptors[gCurrentLanguage].font;
if (font != FONT_OPENRCT2_SPRITE)
{
if (!String::IsNullOrEmpty(gConfigFonts.file_name))
{
if (LoadCustomConfigFont())
{
return;
}
Console::Error::WriteLine("Unable to initialise configured TrueType font -- falling back to Language default.");
}
if (LoadFont(font))
{
return;
}
Console::Error::WriteLine("Unable to initialise prefered TrueType font -- falling back to Arial.");
if (LoadFont(&TTFFontArial))
{
return;
}
Console::Error::WriteLine("Unable to initialise prefered TrueType font -- Falling back to sprite font.");
}
LoadSpriteFont();
}
bool language_open(int id)
{
char filename[MAX_PATH];

View File

@ -323,129 +323,6 @@ const rct_string_id DateGameShortMonthNames[MONTH_COUNT] = {
STR_MONTH_SHORT_OCT,
};
#pragma region Format codes
typedef struct format_code_token {
uint32 code;
const char *token;
} format_code_token;
format_code_token format_code_tokens[] = {
{ FORMAT_MOVE_X, "MOVE_X" },
{ FORMAT_ADJUST_PALETTE, "ADJUST_PALETTE" },
{ FORMAT_NEWLINE, "NEWLINE" },
{ FORMAT_NEWLINE_SMALLER, "NEWLINE_SMALLER" },
{ FORMAT_TINYFONT, "TINYFONT" },
{ FORMAT_BIGFONT, "BIGFONT" },
{ FORMAT_MEDIUMFONT, "MEDIUMFONT" },
{ FORMAT_SMALLFONT, "SMALLFONT" },
{ FORMAT_OUTLINE, "OUTLINE" },
{ FORMAT_OUTLINE_OFF, "OUTLINE_OFF" },
{ FORMAT_WINDOW_COLOUR_1, "WINDOW_COLOUR_1" },
{ FORMAT_WINDOW_COLOUR_2, "WINDOW_COLOUR_2" },
{ FORMAT_WINDOW_COLOUR_3, "WINDOW_COLOUR_3" },
{ FORMAT_NEWLINE_X_Y, "NEWLINE_X_Y" },
{ FORMAT_INLINE_SPRITE, "INLINE_SPRITE" },
{ FORMAT_ENDQUOTES, "ENDQUOTES" },
{ FORMAT_COMMA32, "COMMA32" },
{ FORMAT_INT32, "INT32" },
{ FORMAT_COMMA2DP32, "COMMA2DP32" },
{ FORMAT_COMMA16, "COMMA16" },
{ FORMAT_UINT16, "UINT16" },
{ FORMAT_CURRENCY2DP, "CURRENCY2DP" },
{ FORMAT_CURRENCY, "CURRENCY" },
{ FORMAT_STRINGID, "STRINGID" },
{ FORMAT_STRINGID2, "STRINGID2" },
{ FORMAT_STRING, "STRING" },
{ FORMAT_MONTHYEAR, "MONTHYEAR" },
{ FORMAT_MONTH, "MONTH" },
{ FORMAT_VELOCITY, "VELOCITY" },
{ FORMAT_POP16, "POP16" },
{ FORMAT_PUSH16, "PUSH16" },
{ FORMAT_DURATION, "DURATION" },
{ FORMAT_REALTIME, "REALTIME" },
{ FORMAT_LENGTH, "LENGTH" },
{ FORMAT_SPRITE, "SPRITE" },
{ FORMAT_BLACK, "BLACK" },
{ FORMAT_GREY, "GREY" },
{ FORMAT_WHITE, "WHITE" },
{ FORMAT_RED, "RED" },
{ FORMAT_GREEN, "GREEN" },
{ FORMAT_YELLOW, "YELLOW" },
{ FORMAT_TOPAZ, "TOPAZ" },
{ FORMAT_CELADON, "CELADON" },
{ FORMAT_BABYBLUE, "BABYBLUE" },
{ FORMAT_PALELAVENDER, "PALELAVENDER" },
{ FORMAT_PALEGOLD, "PALEGOLD" },
{ FORMAT_LIGHTPINK, "LIGHTPINK" },
{ FORMAT_PEARLAQUA, "PEARLAQUA" },
{ FORMAT_PALESILVER, "PALESILVER" },
{ FORMAT_AMINUSCULE, "AMINUSCULE" },
{ FORMAT_UP, "UP" },
{ FORMAT_POUND, "POUND" },
{ FORMAT_YEN, "YEN" },
{ FORMAT_COPYRIGHT, "COPYRIGHT" },
{ FORMAT_DOWN, "DOWN" },
{ FORMAT_LEFTGUILLEMET, "LEFTGUILLEMET" },
{ FORMAT_TICK, "TICK" },
{ FORMAT_CROSS, "CROSS" },
{ FORMAT_RIGHT, "RIGHT" },
{ FORMAT_DEGREE, "DEGREE" },
{ FORMAT_SQUARED, "SQUARED" },
{ FORMAT_OPENQUOTES, "OPENQUOTES" },
{ FORMAT_EURO, "EURO" },
{ FORMAT_APPROX, "APPROX" },
{ FORMAT_POWERNEGATIVEONE, "POWERNEGATIVEONE" },
{ FORMAT_BULLET, "BULLET" },
{ FORMAT_RIGHTGUILLEMET, "RIGHTGUILLEMET" },
{ FORMAT_SMALLUP, "SMALLUP" },
{ FORMAT_SMALLDOWN, "SMALLDOWN" },
{ FORMAT_LEFT, "LEFT" },
{ FORMAT_INVERTEDQUESTION, "INVERTEDQUESTION" },
{ FORMAT_COMMA1DP16, "COMMA1DP16" }
};
uint32 format_get_code(const char *token)
{
int i;
for (i = 0; i < countof(format_code_tokens); i++)
if (_strcmpi(token, format_code_tokens[i].token) == 0)
return format_code_tokens[i].code;
return 0;
}
const char *format_get_token(uint32 code)
{
int i;
for (i = 0; i < countof(format_code_tokens); i++)
if (code == format_code_tokens[i].code)
return format_code_tokens[i].token;
return 0;
}
bool utf8_should_use_sprite_for_codepoint(int codepoint)
{
switch (codepoint) {
case FORMAT_UP:
case FORMAT_DOWN:
case FORMAT_LEFTGUILLEMET:
case FORMAT_TICK:
case FORMAT_CROSS:
case FORMAT_RIGHT:
case FORMAT_RIGHTGUILLEMET:
case FORMAT_SMALLUP:
case FORMAT_SMALLDOWN:
case FORMAT_LEFT:
case FORMAT_OPENQUOTES:
case FORMAT_ENDQUOTES:
return true;
default:
return false;
}
}
#pragma endregion
#define format_push_char_safe(C) { *(*dest)++ = (C); --(*size); }
#define format_handle_overflow(X) if ((*size) <= (X)) { *(*dest) = '\0'; (*size) = 0; return; }
#define format_push_char(C) { format_handle_overflow(1); format_push_char_safe(C); }

View File

@ -19,9 +19,10 @@
#include "../interface/window.h"
#include "../localisation/date.h"
#include "../localisation/localisation.h"
#include "../rct2.h"
#include "../ride/ride.h"
#include "../world/sprite.h"
#include "../util/util.h"
#include "../world/sprite.h"
#include "news_item.h"
rct_news_item gNewsItems[MAX_NEWS_ITEMS];

View File

@ -18,6 +18,7 @@
#include <array>
#include <jansson.h>
#include <string>
#include "NetworkPacket.h"
#include "../common.h"

View File

@ -55,7 +55,7 @@ extern "C" {
// This define specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "20"
#define NETWORK_STREAM_VERSION "22"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
#ifdef __cplusplus

View File

@ -42,8 +42,9 @@ extern "C"
#include "../localisation/localisation.h"
#include "../management/news_item.h"
#include "../peep/peep.h"
#include "../world/sprite.h"
#include "../rct2.h"
#include "../util/util.h"
#include "../world/sprite.h"
#include "http.h"
#include "twitch.h"
}

View File

@ -45,6 +45,7 @@ extern "C"
#include "../object.h"
#include "../object_list.h"
#include "../platform/platform.h"
#include "../rct2.h"
#include "../util/sawyercoding.h"
#include "../util/util.h"
}

View File

@ -19,7 +19,6 @@
#include "config.h"
#include "editor.h"
#include "game.h"
#include "hook.h"
#include "interface/chat.h"
#include "interface/themes.h"
#include "interface/window.h"
@ -32,31 +31,17 @@
#include "openrct2.h"
#include "platform/crash.h"
#include "platform/platform.h"
#include "rct2/interop.h"
#include "ride/ride.h"
#include "title.h"
#include "util/sawyercoding.h"
#include "util/util.h"
#include "version.h"
#include "world/mapgen.h"
#if defined(__unix__) || defined(__MACOSX__)
#include <sys/mman.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#endif // defined(__unix__) || defined(__MACOSX__)
#define UPDATE_TIME_MS 25 // (1000 / 40fps) = 25ms
int gExitCode;
#if defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__)) && !defined(NO_RCT2)
static int fdData = -1;
#endif
#if defined(__unix__) && !defined(NO_RCT2)
static char * segments = (char *)(GOOD_PLACE_FOR_DATA_SEGMENT);
#endif
int gOpenRCT2StartupAction = STARTUP_ACTION_TITLE;
utf8 gOpenRCT2StartupActionPath[512] = { 0 };
utf8 gExePath[MAX_PATH];
@ -79,11 +64,7 @@ EVP_MD_CTX *gHashCTX = NULL;
/** If set, will end the OpenRCT2 game loop. Intentially private to this module so that the flag can not be set back to 0. */
int _finished;
// Used for object movement tweening
static rct_xyz16 _spritelocations1[MAX_SPRITES], _spritelocations2[MAX_SPRITES];
static void openrct2_loop();
static void openrct2_setup_rct2_hooks();
void openrct2_write_full_version_info(utf8 *buffer, size_t bufferSize)
{
@ -112,81 +93,12 @@ void openrct2_write_full_version_info(utf8 *buffer, size_t bufferSize)
#endif
}
static void openrct2_copy_files_over(const utf8 *originalDirectory, const utf8 *newDirectory, const utf8 *extension)
{
utf8 *ch, filter[MAX_PATH], oldPath[MAX_PATH], newPath[MAX_PATH];
int fileEnumHandle;
file_info fileInfo;
if (!platform_ensure_directory_exists(newDirectory)) {
log_error("Could not create directory %s.", newDirectory);
return;
}
// Create filter path
safe_strcpy(filter, originalDirectory, sizeof(filter));
ch = strchr(filter, '*');
if (ch != NULL)
*ch = 0;
safe_strcat_path(filter, "*", sizeof(filter));
path_append_extension(filter, extension, sizeof(filter));
fileEnumHandle = platform_enumerate_files_begin(filter);
while (platform_enumerate_files_next(fileEnumHandle, &fileInfo)) {
safe_strcpy(newPath, newDirectory, sizeof(newPath));
safe_strcat_path(newPath, fileInfo.path, sizeof(newPath));
safe_strcpy(oldPath, originalDirectory, sizeof(oldPath));
ch = strchr(oldPath, '*');
if (ch != NULL)
*ch = 0;
safe_strcat_path(oldPath, fileInfo.path, sizeof(oldPath));
if (!platform_file_exists(newPath))
platform_file_copy(oldPath, newPath, false);
}
platform_enumerate_files_end(fileEnumHandle);
fileEnumHandle = platform_enumerate_directories_begin(originalDirectory);
while (platform_enumerate_directories_next(fileEnumHandle, filter)) {
safe_strcpy(newPath, newDirectory, sizeof(newPath));
safe_strcat_path(newPath, filter, sizeof(newPath));
safe_strcpy(oldPath, originalDirectory, MAX_PATH);
ch = strchr(oldPath, '*');
if (ch != NULL)
*ch = 0;
safe_strcat_path(oldPath, filter, sizeof(oldPath));
if (!platform_ensure_directory_exists(newPath)) {
log_error("Could not create directory %s.", newPath);
return;
}
openrct2_copy_files_over(oldPath, newPath, extension);
}
platform_enumerate_directories_end(fileEnumHandle);
}
static void openrct2_set_exe_path()
{
platform_get_exe_path(gExePath, sizeof(gExePath));
log_verbose("Setting exe path to %s", gExePath);
}
/**
* Copy saved games and landscapes to user directory
*/
static void openrct2_copy_original_user_files_over()
{
utf8 path[MAX_PATH];
platform_get_user_directory(path, "save", sizeof(path));
openrct2_copy_files_over((utf8*)gRCT2AddressSavedGamesPath, path, ".sv6");
platform_get_user_directory(path, "landscape", sizeof(path));
openrct2_copy_files_over((utf8*)gRCT2AddressLandscapesPath, path, ".sc6");
}
bool openrct2_initialise()
{
utf8 userPath[MAX_PATH];
@ -206,7 +118,7 @@ bool openrct2_initialise()
crash_init();
if (!openrct2_setup_rct2_segment()) {
if (!rct2_interop_setup_segment()) {
log_fatal("Unable to load RCT2 data sector");
return false;
}
@ -263,14 +175,14 @@ bool openrct2_initialise()
title_sequences_set_default();
title_sequences_load_presets();
openrct2_setup_rct2_hooks();
rct2_interop_setup_hooks();
if (!rct2_init())
return false;
chat_init();
openrct2_copy_original_user_files_over();
rct2_copy_original_user_files_over();
return true;
}
@ -357,27 +269,10 @@ void openrct2_dispose()
#ifndef DISABLE_NETWORK
EVP_MD_CTX_destroy(gHashCTX);
#endif // DISABLE_NETWORK
#if defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__)) && !defined(NO_RCT2)
munmap(segments, 12079104);
close(fdData);
#endif
rct2_interop_dispose();
platform_free();
}
/**
* Determines whether its worth tweening a sprite or not when frame smoothing is on.
*/
static bool sprite_should_tween(rct_sprite *sprite)
{
switch (sprite->unknown.linked_list_type_offset >> 1) {
case SPRITE_LIST_VEHICLE:
case SPRITE_LIST_PEEP:
case SPRITE_LIST_UNKNOWN:
return true;
}
return false;
}
/**
* Run the main game loop until the finished flag is set at 40fps (25ms interval).
*/
@ -398,44 +293,33 @@ static void openrct2_loop()
if (uncapTick == 0) {
// Reset sprite locations
uncapTick = SDL_GetTicks();
openrct2_reset_object_tween_locations();
sprite_position_tween_reset();
}
// Limit number of updates per loop (any long pauses or debugging can make this update for a very long time)
if (currentTick - uncapTick > 25 * 60) {
uncapTick = currentTick - 25 - 1;
if (currentTick - uncapTick > UPDATE_TIME_MS * 60) {
uncapTick = currentTick - UPDATE_TIME_MS - 1;
}
platform_process_messages();
while (uncapTick <= currentTick && currentTick - uncapTick > 25) {
while (uncapTick <= currentTick && currentTick - uncapTick > UPDATE_TIME_MS) {
// Get the original position of each sprite
store_sprite_locations(_spritelocations1);
sprite_position_tween_store_a();
// Update the game so the sprite positions update
rct2_update();
// Get the next position of each sprite
store_sprite_locations(_spritelocations2);
sprite_position_tween_store_b();
uncapTick += 25;
uncapTick += UPDATE_TIME_MS;
}
// Tween the position of each sprite from the last position to the new position based on the time between the last
// tick and the next tick.
float nudge = 1 - ((float)(currentTick - uncapTick) / 25);
for (uint16 i = 0; i < MAX_SPRITES; i++) {
if (!sprite_should_tween(get_sprite(i)))
continue;
sprite_set_coordinates(
_spritelocations2[i].x + (sint16)((_spritelocations1[i].x - _spritelocations2[i].x) * nudge),
_spritelocations2[i].y + (sint16)((_spritelocations1[i].y - _spritelocations2[i].y) * nudge),
_spritelocations2[i].z + (sint16)((_spritelocations1[i].z - _spritelocations2[i].z) * nudge),
get_sprite(i)
);
invalidate_sprite_2(get_sprite(i));
}
float nudge = 1 - ((float)(currentTick - uncapTick) / UPDATE_TIME_MS);
sprite_position_tween_all(nudge);
platform_draw();
@ -445,21 +329,14 @@ static void openrct2_loop()
secondTick = SDL_GetTicks();
}
// Restore the real positions of the sprites so they aren't left at the mid-tween positions
for (uint16 i = 0; i < MAX_SPRITES; i++) {
if (!sprite_should_tween(get_sprite(i)))
continue;
invalidate_sprite_2(get_sprite(i));
sprite_set_coordinates(_spritelocations2[i].x, _spritelocations2[i].y, _spritelocations2[i].z, get_sprite(i));
}
sprite_position_tween_restore();
} else {
uncapTick = 0;
currentTick = SDL_GetTicks();
ticksElapsed = currentTick - lastTick;
if (ticksElapsed < 25) {
SDL_Delay(25 - ticksElapsed);
lastTick += 25;
if (ticksElapsed < UPDATE_TIME_MS) {
SDL_Delay(UPDATE_TIME_MS - ticksElapsed);
lastTick += UPDATE_TIME_MS;
} else {
lastTick = currentTick;
}
@ -482,182 +359,3 @@ void openrct2_finish()
{
_finished = 1;
}
void openrct2_reset_object_tween_locations()
{
for (uint16 i = 0; i < MAX_SPRITES; i++) {
_spritelocations1[i].x = _spritelocations2[i].x = get_sprite(i)->unknown.x;
_spritelocations1[i].y = _spritelocations2[i].y = get_sprite(i)->unknown.y;
_spritelocations1[i].z = _spritelocations2[i].z = get_sprite(i)->unknown.z;
}
}
static void openrct2_get_segment_data_path(char * buffer, size_t bufferSize)
{
platform_get_exe_path(buffer, bufferSize);
safe_strcat_path(buffer, "openrct2_data", bufferSize);
}
/**
* Loads RCT2's data model and remaps the addresses.
* @returns true if the data integrity check succeeded, otherwise false.
*/
bool openrct2_setup_rct2_segment()
{
// OpenRCT2 on Linux and macOS is wired to have the original Windows PE sections loaded
// necessary. Windows does not need to do this as OpenRCT2 runs as a DLL loaded from the Windows PE.
int len = 0x01429000 - 0x8a4000; // 0xB85000, 12079104 bytes or around 11.5MB
int err = 0;
// in some configurations err and len may be unused
UNUSED(err);
UNUSED(len);
#if defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__)) && !defined(NO_RCT2)
#define RDATA_OFFSET 0x004A4000
#define DATASEG_OFFSET 0x005E2000
// Using PE-bear I was able to figure out all the needed addresses to be filled.
// There are three sections to be loaded: .rdata, .data and .text, plus another
// one to be mapped: DATASEG.
// Out of the three, two can simply be mmapped into memory, while the third one,
// .data has a virtual size which is much completely different to its file size
// (even when taking page-alignment into consideration)
//
// The sections are as follows (dump from gdb)
// [0] 0x401000->0x6f7000 at 0x00001000: .text ALLOC LOAD READONLY CODE HAS_CONTENTS
// [1] 0x6f7000->0x8a325d at 0x002f7000: CODESEG ALLOC LOAD READONLY CODE HAS_CONTENTS
// [2] 0x8a4000->0x9a5894 at 0x004a4000: .rdata ALLOC LOAD DATA HAS_CONTENTS
// [3] 0x9a6000->0x9e2000 at 0x005a6000: .data ALLOC LOAD DATA HAS_CONTENTS
// [4] 0x1428000->0x14282bc at 0x005e2000: DATASEG ALLOC LOAD DATA HAS_CONTENTS
// [5] 0x1429000->0x1452000 at 0x005e3000: .cms_t ALLOC LOAD READONLY CODE HAS_CONTENTS
// [6] 0x1452000->0x14aaf3e at 0x0060c000: .cms_d ALLOC LOAD DATA HAS_CONTENTS
// [7] 0x14ab000->0x14ac58a at 0x00665000: .idata ALLOC LOAD READONLY DATA HAS_CONTENTS
// [8] 0x14ad000->0x14b512f at 0x00667000: .rsrc ALLOC LOAD DATA HAS_CONTENTS
//
// .data section, however, has virtual size of 0xA81C3C, and so
// 0x9a6000 + 0xA81C3C = 0x1427C3C, which after alignment to page size becomes
// 0x1428000, which can be seen as next section, DATASEG
//
// The data is now loaded into memory with a linker script, which proves to
// be more reliable, as mallocs that happen before we reach segment setup
// could have already taken the space we need.
// TODO: UGLY, UGLY HACK!
//off_t file_size = 6750208;
utf8 segmentDataPath[MAX_PATH];
openrct2_get_segment_data_path(segmentDataPath, sizeof(segmentDataPath));
fdData = open(segmentDataPath, O_RDONLY);
if (fdData < 0)
{
log_fatal("failed to load openrct2_data");
exit(1);
}
log_warning("%p", GOOD_PLACE_FOR_DATA_SEGMENT);
segments = mmap((void *)(GOOD_PLACE_FOR_DATA_SEGMENT), len, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE, fdData, 0);
log_warning("%p", segments);
if ((uintptr_t)segments != GOOD_PLACE_FOR_DATA_SEGMENT) {
perror("mmap");
return false;
}
#endif // defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__))
#if defined(__unix__) && !defined(NO_RCT2)
int pageSize = getpagesize();
int numPages = (len + pageSize - 1) / pageSize;
unsigned char *dummy = malloc(numPages);
err = mincore((void *)segments, len, dummy);
bool pagesMissing = false;
if (err != 0)
{
err = errno;
#ifdef __LINUX__
// On Linux ENOMEM means all requested range is unmapped
if (err != ENOMEM)
{
pagesMissing = true;
perror("mincore");
}
#else
pagesMissing = true;
perror("mincore");
#endif // __LINUX__
} else {
for (int i = 0; i < numPages; i++)
{
if (dummy[i] != 1)
{
pagesMissing = true;
void *start = (void *)segments + i * pageSize;
void *end = (void *)segments + (i + 1) * pageSize - 1;
log_warning("required page %p - %p is not in memory!", start, end);
}
}
}
free(dummy);
if (pagesMissing)
{
log_error("At least one of required pages was not found in memory. This can cause segfaults later on.");
}
#if !defined(USE_MMAP)
// section: text
err = mprotect((void *)0x401000, 0x8a4000 - 0x401000, PROT_READ | PROT_EXEC | PROT_WRITE);
if (err != 0)
{
perror("mprotect");
}
#endif // !defined(USE_MMAP)
// section: rw data
err = mprotect((void *)segments, 0x01429000 - 0x8a4000, PROT_READ | PROT_WRITE);
if (err != 0)
{
perror("mprotect");
}
#endif // defined(__unix__)
#if defined(USE_MMAP) && defined(__WINDOWS__)
segments = VirtualAlloc((void *)(GOOD_PLACE_FOR_DATA_SEGMENT), len, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
if ((uintptr_t)segments != GOOD_PLACE_FOR_DATA_SEGMENT) {
log_error("VirtualAlloc, segments = %p, GetLastError = 0x%x", segments, GetLastError());
return false;
}
utf8 segmentDataPath[MAX_PATH];
openrct2_get_segment_data_path(segmentDataPath, sizeof(segmentDataPath));
SDL_RWops * rw = SDL_RWFromFile(segmentDataPath, "rb");
if (rw == NULL)
{
log_error("failed to load file");
return false;
}
if (SDL_RWread(rw, segments, len, 1) != 1) {
log_error("Unable to read chunk header!");
return false;
}
SDL_RWclose(rw);
#endif // defined(USE_MMAP) && defined(__WINDOWS__)
#if !defined(NO_RCT2) && defined(USE_MMAP)
// Check that the expected data is at various addresses.
// Start at 0x9a6000, which is start of .data, to skip the region containing addresses to DLL
// calls, which can be changed by windows/wine loader.
const uint32 c1 = sawyercoding_calculate_checksum((const uint8*)(segments + (uintptr_t)(0x009A6000 - 0x8a4000)), 0x009E0000 - 0x009A6000);
const uint32 c2 = sawyercoding_calculate_checksum((const uint8*)(segments + (uintptr_t)(0x01428000 - 0x8a4000)), 0x014282BC - 0x01428000);
const uint32 exp_c1 = 10114815;
const uint32 exp_c2 = 23564;
if (c1 != exp_c1 || c2 != exp_c2) {
log_warning("c1 = %u, expected %u, match %d", c1, exp_c1, c1 == exp_c1);
log_warning("c2 = %u, expected %u, match %d", c2, exp_c2, c2 == exp_c2);
return false;
}
#endif
return true;
}
/**
* Setup hooks to allow RCT2 to call OpenRCT2 functions instead.
*/
static void openrct2_setup_rct2_hooks()
{
// None for now
}

View File

@ -60,8 +60,6 @@ bool openrct2_initialise();
void openrct2_launch();
void openrct2_dispose();
void openrct2_finish();
void openrct2_reset_object_tween_locations();
bool openrct2_setup_rct2_segment();
int cmdline_run(const char **argv, int argc);

View File

@ -15,12 +15,10 @@
#pragma endregion
#include "../../cheats.h"
#include "../../common.h"
#include "../../config.h"
#include "../../interface/viewport.h"
#include "../../peep/staff.h"
#include "../../world/map.h"
#include "../paint.h"
#include "../../rct2.h"
#include "map_element.h"
#include "surface.h"

View File

@ -19,13 +19,15 @@
#include "../cheats.h"
#include "../config.h"
#include "../game.h"
#include "../input.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../management/finance.h"
#include "../management/marketing.h"
#include "../management/news_item.h"
#include "../openrct2.h"
#include "../network/network.h"
#include "../openrct2.h"
#include "../rct2.h"
#include "../ride/ride.h"
#include "../ride/ride_data.h"
#include "../ride/track.h"
@ -1976,7 +1978,7 @@ bool peep_pickup_place(rct_peep* peep, int x, int y, int z, bool apply)
peep->action_sprite_image_offset = 0;
peep->action_sprite_type = 0;
peep->var_C4 = 0;
openrct2_reset_object_tween_locations();
sprite_position_tween_reset();
if (peep->type == PEEP_TYPE_GUEST) {
peep->action_sprite_type = 0xFF;
@ -2005,9 +2007,17 @@ bool peep_pickup_command(unsigned int peepnum, int x, int y, int z, int action,
if (!peep_can_be_picked_up(peep)) {
return false;
}
if (network_get_pickup_peep(game_command_playerid)) {
rct_peep* existing = network_get_pickup_peep(game_command_playerid);
if (existing) {
// already picking up a peep
return false;
bool result = peep_pickup_command(existing->sprite_index, network_get_pickup_peep_old_x(game_command_playerid), 0, 0, 1, apply);
if (existing == peep) {
return result;
}
if (game_command_playerid == network_get_current_player_id()) {
// prevent tool_cancel()
gInputFlags &= ~INPUT_FLAG_TOOL_ACTIVE;
}
}
if (apply) {
network_set_pickup_peep(game_command_playerid, peep);
@ -4879,7 +4889,20 @@ static void peep_update_queuing(rct_peep* peep){
}
if (peep->sub_state != 10){
if (peep->next_in_queue == 0xFFFF){
bool is_front = true;
if (peep->next_in_queue != 0xFFFF) {
// Fix #4819: Occasionally the peep->next_in_queue is incorrectly set
// to prevent this from causing the peeps to enter a loop
// first check if the next in queue is actually nearby
// if they are not then its safe to assume that this is
// the front of the queue.
rct_peep* next_peep = GET_PEEP(peep->next_in_queue);
if (abs(next_peep->x - peep->x) < 32 &&
abs(next_peep->y - peep->y) < 32) {
is_front = false;
}
}
if (is_front){
//Happens every time peep goes onto ride.
peep->destination_tolerence = 0;
peep_decrement_num_riders(peep);
@ -12356,7 +12379,7 @@ void peep_update_name_sort(rct_peep *peep)
finish_peep_sort:
// This is required at the moment because this function reorders peeps in the sprite list
openrct2_reset_object_tween_locations();
sprite_position_tween_reset();
}
void peep_sort()

View File

@ -20,6 +20,7 @@
#include "../common.h"
#ifdef __WINDOWS__
#include "../rct2.h"
#ifndef HAVE_MATH_H
#define HAVE_MATH_H
#endif

View File

@ -699,9 +699,16 @@ void platform_get_openrct_data_path(utf8 *outPath, size_t outSize)
void platform_resolve_openrct_data_path()
{
if (gCustomOpenrctDataPath[0] != 0) {
if (realpath(gCustomOpenrctDataPath, _openrctDataDirectoryPath) == NULL) {
// NOTE: second argument to `realpath` is meant to either be NULL or `PATH_MAX`-sized buffer,
// since our `MAX_PATH` macro is set to some other value, pass NULL to have `realpath` return
// a `malloc`ed buffer.
char *resolved_path = realpath(gCustomOpenrctDataPath, NULL);
if (resolved_path == NULL) {
log_error("Could not resolve path \"%s\", errno = %d", gCustomOpenrctDataPath, errno);
return;
} else {
safe_strcpy(_openrctDataDirectoryPath, resolved_path, MAX_PATH);
free(resolved_path);
}
path_end_with_separator(_openrctDataDirectoryPath, MAX_PATH);

View File

@ -21,13 +21,14 @@
#include "../drawing/lightfx.h"
#include "../game.h"
#include "../input.h"
#include "../interface/console.h"
#include "../interface/Cursors.h"
#include "../interface/console.h"
#include "../interface/keyboard_shortcut.h"
#include "../interface/window.h"
#include "../localisation/currency.h"
#include "../localisation/localisation.h"
#include "../openrct2.h"
#include "../rct2.h"
#include "../title.h"
#include "../util/util.h"
#include "../world/climate.h"

View File

@ -52,7 +52,7 @@ utf8 **windows_get_command_line_args(int *outNumArgs);
static HMODULE _dllModule = NULL;
#ifdef NO_RCT2
#if defined(NO_RCT2) && !defined(__NOENTRYPOINT__)
/**
* Windows entry point to OpenRCT2 without a console window.
@ -966,23 +966,23 @@ uint8 platform_get_locale_measurement_format()
uint8 platform_get_locale_temperature_format()
{
// There does not seem to be a function to obtain this, just check the countries
UINT country;
UINT fahrenheit;
// GetLocaleInfo will set fahrenheit to 1 if the locale on this computer
// uses the United States measurement system or 0 otherwise.
if (GetLocaleInfo(LOCALE_USER_DEFAULT,
LOCALE_IMEASURE | LOCALE_RETURN_NUMBER,
(LPSTR)&country,
sizeof(country)) == 0
(LPSTR)&fahrenheit,
sizeof(fahrenheit)) == 0
) {
// Assume celsius by default if function call fails
return TEMPERATURE_FORMAT_C;
}
switch (country) {
case CTRY_UNITED_STATES:
case CTRY_BELIZE:
if(fahrenheit)
return TEMPERATURE_FORMAT_F;
default:
else
return TEMPERATURE_FORMAT_C;
}
}
bool platform_check_steam_overlay_attached()

View File

@ -499,3 +499,72 @@ uint32 get_file_extension_type(const utf8 *path)
if (strcicmp(extension, ".td6") == 0) return FILE_EXTENSION_TD6;
return FILE_EXTENSION_UNKNOWN;
}
static void rct2_copy_files_over(const utf8 *originalDirectory, const utf8 *newDirectory, const utf8 *extension)
{
utf8 *ch, filter[MAX_PATH], oldPath[MAX_PATH], newPath[MAX_PATH];
int fileEnumHandle;
file_info fileInfo;
if (!platform_ensure_directory_exists(newDirectory)) {
log_error("Could not create directory %s.", newDirectory);
return;
}
// Create filter path
safe_strcpy(filter, originalDirectory, sizeof(filter));
ch = strchr(filter, '*');
if (ch != NULL)
*ch = 0;
safe_strcat_path(filter, "*", sizeof(filter));
path_append_extension(filter, extension, sizeof(filter));
fileEnumHandle = platform_enumerate_files_begin(filter);
while (platform_enumerate_files_next(fileEnumHandle, &fileInfo)) {
safe_strcpy(newPath, newDirectory, sizeof(newPath));
safe_strcat_path(newPath, fileInfo.path, sizeof(newPath));
safe_strcpy(oldPath, originalDirectory, sizeof(oldPath));
ch = strchr(oldPath, '*');
if (ch != NULL)
*ch = 0;
safe_strcat_path(oldPath, fileInfo.path, sizeof(oldPath));
if (!platform_file_exists(newPath))
platform_file_copy(oldPath, newPath, false);
}
platform_enumerate_files_end(fileEnumHandle);
fileEnumHandle = platform_enumerate_directories_begin(originalDirectory);
while (platform_enumerate_directories_next(fileEnumHandle, filter)) {
safe_strcpy(newPath, newDirectory, sizeof(newPath));
safe_strcat_path(newPath, filter, sizeof(newPath));
safe_strcpy(oldPath, originalDirectory, MAX_PATH);
ch = strchr(oldPath, '*');
if (ch != NULL)
*ch = 0;
safe_strcat_path(oldPath, filter, sizeof(oldPath));
if (!platform_ensure_directory_exists(newPath)) {
log_error("Could not create directory %s.", newPath);
return;
}
rct2_copy_files_over(oldPath, newPath, extension);
}
platform_enumerate_directories_end(fileEnumHandle);
}
/**
* Copy saved games and landscapes to user directory
*/
void rct2_copy_original_user_files_over()
{
utf8 path[MAX_PATH];
platform_get_user_directory(path, "save", sizeof(path));
rct2_copy_files_over((utf8*)gRCT2AddressSavedGamesPath, path, ".sv6");
platform_get_user_directory(path, "landscape", sizeof(path));
rct2_copy_files_over((utf8*)gRCT2AddressLandscapesPath, path, ".sc6");
}

View File

@ -17,165 +17,7 @@
#ifndef _RCT2_H_
#define _RCT2_H_
#include <SDL_platform.h>
#include <SDL_config.h>
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#undef M_PI
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef _MSC_VER
#include <time.h>
#endif
typedef int8_t sint8;
typedef int16_t sint16;
typedef int32_t sint32;
typedef int64_t sint64;
typedef uint8_t uint8;
typedef uint16_t uint16;
typedef uint32_t uint32;
typedef uint64_t uint64;
typedef char utf8;
typedef utf8* utf8string;
typedef const utf8* const_utf8string;
typedef wchar_t utf16;
typedef utf16* utf16string;
typedef uint32 codepoint_t;
typedef uint8 colour_t;
#define rol8(x, shift) (((uint8)(x) << (shift)) | ((uint8)(x) >> (8 - (shift))))
#define ror8(x, shift) (((uint8)(x) >> (shift)) | ((uint8)(x) << (8 - (shift))))
#define rol16(x, shift) (((uint16)(x) << (shift)) | ((uint16)(x) >> (16 - (shift))))
#define ror16(x, shift) (((uint16)(x) >> (shift)) | ((uint16)(x) << (16 - (shift))))
#define rol32(x, shift) (((uint32)(x) << (shift)) | ((uint32)(x) >> (32 - (shift))))
#define ror32(x, shift) (((uint32)(x) >> (shift)) | ((uint32)(x) << (32 - (shift))))
#define rol64(x, shift) (((uint64)(x) << (shift)) | ((uint32)(x) >> (64 - (shift))))
#define ror64(x, shift) (((uint64)(x) >> (shift)) | ((uint32)(x) << (64 - (shift))))
#ifndef __cplusplus
// in C++ you should be using Math::Min and Math::Max
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#endif // __cplusplus
#define sgn(x) ((x > 0) ? 1 : ((x < 0) ? -1 : 0))
#define clamp(l, x, h) (min(h, max(l, x)))
// Rounds an integer down to the given power of 2. y must be a power of 2.
#define floor2(x, y) ((x) & (~((y) - 1)))
// Rounds an integer up to the given power of 2. y must be a power of 2.
#define ceil2(x, y) (((x) + (y) - 1) & (~((y) - 1)))
#ifndef __cplusplus
// in C++ you should be using Util::CountOf
#ifdef __GNUC__
/**
* Force a compilation error if condition is true, but also produce a
* result (of value 0 and type size_t), so the expression can be used
* e.g. in a structure initializer (or where-ever else comma expressions
* aren't permitted).
*/
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
/* &a[0] degrades to a pointer: a different type from an array */
#define __must_be_array(a) \
BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
// based on http://lxr.free-electrons.com/source/include/linux/kernel.h#L54
#define countof(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
#elif defined (_MSC_VER)
#define countof(arr) _countof(arr)
#else
#define countof(arr) (sizeof(arr) / sizeof((arr)[0]))
#endif // __GNUC__
#endif // __cplusplus
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
#include <unistd.h>
#define STUB() log_warning("Function %s at %s:%d is a stub.\n", __PRETTY_FUNCTION__, __FILE__, __LINE__)
#define _strcmpi _stricmp
#define _stricmp(x, y) strcasecmp((x), (y))
#define _strnicmp(x, y, n) strncasecmp((x), (y), (n))
#define _strdup(x) strdup((x))
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define RCT2_ENDIANESS __ORDER_LITTLE_ENDIAN__
#define LOBYTE(w) ((uint8)(w))
#define HIBYTE(w) ((uint8)(((uint16)(w)>>8)&0xFF))
#endif // __BYTE_ORDER__
#ifndef RCT2_ENDIANESS
#error Unknown endianess!
#endif // RCT2_ENDIANESS
#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
#if !((defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700))
char *strndup(const char *src, size_t size);
#endif // !(POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)
// BSD and macOS have MAP_ANON instead of MAP_ANONYMOUS
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif
#include "version.h"
#define OPENRCT2_MASTER_SERVER_URL "https://servers.openrct2.website"
// Time (represented as number of 100-nanosecond intervals since 0001-01-01T00:00:00Z)
typedef uint64 datetime64;
#define DATETIME64_MIN ((datetime64)0)
// Represent fixed point numbers. dp = decimal point
typedef uint8 fixed8_1dp;
typedef uint8 fixed8_2dp;
typedef sint16 fixed16_1dp;
typedef sint16 fixed16_2dp;
typedef sint32 fixed32_1dp;
typedef sint32 fixed32_2dp;
// Money is stored as a multiple of 0.10.
typedef fixed8_1dp money8;
typedef fixed16_1dp money16;
typedef fixed32_1dp money32;
// Construct a fixed point number. For example, to create the value 3.65 you
// would write FIXED_2DP(3,65)
#define FIXED_XDP(x, whole, fraction) ((whole) * (10 * x) + (fraction))
#define FIXED_1DP(whole, fraction) FIXED_XDP(1, whole, fraction)
#define FIXED_2DP(whole, fraction) FIXED_XDP(10, whole, fraction)
// Construct a money value in the format MONEY(10,70) to represent 10.70. Fractional part must be two digits.
#define MONEY(whole, fraction) ((whole) * 10 + ((fraction) / 10))
#define MONEY_FREE MONEY(0,00)
#define MONEY32_UNDEFINED ((money32)0x80000000)
typedef void (EMPTY_ARGS_VOID_POINTER)();
typedef unsigned short rct_string_id;
#include "common.h"
typedef struct rct2_install_info {
uint32 installLevel;
@ -303,6 +145,7 @@ void rct2_quit();
bool rct2_open_file(const char *path);
uint32 get_file_extension_type(const utf8 *path);
void rct2_copy_original_user_files_over();
#ifdef __cplusplus
}

View File

@ -36,6 +36,7 @@ extern "C"
#include "../object.h"
#include "../openrct2.h"
#include "../peep/staff.h"
#include "../rct2.h"
#include "../ride/ride.h"
#include "../ride/ride_ratings.h"
#include "../scenario.h"

View File

@ -32,6 +32,7 @@ extern "C"
#include "../management/research.h"
#include "../openrct2.h"
#include "../peep/staff.h"
#include "../rct2.h"
#include "../ride/ride.h"
#include "../ride/ride_ratings.h"
#include "../scenario.h"
@ -384,7 +385,7 @@ extern "C"
s6Importer->LoadSavedGame(rw);
s6Importer->Import();
openrct2_reset_object_tween_locations();
sprite_position_tween_reset();
result = true;
}
catch (ObjectLoadException)
@ -411,7 +412,7 @@ extern "C"
s6Importer->LoadSavedGame(path);
s6Importer->Import();
openrct2_reset_object_tween_locations();
sprite_position_tween_reset();
result = true;
}
catch (ObjectLoadException)
@ -451,7 +452,7 @@ extern "C"
s6Importer->LoadScenario(path);
s6Importer->Import();
openrct2_reset_object_tween_locations();
sprite_position_tween_reset();
result = true;
}
catch (ObjectLoadException)
@ -485,7 +486,7 @@ extern "C"
s6Importer->LoadSavedGame(rw);
s6Importer->Import();
openrct2_reset_object_tween_locations();
sprite_position_tween_reset();
result = true;
}
catch (ObjectLoadException)

223
src/rct2/interop.c Normal file
View File

@ -0,0 +1,223 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include "../common.h"
#if defined(__WINDOWS__)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#if defined(__unix__) || defined(__MACOSX__)
#include <sys/mman.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#endif // defined(__unix__) || defined(__MACOSX__)
#include "../addresses.h"
#include "../hook.h"
#include "../openrct2.h"
#include "../util/sawyercoding.h"
#include "../util/util.h"
#include "interop.h"
#if defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__)) && !defined(NO_RCT2)
static int fdData = -1;
#endif
#if !defined(NO_RCT2)
static char * segments = (char *)(GOOD_PLACE_FOR_DATA_SEGMENT);
#endif
static void rct2_interop_get_segment_data_path(char * buffer, size_t bufferSize)
{
platform_get_exe_path(buffer, bufferSize);
safe_strcat_path(buffer, "openrct2_data", bufferSize);
}
/**
* Loads RCT2's data model and remaps the addresses.
* @returns true if the data integrity check succeeded, otherwise false.
*/
bool rct2_interop_setup_segment()
{
// OpenRCT2 on Linux and macOS is wired to have the original Windows PE sections loaded
// necessary. Windows does not need to do this as OpenRCT2 runs as a DLL loaded from the Windows PE.
int len = 0x01429000 - 0x8a4000; // 0xB85000, 12079104 bytes or around 11.5MB
int err = 0;
// in some configurations err and len may be unused
UNUSED(err);
UNUSED(len);
#if defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__)) && !defined(NO_RCT2)
#define RDATA_OFFSET 0x004A4000
#define DATASEG_OFFSET 0x005E2000
// Using PE-bear I was able to figure out all the needed addresses to be filled.
// There are three sections to be loaded: .rdata, .data and .text, plus another
// one to be mapped: DATASEG.
// Out of the three, two can simply be mmapped into memory, while the third one,
// .data has a virtual size which is much completely different to its file size
// (even when taking page-alignment into consideration)
//
// The sections are as follows (dump from gdb)
// [0] 0x401000->0x6f7000 at 0x00001000: .text ALLOC LOAD READONLY CODE HAS_CONTENTS
// [1] 0x6f7000->0x8a325d at 0x002f7000: CODESEG ALLOC LOAD READONLY CODE HAS_CONTENTS
// [2] 0x8a4000->0x9a5894 at 0x004a4000: .rdata ALLOC LOAD DATA HAS_CONTENTS
// [3] 0x9a6000->0x9e2000 at 0x005a6000: .data ALLOC LOAD DATA HAS_CONTENTS
// [4] 0x1428000->0x14282bc at 0x005e2000: DATASEG ALLOC LOAD DATA HAS_CONTENTS
// [5] 0x1429000->0x1452000 at 0x005e3000: .cms_t ALLOC LOAD READONLY CODE HAS_CONTENTS
// [6] 0x1452000->0x14aaf3e at 0x0060c000: .cms_d ALLOC LOAD DATA HAS_CONTENTS
// [7] 0x14ab000->0x14ac58a at 0x00665000: .idata ALLOC LOAD READONLY DATA HAS_CONTENTS
// [8] 0x14ad000->0x14b512f at 0x00667000: .rsrc ALLOC LOAD DATA HAS_CONTENTS
//
// .data section, however, has virtual size of 0xA81C3C, and so
// 0x9a6000 + 0xA81C3C = 0x1427C3C, which after alignment to page size becomes
// 0x1428000, which can be seen as next section, DATASEG
//
// The data is now loaded into memory with a linker script, which proves to
// be more reliable, as mallocs that happen before we reach segment setup
// could have already taken the space we need.
// TODO: UGLY, UGLY HACK!
//off_t file_size = 6750208;
utf8 segmentDataPath[MAX_PATH];
rct2_interop_get_segment_data_path(segmentDataPath, sizeof(segmentDataPath));
fdData = open(segmentDataPath, O_RDONLY);
if (fdData < 0)
{
log_fatal("failed to load openrct2_data");
exit(1);
}
log_warning("%p", GOOD_PLACE_FOR_DATA_SEGMENT);
segments = mmap((void *)(GOOD_PLACE_FOR_DATA_SEGMENT), len, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE, fdData, 0);
log_warning("%p", segments);
if ((uintptr_t)segments != GOOD_PLACE_FOR_DATA_SEGMENT) {
perror("mmap");
return false;
}
#endif // defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__))
#if defined(__unix__) && !defined(NO_RCT2)
int pageSize = getpagesize();
int numPages = (len + pageSize - 1) / pageSize;
unsigned char *dummy = malloc(numPages);
err = mincore((void *)segments, len, dummy);
bool pagesMissing = false;
if (err != 0)
{
err = errno;
#ifdef __LINUX__
// On Linux ENOMEM means all requested range is unmapped
if (err != ENOMEM)
{
pagesMissing = true;
perror("mincore");
}
#else
pagesMissing = true;
perror("mincore");
#endif // __LINUX__
} else {
for (int i = 0; i < numPages; i++)
{
if (dummy[i] != 1)
{
pagesMissing = true;
void *start = (void *)segments + i * pageSize;
void *end = (void *)segments + (i + 1) * pageSize - 1;
log_warning("required page %p - %p is not in memory!", start, end);
}
}
}
free(dummy);
if (pagesMissing)
{
log_error("At least one of required pages was not found in memory. This can cause segfaults later on.");
}
#if !defined(USE_MMAP)
// section: text
err = mprotect((void *)0x401000, 0x8a4000 - 0x401000, PROT_READ | PROT_EXEC | PROT_WRITE);
if (err != 0)
{
perror("mprotect");
}
#endif // !defined(USE_MMAP)
// section: rw data
err = mprotect((void *)segments, 0x01429000 - 0x8a4000, PROT_READ | PROT_WRITE);
if (err != 0)
{
perror("mprotect");
}
#endif // defined(__unix__)
#if defined(USE_MMAP) && defined(__WINDOWS__)
segments = VirtualAlloc((void *)(GOOD_PLACE_FOR_DATA_SEGMENT), len, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
if ((uintptr_t)segments != GOOD_PLACE_FOR_DATA_SEGMENT) {
log_error("VirtualAlloc, segments = %p, GetLastError = 0x%x", segments, GetLastError());
return false;
}
utf8 segmentDataPath[MAX_PATH];
rct2_interop_get_segment_data_path(segmentDataPath, sizeof(segmentDataPath));
SDL_RWops * rw = SDL_RWFromFile(segmentDataPath, "rb");
if (rw == NULL)
{
log_error("failed to load file");
return false;
}
if (SDL_RWread(rw, segments, len, 1) != 1) {
log_error("Unable to read chunk header!");
return false;
}
SDL_RWclose(rw);
#endif // defined(USE_MMAP) && defined(__WINDOWS__)
#if !defined(NO_RCT2) && defined(USE_MMAP)
// Check that the expected data is at various addresses.
// Start at 0x9a6000, which is start of .data, to skip the region containing addresses to DLL
// calls, which can be changed by windows/wine loader.
const uint32 c1 = sawyercoding_calculate_checksum((const uint8*)(segments + (uintptr_t)(0x009A6000 - 0x8a4000)), 0x009E0000 - 0x009A6000);
const uint32 c2 = sawyercoding_calculate_checksum((const uint8*)(segments + (uintptr_t)(0x01428000 - 0x8a4000)), 0x014282BC - 0x01428000);
const uint32 exp_c1 = 10114815;
const uint32 exp_c2 = 23564;
if (c1 != exp_c1 || c2 != exp_c2) {
log_warning("c1 = %u, expected %u, match %d", c1, exp_c1, c1 == exp_c1);
log_warning("c2 = %u, expected %u, match %d", c2, exp_c2, c2 == exp_c2);
return false;
}
#endif
return true;
}
/**
* Setup hooks to allow RCT2 to call OpenRCT2 functions instead.
*/
void rct2_interop_setup_hooks()
{
// None for now
}
void rct2_interop_dispose()
{
#if defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__)) && !defined(NO_RCT2)
munmap(segments, 12079104);
close(fdData);
#endif
}

24
src/rct2/interop.h Normal file
View File

@ -0,0 +1,24 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#ifndef _RCT2_INTEROP_H_
#define _RCT2_INTEROP_H_
bool rct2_interop_setup_segment();
void rct2_interop_setup_hooks();
void rct2_interop_dispose();
#endif

View File

@ -27,6 +27,7 @@
extern "C"
{
#include "../platform/platform.h"
#include "../rct2.h"
#include "track_design.h"
}

View File

@ -16,6 +16,7 @@
#include "../interface/window.h"
#include "../localisation/date.h"
#include "../rct2.h"
#include "../world/map.h"
#include "ride.h"
#include "ride_data.h"

View File

@ -64,8 +64,8 @@ static void paint_motionsimulator_vehicle(sint8 offsetX, sint8 offsetY, uint8 di
uint32 imageColourFlags = gTrackColours[SCHEME_MISC];
if (imageColourFlags == 0x20000000) {
imageColourFlags = IMAGE_TYPE_REMAP_2_PLUS | IMAGE_TYPE_REMAP;
imageColourFlags |= ride->vehicle_colours[0].trim_colour << 19;
imageColourFlags |= ride->vehicle_colours[0].body_colour << 24;
imageColourFlags |= ride->vehicle_colours[0].body_colour << 19;
imageColourFlags |= ride->vehicle_colours[0].trim_colour << 24;
}
simulatorImageId |= imageColourFlags;

View File

@ -1177,7 +1177,7 @@ static money32 track_place(int rideIndex, int type, int originX, int originY, in
return MONEY32_UNDEFINED;
}
if ((rideTypeFlags & RIDE_TYPE_FLAG_6) && !(byte_9D8150 & 1)) {
if ((rideTypeFlags & RIDE_TYPE_FLAG_6) && !byte_9D8150) {
mapElement = map_get_surface_element_at(x / 32, y / 32);
uint8 water_height = 2 * (mapElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK);
@ -1240,7 +1240,7 @@ static money32 track_place(int rideIndex, int type, int originX, int originY, in
maxHeight = RideData5[ride->type].max_height;
}
ride_height /= 2;
if (ride_height > maxHeight && !(byte_9D8150 & 1)) {
if (ride_height > maxHeight && !byte_9D8150) {
gGameCommandErrorText = STR_TOO_HIGH_FOR_SUPPORTS;
return MONEY32_UNDEFINED;
}

View File

@ -53,7 +53,7 @@ rct_xyz16 gTrackPreviewMax;
rct_xyz16 gTrackPreviewOrigin;
uint8 byte_F4414E;
uint8 byte_9D8150;
bool byte_9D8150;
static uint8 _trackDesignPlaceOperation;
static uint8 byte_F44150;
static money32 _trackDesignPlaceCost;
@ -1396,7 +1396,7 @@ static bool sub_6D2189(rct_track_td6 *td6, money32 *cost, uint8 *rideId, uint8 *
ride->track_colour_supports[i] = td6->track_support_colour[i];
}
byte_9D8150 |= 1;
byte_9D8150 = true;
uint8 backup_rotation = _currentTrackPieceDirection;
uint32 backup_park_flags = gParkFlags;
gParkFlags &= ~PARK_FLAGS_FORBID_HIGH_CONSTRUCTION;
@ -1426,7 +1426,7 @@ static bool sub_6D2189(rct_track_td6 *td6, money32 *cost, uint8 *rideId, uint8 *
}
_currentTrackPieceDirection = backup_rotation;
byte_9D8150 &= ~1;
byte_9D8150 = false;
*cost = resultCost;
*rideId = rideIndex;
return true;
@ -1434,7 +1434,7 @@ static bool sub_6D2189(rct_track_td6 *td6, money32 *cost, uint8 *rideId, uint8 *
_currentTrackPieceDirection = backup_rotation;
user_string_free(ride->name);
ride->type = RIDE_TYPE_NULL;
byte_9D8150 &= ~1;
byte_9D8150 = false;
return false;
}
}

View File

@ -188,7 +188,7 @@ extern rct_xyz16 gTrackPreviewMax;
extern rct_xyz16 gTrackPreviewOrigin;
extern uint8 byte_F4414E;
extern uint8 byte_9D8150;
extern bool byte_9D8150;
extern bool gTrackDesignSaveMode;
extern uint8 gTrackDesignSaveRideIndex;

View File

@ -18,6 +18,7 @@
#define _VEHICLE_H_
#include "../common.h"
#include "../world/map.h"
#pragma pack(push, 1)
/* size: 0x2 */

View File

@ -18,6 +18,7 @@
#define _TITLE_H_
#include <SDL.h>
#include "drawing/drawing.h"
enum {
TITLE_SCRIPT_WAIT,

View File

@ -310,6 +310,7 @@ int strlogicalcmp(char const *a, char const *b) {
}
assert(false);
return 0;
}
utf8 * safe_strtrunc(utf8 * text, size_t size)

View File

@ -21,6 +21,7 @@
#include "../localisation/localisation.h"
#include "../openrct2.h"
#include "../platform/platform.h"
#include "../rct2.h"
#include "../util/util.h"
#include "../world/footpath.h"
#include "../world/map.h"

View File

@ -15,11 +15,12 @@
#pragma endregion
#include "../input.h"
#include "../localisation/localisation.h"
#include "../sprites.h"
#include "../interface/themes.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../rct2.h"
#include "../sprites.h"
#include "../world/map.h"
#include "../world/scenery.h"

View File

@ -15,15 +15,16 @@
#pragma endregion
#include "../input.h"
#include "../interface/themes.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../paint/map_element/map_element.h"
#include "../paint/paint.h"
#include "../rct2.h"
#include "../ride/track_paint.h"
#include "../sprites.h"
#include "../world/map.h"
#include "../interface/themes.h"
#include "../paint/map_element/map_element.h"
#include "../ride/track_paint.h"
#include "../paint/paint.h"
enum WINDOW_DEBUG_PAINT_WIDGET_IDX
{

View File

@ -18,6 +18,7 @@
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../rct2.h"
#include "../scenario.h"
#include "../sprites.h"
#include "dropdown.h"

View File

@ -419,9 +419,7 @@ static void move_research_item(rct_research_item *beforeItem)
rct_window *w;
rct_research_item *researchItem, draggedItem;
// We only really care about `_editorInventionsListDraggedItem == beforeItem - 1`,
// but this would cause a GCC warning due to -Warray-bounds
if (_editorInventionsListDraggedItem < beforeItem)
if (_editorInventionsListDraggedItem + 1 == beforeItem)
return;
// Back up the dragged item

View File

@ -17,6 +17,7 @@
#include "../interface/viewport.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../rct2.h"
#include "../world/footpath.h"
static void window_editor_main_paint(rct_window *w, rct_drawpixelinfo *dpi);

View File

@ -20,13 +20,14 @@
#include "../interface/window.h"
#include "../localisation/date.h"
#include "../localisation/localisation.h"
#include "../rct2.h"
#include "../scenario.h"
#include "../sprites.h"
#include "../util/util.h"
#include "../world/climate.h"
#include "../world/park.h"
#include "dropdown.h"
#include "error.h"
#include "../sprites.h"
#pragma region Widgets

View File

@ -14,14 +14,15 @@
*****************************************************************************/
#pragma endregion
#include "../localisation/localisation.h"
#include "../interface/themes.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../management/finance.h"
#include "../rct2.h"
#include "../sprites.h"
#include "error.h"
#include "dropdown.h"
#include "../interface/themes.h"
#include "error.h"
#pragma region Widgets

View File

@ -18,6 +18,7 @@
#include "../localisation/localisation.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../rct2.h"
#include "error.h"
bool gDisableErrorWindowSound = false;

View File

@ -15,18 +15,17 @@
#pragma endregion
#include "../audio/audio.h"
#include "../game.h"
#include "../localisation/localisation.h"
#include "../input.h"
#include "../sprites.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../interface/viewport.h"
#include "../world/footpath.h"
#include "../world/map.h"
#include "dropdown.h"
#include "../interface/themes.h"
#include "../cheats.h"
#include "../game.h"
#include "../input.h"
#include "../interface/themes.h"
#include "../interface/viewport.h"
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include "../rct2.h"
#include "../sprites.h"
#include "../world/footpath.h"
#include "dropdown.h"
enum {
PATH_CONSTRUCTION_MODE_LAND,

View File

@ -26,6 +26,7 @@
#include "../management/news_item.h"
#include "../peep/peep.h"
#include "../peep/staff.h"
#include "../rct2.h"
#include "../sprites.h"
#include "../world/climate.h"
#include "../world/park.h"

View File

@ -15,13 +15,14 @@
#pragma endregion
#include "../input.h"
#include "../interface/themes.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../rct2.h"
#include "../sprites.h"
#include "../world/map.h"
#include "dropdown.h"
#include "../interface/themes.h"
#define MINIMUM_TOOL_SIZE 1
#define MAXIMUM_TOOL_SIZE 64

View File

@ -14,15 +14,16 @@
*****************************************************************************/
#pragma endregion
#include "../game.h"
#include "../input.h"
#include "../interface/themes.h"
#include "../interface/viewport.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../interface/viewport.h"
#include "../localisation/localisation.h"
#include "../rct2.h"
#include "../sprites.h"
#include "../world/map.h"
#include "../game.h"
#include "../interface/themes.h"
#define MINIMUM_TOOL_SIZE 1
#define MAXIMUM_TOOL_SIZE 64

View File

@ -17,6 +17,7 @@
#include "../interface/viewport.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../rct2.h"
#include "../world/footpath.h"
rct_widget window_main_widgets[] = {

View File

@ -17,12 +17,13 @@
#include "../audio/audio.h"
#include "../cheats.h"
#include "../game.h"
#include "../localisation/localisation.h"
#include "../input.h"
#include "../interface/themes.h"
#include "../interface/widget.h"
#include "../interface/viewport.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../rct2.h"
#include "../sprites.h"
#include "../world/footpath.h"
#include "../world/scenery.h"

View File

@ -35,6 +35,7 @@
#include "../localisation/date.h"
#include "../localisation/localisation.h"
#include "../platform/platform.h"
#include "../rct2.h"
#include "../sprites.h"
#include "../title.h"
#include "dropdown.h"

View File

@ -25,6 +25,7 @@
#include "../interface/window.h"
#include "../management/award.h"
#include "../peep/peep.h"
#include "../rct2.h"
#include "../ride/ride.h"
#include "../scenario.h"
#include "../sprites.h"

View File

@ -28,6 +28,7 @@
#include "../object/ObjectManager.h"
#include "../object/ObjectRepository.h"
#include "../peep/staff.h"
#include "../rct2.h"
#include "../ride/ride.h"
#include "../ride/ride_data.h"
#include "../ride/track.h"

View File

@ -22,6 +22,7 @@
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../openrct2.h"
#include "../rct2.h"
#include "../sprites.h"
enum WINDOW_SAVE_PROMPT_WIDGET_IDX {

Some files were not shown because too many files have changed in this diff Show More