|
@ -5,6 +5,9 @@ sdl
|
|||
# Compiled dll
|
||||
openrct2.dll
|
||||
|
||||
# Distribution
|
||||
distribution/windows/*.exe
|
||||
|
||||
# Build artifacts
|
||||
.cache
|
||||
|
||||
|
@ -227,4 +230,4 @@ pip-log.txt
|
|||
#IDA files
|
||||
openrct2.id*
|
||||
openrct2.nam
|
||||
openrct2.til
|
||||
openrct2.til
|
||||
|
|
|
@ -48,7 +48,7 @@ Includes all git commit authors. Aliases are GitHub user names.
|
|||
* (Balletie) - OSX
|
||||
* Kevin Burke (kevinburke) - OSX, Unix
|
||||
* Miso Zmiric (mzmiric5) - OSX
|
||||
* (JarnoVgr) - Windows build server
|
||||
* Jarno Veuger (JarnoVgr) - Windows build server
|
||||
* Ted John (IntelOrca) - Windows
|
||||
|
||||
## Documentation
|
||||
|
@ -68,6 +68,9 @@ Includes all git commit authors. Aliases are GitHub user names.
|
|||
* Spanish - (mdtrooper)
|
||||
* Swedish - (Jinxit), (mharrys)
|
||||
|
||||
## Graphics
|
||||
* OpenRCT2 Logo - xzbobzx
|
||||
|
||||
## RollerCoaster Tycoon 2 credits
|
||||
Design and programming by Chris Sawyer
|
||||
Graphics by Simon Foster
|
||||
|
|
|
@ -2679,15 +2679,15 @@ STR_2677 :???
|
|||
STR_2678 :???
|
||||
STR_2679 :???
|
||||
STR_2680 :???
|
||||
STR_2681 :???
|
||||
STR_2682 :???
|
||||
STR_2683 :???
|
||||
STR_2684 :???
|
||||
STR_2685 :???
|
||||
STR_2686 :???
|
||||
STR_2687 :???
|
||||
STR_2688 :???
|
||||
STR_2689 :???
|
||||
STR_2681 :{MEDIUMFONT}{BLACK}Krijg 5.000 extra geld
|
||||
STR_2682 :{MEDIUMFONT}{BLACK}Wissel tussen betaalde en gratis entree
|
||||
STR_2683 :{MEDIUMFONT}{BLACK}Alle bezoekers hebben een maximale tevredenheid
|
||||
STR_2684 :{MEDIUMFONT}{BLACK}Er arriveert een grote groep bezoekers
|
||||
STR_2685 :Parameters voor Simplex noise
|
||||
STR_2686 :Minimum:
|
||||
STR_2687 :Maximum:
|
||||
STR_2688 :Basisfrequentie:
|
||||
STR_2689 :Octaven:
|
||||
STR_2690 :Kaartgenerator
|
||||
STR_2691 :{WINDOW_COLOUR_2}Basishoogte:
|
||||
STR_2692 :{WINDOW_COLOUR_2}Waterniveau:
|
||||
|
@ -2698,13 +2698,13 @@ STR_2696 :Bomen plaatsen
|
|||
STR_2697 :???
|
||||
STR_2698 :???
|
||||
STR_2699 :???
|
||||
STR_2700 :???
|
||||
STR_2701 :???
|
||||
STR_2702 :???
|
||||
STR_2703 :???
|
||||
STR_2704 :???
|
||||
STR_2705 :???
|
||||
STR_2706 :???
|
||||
STR_2700 :Automatisch opslaan:
|
||||
STR_2701 :Elke week
|
||||
STR_2702 :Elke 2 weken
|
||||
STR_2703 :Elke maand
|
||||
STR_2704 :Elke 4 maanden
|
||||
STR_2705 :Elk jaar
|
||||
STR_2706 :Nooit
|
||||
STR_2707 :Open nieuw scherm
|
||||
STR_2708 :{WINDOW_COLOUR_1}Weet je zeker dat je {STRINGID} wilt vervangen?
|
||||
STR_2709 :Vervangen
|
||||
|
@ -2764,7 +2764,7 @@ STR_2762 :Betalen per rit
|
|||
STR_2763 :???
|
||||
STR_2764 :Tevreden gasten
|
||||
STR_2765 :Grote groep
|
||||
STR_2766 :???
|
||||
STR_2766 :Win scenario
|
||||
STR_2767 :Weer vastzetten
|
||||
STR_2768 :Weer vrijgeven
|
||||
STR_2769 :Park openen
|
||||
|
|
|
@ -2683,15 +2683,15 @@ STR_2677 :???
|
|||
STR_2678 :???
|
||||
STR_2679 :???
|
||||
STR_2680 :???
|
||||
STR_2681 :???
|
||||
STR_2682 :???
|
||||
STR_2683 :???
|
||||
STR_2684 :???
|
||||
STR_2685 :???
|
||||
STR_2686 :???
|
||||
STR_2687 :???
|
||||
STR_2688 :???
|
||||
STR_2689 :???
|
||||
STR_2681 :{MEDIUMFONT}{BLACK}Increases your money by 5,000
|
||||
STR_2682 :{MEDIUMFONT}{BLACK}Toggle between Free and Paid Entry
|
||||
STR_2683 :{MEDIUMFONT}{BLACK}Increases every peeps happiness to max
|
||||
STR_2684 :{MEDIUMFONT}{BLACK}Large group of peeps arrive
|
||||
STR_2685 :Simplex Noise Parameters
|
||||
STR_2686 :{WINDOW_COLOUR_2}Low:
|
||||
STR_2687 :{WINDOW_COLOUR_2}High:
|
||||
STR_2688 :{WINDOW_COLOUR_2}Base Frequency:
|
||||
STR_2689 :{WINDOW_COLOUR_2}Octaves:
|
||||
STR_2690 :Map Generation
|
||||
STR_2691 :{WINDOW_COLOUR_2}Base height:
|
||||
STR_2692 :{WINDOW_COLOUR_2}Water level:
|
||||
|
@ -2702,13 +2702,13 @@ STR_2696 :Place trees
|
|||
STR_2697 :???
|
||||
STR_2698 :???
|
||||
STR_2699 :???
|
||||
STR_2700 :???
|
||||
STR_2701 :???
|
||||
STR_2702 :???
|
||||
STR_2703 :???
|
||||
STR_2704 :???
|
||||
STR_2705 :???
|
||||
STR_2706 :???
|
||||
STR_2700 :Autosave frequency
|
||||
STR_2701 :Every week
|
||||
STR_2702 :Every 2 weeks
|
||||
STR_2703 :Every month
|
||||
STR_2704 :Every 4 months
|
||||
STR_2705 :Every year
|
||||
STR_2706 :Never
|
||||
STR_2707 :Open new window
|
||||
STR_2708 :{WINDOW_COLOUR_1}Are you sure you want to overwrite {STRINGID}?
|
||||
STR_2709 :Overwrite
|
||||
|
@ -2751,7 +2751,7 @@ STR_2745 :\
|
|||
STR_2746 :]
|
||||
STR_2747 :{ENDQUOTES}
|
||||
STR_2748 :Bar
|
||||
STR_2749 :???
|
||||
STR_2749 :My new scenario
|
||||
# New strings used in the cheats window previously these were ???
|
||||
STR_2750 :Move all items to top
|
||||
STR_2751 :Move all items to bottom
|
||||
|
|
|
@ -2683,15 +2683,15 @@ STR_2677 :???
|
|||
STR_2678 :???
|
||||
STR_2679 :???
|
||||
STR_2680 :???
|
||||
STR_2681 :???
|
||||
STR_2682 :???
|
||||
STR_2683 :???
|
||||
STR_2684 :???
|
||||
STR_2685 :???
|
||||
STR_2686 :???
|
||||
STR_2687 :???
|
||||
STR_2688 :???
|
||||
STR_2689 :???
|
||||
STR_2681 :{MEDIUMFONT}{BLACK}Increases your money by 5,000
|
||||
STR_2682 :{MEDIUMFONT}{BLACK}Toggle between Free and Paid Entry
|
||||
STR_2683 :{MEDIUMFONT}{BLACK}Increases every peeps happiness to max
|
||||
STR_2684 :{MEDIUMFONT}{BLACK}Large group of peeps arrive
|
||||
STR_2685 :Simplex Noise Parameters
|
||||
STR_2686 :{WINDOW_COLOUR_2}Low:
|
||||
STR_2687 :{WINDOW_COLOUR_2}High:
|
||||
STR_2688 :{WINDOW_COLOUR_2}Base Frequency:
|
||||
STR_2689 :{WINDOW_COLOUR_2}Octaves:
|
||||
STR_2690 :Map Generation
|
||||
STR_2691 :{WINDOW_COLOUR_2}Base height:
|
||||
STR_2692 :{WINDOW_COLOUR_2}Water level:
|
||||
|
@ -2702,13 +2702,13 @@ STR_2696 :Place trees
|
|||
STR_2697 :???
|
||||
STR_2698 :???
|
||||
STR_2699 :???
|
||||
STR_2700 :Simplex Noise Parameters
|
||||
STR_2701 :{WINDOW_COLOUR_2}Low:
|
||||
STR_2702 :{WINDOW_COLOUR_2}High:
|
||||
STR_2703 :{WINDOW_COLOUR_2}Base Frequency:
|
||||
STR_2704 :{WINDOW_COLOUR_2}Octaves:
|
||||
STR_2705 :???
|
||||
STR_2706 :???
|
||||
STR_2700 :Autosave frequency
|
||||
STR_2701 :Every week
|
||||
STR_2702 :Every 2 weeks
|
||||
STR_2703 :Every month
|
||||
STR_2704 :Every 4 months
|
||||
STR_2705 :Every year
|
||||
STR_2706 :Never
|
||||
STR_2707 :Open new window
|
||||
STR_2708 :{WINDOW_COLOUR_1}Are you sure you want to overwrite {STRINGID}?
|
||||
STR_2709 :Overwrite
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
0.2.0-beta (2015-02-06)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: Toggle between window and fullscreen.
|
||||
- Feature: Resizable window mode.
|
||||
- Feature: Mountain tool available in play mode.
|
||||
- Feature: Land tool size can now be increased to 64x64.
|
||||
- Feature: Place scenery as a random cluster available in play mode.
|
||||
- Feature: Park window viewport is resizable.
|
||||
- Feature: Extra viewport windows.
|
||||
- Feature: Windows now snap to the borders of other windows when dragging (snap radius configurable).
|
||||
- Feature: Text input is now an in game window.
|
||||
- Feature: Cheats window (CTRL-ALT-C).
|
||||
- Feature: Improved settings window with tab interface.
|
||||
- Feature: Ability to change language while in game.
|
||||
- Feature: Game configuration, cache, scores and screenshots now saved in user documents directory under OpenRCT2.
|
||||
- Feature: Finance window accessible from toolbar (enabled in settings).
|
||||
- Feature: Research and development / research funding now accessible as a stand alone window without the requirement of the finances window.
|
||||
- Feature: Ability to change game speed (+ and - keys)
|
||||
- Feature: The "have fun" objective can now be selected in the scenario editor.
|
||||
- Feature: RollerCoaster Tycoon 1 scenarios can now be opened in the scenario editor or by using the 'edit' command line action.
|
||||
- Feature: Title sequence music can now be disabled or changed to the RollerCoaster Tycoon 1 theme music.
|
||||
- Feature: (Random) map generator available in scenario editor, accessible via the view menu.
|
||||
- Fix: Litter bins now get full and require emptying by handymen.
|
|
@ -0,0 +1,147 @@
|
|||
Last updated: 2015-02-06
|
||||
Release version: 0.2.0-beta
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
Table of contents
|
||||
-----------------
|
||||
1.0) About
|
||||
2.0) Contacting
|
||||
* 2.1) Reporting bugs
|
||||
3.0) Supported platforms
|
||||
4.0) Installing and running OpenRCT2
|
||||
5.0) Development
|
||||
6.0) Translation
|
||||
7.0) Troubleshooting
|
||||
8.0) Licensing
|
||||
9.0) Credits
|
||||
|
||||
1.0) About
|
||||
---- -----
|
||||
OpenRCT2 is an amusement park simulation game based upon the popular game
|
||||
RollerCoaster Tycoon 2, written by Chris Sawyer. It attempts to mimic the
|
||||
original game as closely as possible while extending it with new features.
|
||||
|
||||
OpenRCT2 is licensed under the GNU General Public License version 3.0, but
|
||||
includes some 3rd party software under different licenses. See the section
|
||||
"Licensing" below for details.
|
||||
|
||||
2.0) Contacting
|
||||
---- ----------
|
||||
The easiest way to contact the OpenRCT2 team is by submitting issues on GitHub
|
||||
(https://github.com/IntelOrca/OpenRCT2) in the form of questions or bug reports.
|
||||
You can also chat with us on gitter (https://gitter.im/IntelOrca/OpenRCT2).
|
||||
|
||||
2.1) Reporting bugs
|
||||
---- --------------
|
||||
GitHub is used for tracking bugs in OpenRCT2. Please check if the bug has
|
||||
already been reported using the search functionality before submitting.
|
||||
|
||||
When you are sure it is not already reported you should:
|
||||
* Make sure you are running a recent version, i.e. run the latest stable or
|
||||
nightly based on where you found the bug.
|
||||
* Make sure you are not running a non-official binary, like a fork.
|
||||
When you are playing with a fork you should report any bugs to the bug
|
||||
tracker for that fork which is most likely another GitHub repository.
|
||||
* Make it reproducible for the developers. In other words, create a savegame
|
||||
in which you can reproduce the issue once loaded. It is very useful to give
|
||||
us the crash.dmp, crash.sav, crash.log and crash screenshot which are
|
||||
created on crashes.
|
||||
* Check whether the bug is already reported on our bug tracker. This includes
|
||||
searching for recently closed bug reports as the bug might already be fixed.
|
||||
|
||||
After you have done all that you can report the bug. Please include the
|
||||
following information in your bug report:
|
||||
* OpenRCT2 version (PLEASE test the latest git develop build)
|
||||
* Bug details, including instructions how to reproduce it
|
||||
* Platform (Windows, Linux, FreeBSD, ...) and compiler (including version) if
|
||||
you compiled OpenRCT2 yourself.
|
||||
* The processor architecture of your OS (32 bits Windows, 64 bits Windows,
|
||||
Linux on an ARM, Mac OS X on a PowerPC, ...)
|
||||
* The language and culture your operating system is using.
|
||||
* Attach a saved game *and* a screenshot if possible
|
||||
* If this bug only occurred recently please note the last version without
|
||||
the bug and the first version including the bug. That way we can fix it
|
||||
quicker by looking at the changes made.
|
||||
* Attach crash.dmp, crash.log and crash.sav. These files are usually created
|
||||
next to your openrct2.cfg. The crash handler will tell you the location.
|
||||
|
||||
3.0) Supported platforms
|
||||
---- -------------------
|
||||
OpenRCT2 currently requires the original RollerCoaster Tycoon 2 binary. While
|
||||
this is still the case, the only supported platform is Windows. OpenRCT2 can
|
||||
still be played on other operating systems either via a virtual machine or a
|
||||
compatibility layer application such as Wine. Further instructions can be found
|
||||
on GitHub.
|
||||
|
||||
4.0) Installing and running OpenRCT2
|
||||
---- ------------------------------
|
||||
Installing OpenRCT2 is fairly straightforward. Either you have downloaded an
|
||||
archive which you have to extract to a directory where you want OpenRCT2 to
|
||||
be installed, or you have downloaded an installer, which will automatically
|
||||
extract OpenRCT2 in the given directory.
|
||||
|
||||
OpenRCT2 requires an installation of RollerCoaster Tycoon 2 (RCT2) to run. You
|
||||
must have either installed the original RCT2 disc, the GOG version or the steam
|
||||
version. Alternatively you can manually specify the location of where your RCT2
|
||||
data files are. These may be directly copied of the original disc and placed in
|
||||
a directory of your choice.
|
||||
|
||||
When you start OpenRCT2 for the first time, it will look for the RCT2 data files
|
||||
in the following locations:
|
||||
- C:\Program Files\Infogrames\RollerCoaster Tycoon 2",
|
||||
- C:\Program Files (x86)\Infogrames\RollerCoaster Tycoon 2",
|
||||
- C:\Program Files\Infogrames Interactive\RollerCoaster Tycoon 2",
|
||||
- C:\Program Files (x86)\Infogrames Interactive\RollerCoaster Tycoon 2",
|
||||
- C:\Program Files\Atari\RollerCoaster Tycoon 2",
|
||||
- C:\Program Files (x86)\Atari\RollerCoaster Tycoon 2",
|
||||
- C:\GOG Games\RollerCoaster Tycoon 2 Triple Thrill Pack"
|
||||
|
||||
If none of these locations are found, OpenRCT2 will ask you to manually specify
|
||||
the directory. Alternatively after running OpenRCT2 for the first time, you can
|
||||
edit openrct2.cfg in the OpenRCT2 sub directory of your documents folder to set
|
||||
the RCT2 install path.
|
||||
|
||||
If you are running Windows and have set a DPI scale, OpenRCT2 might look blury.
|
||||
This is because OpenRCT2 currently uses the original RollerCoaster Tycoon 2
|
||||
binary as a application host. However you can manually configure this binary to
|
||||
not be scaled. This will make the game more crisp, but may result in the
|
||||
interface being too small to see clearly and less ergonomic to use. To stop DPI
|
||||
scaling, right click the binary itself (openrct2.exe) in the install directory
|
||||
or the OpenRCT2 shortcut either in your start menu or on your desktop and then
|
||||
select properties. Select the compatibility tab, check
|
||||
"Disable display scaling on high DPI settings" and then click OK.
|
||||
|
||||
5.0) Development
|
||||
---- -----------
|
||||
OpenRCT2 is an open-source collaborative project. It is developed voluntarily
|
||||
and hosted on GitHub. If you would like to contribute to the development of
|
||||
OpenRCT2, please read the readme file in the OpenRCT2 repository or on the main
|
||||
GitHub page at (https://github.com/IntelOrca/OpenRCT2). This gives more detailed
|
||||
information about the project, its roadmap and how to compile the source code.
|
||||
|
||||
6.0) Translation
|
||||
---- -----------
|
||||
For more information about the game's translation and how to contribute, please
|
||||
visit the GitHub page and wiki at (https://github.com/IntelOrca/OpenRCT2).
|
||||
|
||||
7.0) Troubleshooting
|
||||
---- ---------------
|
||||
If you are having problems running OpenRCT2, you can run OpenRCT2 in verbose
|
||||
mode to view a detailed diagnostic log. This can be activated by running the
|
||||
game via Command Prompt or PowerShell with the command line switch --verbose.
|
||||
|
||||
This log can help pinpoint where a problem exists and is a useful resource if
|
||||
you wish to ask online for help.
|
||||
|
||||
8.0) Licensing
|
||||
---- ---------
|
||||
OpenRCT2 is licensed under the GNU General Public License version 3.0. For
|
||||
the complete license text, see the file 'licence.txt'. This license applies
|
||||
to all files in this distribution, except as noted below.
|
||||
|
||||
The Simple DirectMedia Layer (SDL2) library is licensed under the zlib licence.
|
||||
|
||||
9.0) Credits
|
||||
---- -------
|
||||
For the full list of contributors to OpenRCT2, see the file 'contributors.md'.
|
|
@ -0,0 +1,2 @@
|
|||
Write-Output "Building Windows Installer (NSIS script)";
|
||||
makensis /DVERSION_INCLUDE=win32.txt install.nsi > win32.log;
|
|
@ -0,0 +1,500 @@
|
|||
# Version numbers to update
|
||||
!define /ifndef APPV_MAJOR 0
|
||||
!define /ifndef APPV_MINOR 2
|
||||
!define /ifndef APPV_MAINT 0
|
||||
!define /ifndef APPV_BUILD 0
|
||||
!define /ifndef APPV_EXTRA "-beta"
|
||||
|
||||
!define APPNAME "OpenRCT2" ; Define application name
|
||||
!define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version
|
||||
!define APPVERSIONINTERNAL "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}.${APPV_BUILD}" ; Define application version in X.X.X.X
|
||||
!include ${VERSION_INCLUDE}
|
||||
|
||||
!define /ifndef APPURLLINK "https://github.com/IntelOrca/OpenRCT2"
|
||||
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}"
|
||||
|
||||
; Define root variable relative to installer
|
||||
!define PATH_ROOT "..\..\"
|
||||
|
||||
!define MUI_ICON "${PATH_ROOT}resources\logo\icon.ico"
|
||||
!define MUI_UNICON "${PATH_ROOT}resources\logo\icon.ico"
|
||||
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
|
||||
!define MUI_HEADERIMAGE
|
||||
!define MUI_HEADERIMAGE_BITMAP "top.bmp"
|
||||
|
||||
BrandingText "OpenRCT2 Installer"
|
||||
SetCompressor LZMA
|
||||
|
||||
; Version Info
|
||||
VIProductVersion "${APPVERSIONINTERNAL}"
|
||||
VIAddVersionKey "ProductName" "OpenRCT2 ${APPBITS}-bit Installer for Windows ${EXTRA_VERSION}"
|
||||
VIAddVersionKey "Comments" "Installs ${APPNAMEANDVERSION}"
|
||||
VIAddVersionKey "CompanyName" "OpenRCT2 Developers"
|
||||
VIAddVersionKey "FileDescription" "Installs ${APPNAMEANDVERSION}"
|
||||
VIAddVersionKey "ProductVersion" "${APPVERSION}"
|
||||
VIAddVersionKey "InternalName" "InstOpenRCT2-${APPARCH}"
|
||||
VIAddVersionKey "FileVersion" "${APPVERSION}-${APPARCH}"
|
||||
VIAddVersionKey "LegalCopyright" " "
|
||||
; Main Install settings
|
||||
Name "${APPNAMEANDVERSION} ${APPBITS}-bit for Windows ${EXTRA_VERSION}"
|
||||
|
||||
; NOTE: Keep trailing backslash!
|
||||
InstallDirRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "Install Folder"
|
||||
!ifndef OUTFILE
|
||||
!define OUTFILE "openrct2-${APPVERSION}-${APPARCH}.exe"
|
||||
!endif
|
||||
OutFile "${OUTFILE}"
|
||||
CRCCheck force
|
||||
|
||||
ShowInstDetails show
|
||||
ShowUninstDetails show
|
||||
|
||||
RequestExecutionLevel admin
|
||||
|
||||
Var SHORTCUTS
|
||||
|
||||
; Modern interface settings
|
||||
!include "MUI2.nsh"
|
||||
!include "InstallOptions.nsh"
|
||||
!include "WinVer.nsh"
|
||||
!include "x64.nsh"
|
||||
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_WELCOMEPAGE_TITLE_3LINES
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_LICENSE "..\..\licence.txt"
|
||||
|
||||
!define MUI_COMPONENTSPAGE_SMALLDESC
|
||||
!insertmacro MUI_PAGE_COMPONENTS
|
||||
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
|
||||
ManifestDPIAware true
|
||||
|
||||
;Start Menu Folder Page Configuration
|
||||
!define MUI_STARTMENUPAGE_DEFAULTFOLDER $SHORTCUTS
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKEY_LOCAL_MACHINE"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Shortcut Folder"
|
||||
|
||||
!insertmacro MUI_PAGE_STARTMENU "OpenRCT2" $SHORTCUTS
|
||||
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
!define MUI_FINISHPAGE_TITLE_3LINES
|
||||
!define MUI_FINISHPAGE_RUN_TEXT "Run ${APPNAMEANDVERSION} now!"
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR\openrct2.exe"
|
||||
!define MUI_FINISHPAGE_LINK "Visit the OpenRCT2 site for more information"
|
||||
!define MUI_FINISHPAGE_LINK_LOCATION "${APPURLLINK}"
|
||||
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
|
||||
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\readme.txt"
|
||||
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
|
||||
!define MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT DisableBack
|
||||
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
!define MUI_PAGE_HEADER_TEXT "Uninstall ${APPNAMEANDVERSION}"
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
; Set languages (first is default language)
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||
|
||||
;--------------------------------------------------------------
|
||||
; (Core) OpenRCT2 install section. Copies all internal game data
|
||||
Section "!OpenRCT2" Section1
|
||||
; Make sure to be upgraded OpenRCT2 is not running
|
||||
Call CheckOpenRCT2Running
|
||||
|
||||
; Overwrite files by default, but don't complain on failure
|
||||
SetOverwrite try
|
||||
|
||||
SetShellVarContext all
|
||||
|
||||
; Copy language files
|
||||
SetOutPath "$INSTDIR\data\language\"
|
||||
File ${PATH_ROOT}data\language\*.txt
|
||||
|
||||
; Copy data files
|
||||
SetOutPath "$INSTDIR\data\"
|
||||
File /r ${PATH_ROOT}data\*
|
||||
|
||||
; Copy the rest of the stuff
|
||||
SetOutPath "$INSTDIR\"
|
||||
|
||||
; Copy text files
|
||||
File ..\changelog.txt
|
||||
Push "$INSTDIR\changelog.txt"
|
||||
Call unix2dos
|
||||
File ..\..\licence.txt
|
||||
Push "$INSTDIR\licence.txt"
|
||||
Call unix2dos
|
||||
File ..\readme.txt
|
||||
Push "$INSTDIR\readme.txt"
|
||||
Call unix2dos
|
||||
File ..\..\contributors.md
|
||||
Push "$INSTDIR\contributors.md"
|
||||
Call unix2dos
|
||||
|
||||
; Copy executable
|
||||
File /oname=openrct2.exe ${BINARY_DIR}\openrct2.exe
|
||||
File /oname=openrct2.dll ${BINARY_DIR}\openrct2.dll
|
||||
File /oname=SDL2.dll ${BINARY_DIR}\SDL2.dll
|
||||
|
||||
; Create the Registry Entries
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "Comments" "Visit ${APPURLLINK}"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "DisplayIcon" "$INSTDIR\openrct2.exe,0"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "DisplayName" "OpenRCT2 ${APPVERSION}"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "DisplayVersion" "${APPVERSION}"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "HelpLink" "${APPURLLINK}"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "Install Folder" "$INSTDIR"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "Publisher" "OpenRCT2"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "Shortcut Folder" "$SHORTCUTS"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "UninstallString" "$INSTDIR\uninstall.exe"
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "URLInfoAbout" "${APPURLLINK}"
|
||||
; This key sets the Version DWORD that new installers will check against
|
||||
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "Version" "${APPVERSIONINTERNAL}"
|
||||
|
||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN "OpenRCT2"
|
||||
CreateShortCut "$DESKTOP\OpenRCT2.lnk" "$INSTDIR\openrct2.exe"
|
||||
CreateDirectory "$SMPROGRAMS\$SHORTCUTS"
|
||||
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\OpenRCT2.lnk" "$INSTDIR\openrct2.exe"
|
||||
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk" "$INSTDIR\uninstall.exe"
|
||||
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Readme.lnk" "$INSTDIR\Readme.txt"
|
||||
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk" "$INSTDIR\Changelog.txt"
|
||||
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Contributors.lnk" "$INSTDIR\contributors.md"
|
||||
!insertmacro MUI_STARTMENU_WRITE_END
|
||||
SectionEnd
|
||||
|
||||
;-------------------------------------------
|
||||
; Install the uninstaller (option is hidden)
|
||||
Section -FinishSection
|
||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||
SectionEnd
|
||||
|
||||
; Modern install component descriptions
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "Minimal OpenRCT2 installation in English. You must have RollerCoaster Tycoon 2 installed."
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
||||
;-----------------------------------------------
|
||||
; Uninstall section, deletes all installed files
|
||||
Section "Uninstall"
|
||||
SetShellVarContext all
|
||||
|
||||
; Remove from registry...
|
||||
!insertmacro MUI_STARTMENU_GETFOLDER "OpenRCT2" $SHORTCUTS
|
||||
ReadRegStr $SHORTCUTS HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "Shortcut Folder"
|
||||
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2"
|
||||
|
||||
; Delete self
|
||||
Delete "$INSTDIR\uninstall.exe"
|
||||
|
||||
; Delete Shortcuts
|
||||
Delete "$DESKTOP\OpenRCT2.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\OpenRCT2.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\Readme.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk"
|
||||
Delete "$SMPROGRAMS\$SHORTCUTS\Contributors.lnk"
|
||||
|
||||
; Clean up OpenRCT2 dir
|
||||
Delete "$INSTDIR\changelog.txt"
|
||||
Delete "$INSTDIR\readme.txt"
|
||||
Delete "$INSTDIR\contributors.md"
|
||||
Delete "$INSTDIR\openrct2.exe"
|
||||
Delete "$INSTDIR\openrct2.dll"
|
||||
Delete "$INSTDIR\SDL2.dll"
|
||||
Delete "$INSTDIR\licence.txt"
|
||||
Delete "$INSTDIR\INSTALL.LOG"
|
||||
Delete "$INSTDIR\crash.log"
|
||||
Delete "$INSTDIR\crash.dmp"
|
||||
|
||||
; Data files
|
||||
Delete "$INSTDIR\data\language\*.txt"
|
||||
Delete "$INSTDIR\data\title\*.*"
|
||||
|
||||
; Remove remaining directories
|
||||
RMDir "$SMPROGRAMS\$SHORTCUTS"
|
||||
RMDir "$INSTDIR\data"
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
SectionEnd
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; Determine windows version, returns "win9x" if Win9x/Me/2000/XP SP2- or "winnt" for the rest on the stack
|
||||
Function GetWindowsVersion
|
||||
ClearErrors
|
||||
StrCpy $R0 "win9x"
|
||||
|
||||
${If} ${RunningX64}
|
||||
goto WinNT
|
||||
${EndIf}
|
||||
|
||||
${If} ${IsNT}
|
||||
${If} ${IsWinXP}
|
||||
${AndIf} ${AtLeastServicePack} 3
|
||||
${OrIf} ${AtLeastWin2003}
|
||||
GoTo WinNT
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
GoTo Done
|
||||
WinNT:
|
||||
StrCpy $R0 "winnt"
|
||||
Done:
|
||||
Push $R0
|
||||
FunctionEnd
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; Check whether we're not running an installer for 64 bits on 32 bits and vice versa
|
||||
Function CheckProcessorArchitecture
|
||||
ClearErrors
|
||||
${If} ${RunningX64}
|
||||
IntCmp ${APPBITS} 64 Done 0
|
||||
MessageBox MB_YESNO|MB_ICONINFORMATION "You are trying to install the 32-bit OpenRCT2 on a 64-bit operating system. This is not advised, but will work with reduced capabilities. We suggest that you download the correct version. Do you really want to continue?" IDYES Done IDNO Abort
|
||||
${Else}
|
||||
IntCmp ${APPBITS} 64 0 Done
|
||||
MessageBox MB_YESNO|MB_ICONSTOP "You are trying to install the 64-bit OpenRCT2 on a 32-bit operating system. This is not going to work. Please download the correct version. Do you really want to continue?" IDYES Done IDNO Abort
|
||||
${EndIf}
|
||||
GoTo Done
|
||||
Abort:
|
||||
Quit
|
||||
Done:
|
||||
FunctionEnd
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; Check whether we're not running an installer for NT on 9x and vice versa
|
||||
Function CheckWindowsVersion
|
||||
Call GetWindowsVersion
|
||||
Pop $R0
|
||||
StrCmp $R0 "win9x" 0 WinNT
|
||||
ClearErrors
|
||||
StrCmp ${APPARCH} "win9x" Done 0
|
||||
MessageBox MB_YESNO|MB_ICONSTOP "You are trying to install the Windows XP SP3, Vista, 7 and 8.1 version on Windows 95, 98, ME, 2000 and XP without SP3. This is will not work. Please download the correct version. Do you really want to continue?" IDYES Done IDNO Abort
|
||||
GoTo Done
|
||||
WinNT:
|
||||
ClearErrors
|
||||
StrCmp ${APPARCH} "win9x" 0 Done
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION "You are trying to install the Windows 95, 98, 2000 and XP without SP3 version on Windows XP SP3, Vista, 7 and 8.1. This is not advised, but will work with reduced capabilities. We suggest that you download the correct version. Do you really want to continue?" IDYES Done IDNO Abort
|
||||
Abort:
|
||||
Quit
|
||||
Done:
|
||||
FunctionEnd
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; Check whether OpenRCT2 is running
|
||||
Function CheckOpenRCT2Running
|
||||
IfFileExists "$INSTDIR\openrct2.exe" 0 Done
|
||||
Retry:
|
||||
FindProcDLL::FindProc "openrct2.exe"
|
||||
Pop $R0
|
||||
IntCmp $R0 1 0 Done
|
||||
ClearErrors
|
||||
Delete "$INSTDIR\openrct2.exe"
|
||||
IfErrors 0 Done
|
||||
ClearErrors
|
||||
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "OpenRCT2 is running. Please close it and retry." IDRETRY Retry
|
||||
Abort
|
||||
Done:
|
||||
FunctionEnd
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; strips all CRs
|
||||
; and then converts all LFs into CRLFs
|
||||
; (this is roughly equivalent to "cat file | dos2unix | unix2dos")
|
||||
;
|
||||
; usage:
|
||||
; Push "infile"
|
||||
; Call unix2dos
|
||||
;
|
||||
; beware that this function destroys $0 $1 $2
|
||||
Function unix2dos
|
||||
ClearErrors
|
||||
|
||||
Pop $2
|
||||
Rename $2 $2.U2D
|
||||
FileOpen $1 $2 w
|
||||
|
||||
FileOpen $0 $2.U2D r
|
||||
|
||||
Push $2 ; save name for deleting
|
||||
|
||||
IfErrors unix2dos_done
|
||||
|
||||
; $0 = file input (opened for reading)
|
||||
; $1 = file output (opened for writing)
|
||||
|
||||
unix2dos_loop:
|
||||
; read a byte (stored in $2)
|
||||
FileReadByte $0 $2
|
||||
IfErrors unix2dos_done ; EOL
|
||||
; skip CR
|
||||
StrCmp $2 13 unix2dos_loop
|
||||
; if LF write an extra CR
|
||||
StrCmp $2 10 unix2dos_cr unix2dos_write
|
||||
|
||||
unix2dos_cr:
|
||||
FileWriteByte $1 13
|
||||
|
||||
unix2dos_write:
|
||||
; write byte
|
||||
FileWriteByte $1 $2
|
||||
; read next byte
|
||||
Goto unix2dos_loop
|
||||
|
||||
unix2dos_done:
|
||||
; close files
|
||||
FileClose $0
|
||||
FileClose $1
|
||||
|
||||
; delete original
|
||||
Pop $0
|
||||
Delete $0.U2D
|
||||
|
||||
FunctionEnd
|
||||
|
||||
;-----------------------------------------------------------------------------------
|
||||
; Properly compare 2 versions
|
||||
; syntax:
|
||||
; ${VersionCompare} "[Version1]" "[Version2]" $var
|
||||
; output:
|
||||
; $var=0 Versions are equal
|
||||
; $var=1 Version1 is newer
|
||||
; $var=2 Version2 is newer
|
||||
Function VersionCompare
|
||||
!define VersionCompare `!insertmacro VersionCompareCall`
|
||||
|
||||
!macro VersionCompareCall _VER1 _VER2 _RESULT
|
||||
Push `${_VER1}`
|
||||
Push `${_VER2}`
|
||||
Call VersionCompare
|
||||
Pop ${_RESULT}
|
||||
!macroend
|
||||
|
||||
Exch $1
|
||||
Exch
|
||||
Exch $0
|
||||
Exch
|
||||
Push $2
|
||||
Push $3
|
||||
Push $4
|
||||
Push $5
|
||||
Push $6
|
||||
Push $7
|
||||
|
||||
begin:
|
||||
StrCpy $2 -1
|
||||
IntOp $2 $2 + 1
|
||||
StrCpy $3 $0 1 $2
|
||||
StrCmp $3 '' +2
|
||||
StrCmp $3 '.' 0 -3
|
||||
StrCpy $4 $0 $2
|
||||
IntOp $2 $2 + 1
|
||||
StrCpy $0 $0 '' $2
|
||||
|
||||
StrCpy $2 -1
|
||||
IntOp $2 $2 + 1
|
||||
StrCpy $3 $1 1 $2
|
||||
StrCmp $3 '' +2
|
||||
StrCmp $3 '.' 0 -3
|
||||
StrCpy $5 $1 $2
|
||||
IntOp $2 $2 + 1
|
||||
StrCpy $1 $1 '' $2
|
||||
|
||||
StrCmp $4$5 '' equal
|
||||
|
||||
StrCpy $6 -1
|
||||
IntOp $6 $6 + 1
|
||||
StrCpy $3 $4 1 $6
|
||||
StrCmp $3 '0' -2
|
||||
StrCmp $3 '' 0 +2
|
||||
StrCpy $4 0
|
||||
|
||||
StrCpy $7 -1
|
||||
IntOp $7 $7 + 1
|
||||
StrCpy $3 $5 1 $7
|
||||
StrCmp $3 '0' -2
|
||||
StrCmp $3 '' 0 +2
|
||||
StrCpy $5 0
|
||||
|
||||
StrCmp $4 0 0 +2
|
||||
StrCmp $5 0 begin newer2
|
||||
StrCmp $5 0 newer1
|
||||
IntCmp $6 $7 0 newer1 newer2
|
||||
|
||||
StrCpy $4 '1$4'
|
||||
StrCpy $5 '1$5'
|
||||
IntCmp $4 $5 begin newer2 newer1
|
||||
|
||||
equal:
|
||||
StrCpy $0 0
|
||||
goto end
|
||||
newer1:
|
||||
StrCpy $0 1
|
||||
goto end
|
||||
newer2:
|
||||
StrCpy $0 2
|
||||
|
||||
end:
|
||||
Pop $7
|
||||
Pop $6
|
||||
Pop $5
|
||||
Pop $4
|
||||
Pop $3
|
||||
Pop $2
|
||||
Pop $1
|
||||
Exch $0
|
||||
FunctionEnd
|
||||
|
||||
|
||||
Var OLDVERSION
|
||||
Var UninstallString
|
||||
|
||||
;-----------------------------------------------------------------------------------
|
||||
; NSIS Initialize function, determine if we are going to install/upgrade or uninstall
|
||||
Function .onInit
|
||||
StrCpy $SHORTCUTS "OpenRCT2"
|
||||
|
||||
SectionSetFlags 0 17
|
||||
|
||||
; Starts Setup - let's look for an older version of OpenRCT2
|
||||
ReadRegStr $R8 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "Version"
|
||||
|
||||
IfErrors ShowWelcomeMessage ShowUpgradeMessage
|
||||
ShowWelcomeMessage:
|
||||
ReadRegStr $R8 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "Version"
|
||||
IfErrors FinishCallback
|
||||
|
||||
ShowUpgradeMessage:
|
||||
${VersionCompare} "${APPVERSIONINTERNAL}" "$R8" $R0
|
||||
IntCmp $R0 1 WelcomeToSetup VersionsAreEqual InstallerIsOlder
|
||||
WelcomeToSetup:
|
||||
; An older version was found. Let's let the user know there's an upgrade that will take place.
|
||||
ReadRegStr $OLDVERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "DisplayVersion"
|
||||
; Gets the older version then displays it in a message box
|
||||
MessageBox MB_OK|MB_ICONINFORMATION \
|
||||
"Welcome to ${APPNAMEANDVERSION} Setup.$\nThis will allow you to upgrade from version $OLDVERSION."
|
||||
Goto FinishCallback
|
||||
|
||||
VersionsAreEqual:
|
||||
ReadRegStr $UninstallString HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "UninstallString"
|
||||
IfFileExists "$UninstallString" "" FinishCallback
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION \
|
||||
"Setup detected ${APPNAMEANDVERSION} on your system. This is the same version that this program will install.$\nAre you trying to uninstall it?" \
|
||||
IDYES DoUninstall IDNO FinishCallback
|
||||
DoUninstall: ; You have the same version as this installer. This allows you to uninstall.
|
||||
Exec "$UninstallString"
|
||||
Quit
|
||||
|
||||
InstallerIsOlder:
|
||||
MessageBox MB_OK|MB_ICONSTOP \
|
||||
"You have a newer version of ${APPNAME}.$\nSetup will now exit."
|
||||
Quit
|
||||
|
||||
FinishCallback:
|
||||
ClearErrors
|
||||
; Call CheckProcessorArchitecture
|
||||
; Call CheckWindowsVersion
|
||||
FunctionEnd
|
||||
; eof
|
|
@ -0,0 +1,6 @@
|
|||
# Windows Installer
|
||||
This directory contains the script and resources for the Windows installer. The installer is created using [Nullsoft Scriptable Install System (NSIS)](http://nsis.sourceforge.net) version v3.0a0+.
|
||||
|
||||
As there is currently only a 32 bit version of OpenRCT2 available, the architecture and windows version checks have been disabled. These will be re-enabled once OpenRCT2 is a stand alone executable.
|
||||
|
||||
Code based on [OpenTTD](http://openttd.org) installer.
|
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 51 KiB |
|
@ -0,0 +1,5 @@
|
|||
!define APPBITS 32 ; Define number of bits for the architecture
|
||||
!define EXTRA_VERSION "XP SP3, Vista, 7 and 8.1"
|
||||
!define APPARCH "win32" ; Define the application architecture
|
||||
!define BINARY_DIR "${PATH_ROOT}build\Release"
|
||||
InstallDir "$PROGRAMFILES32\OpenRCT2\"
|
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 104 KiB |
After Width: | Height: | Size: 99 KiB |
After Width: | Height: | Size: 143 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 756 B |
After Width: | Height: | Size: 388 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 168 B |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 319 B |
|
@ -0,0 +1,44 @@
|
|||
<Query Kind="Statements">
|
||||
<Namespace>System.Drawing</Namespace>
|
||||
<Namespace>System.Drawing.Imaging</Namespace>
|
||||
</Query>
|
||||
|
||||
string inputDirectory = @"C:\Users\Ted\Documents\Programming\Projects\Hacking\OpenRCT2\resources\logo";
|
||||
string outputPath = @"C:\Users\Ted\Documents\Programming\Projects\Hacking\OpenRCT2\resources\logo\icon.ico";
|
||||
int numImages = 7;
|
||||
using (FileStream fs = new FileStream(outputPath, FileMode.Create)) {
|
||||
BinaryWriter bw = new BinaryWriter(fs);
|
||||
bw.Write((short)0);
|
||||
bw.Write((short)1);
|
||||
bw.Write((short)numImages);
|
||||
|
||||
int dataStartOffset = 6 + (numImages * 16);
|
||||
|
||||
using (MemoryStream dataStream = new MemoryStream()) {
|
||||
int size = 256;
|
||||
for (int i = 0; i < numImages; i++) {
|
||||
bw.Write((byte)(size == 256 ? 0 : size));
|
||||
bw.Write((byte)(size == 256 ? 0 : size));
|
||||
bw.Write((byte)0);
|
||||
bw.Write((byte)0);
|
||||
bw.Write((short)0);
|
||||
bw.Write((short)32);
|
||||
|
||||
int dataOffset = (int)dataStream.Position;
|
||||
int dataLength;
|
||||
|
||||
string inputImagePath = Path.Combine(inputDirectory, "icon_x" + size + ".png");
|
||||
using (Image image = Image.FromFile(inputImagePath))
|
||||
image.Save(dataStream, ImageFormat.Png);
|
||||
|
||||
dataLength = (int)dataStream.Position - dataOffset;
|
||||
dataOffset += dataStartOffset;
|
||||
|
||||
bw.Write(dataLength);
|
||||
bw.Write(dataOffset);
|
||||
|
||||
size /= 2;
|
||||
}
|
||||
bw.Write(dataStream.ToArray());
|
||||
}
|
||||
}
|
20
src/config.c
|
@ -140,6 +140,7 @@ config_enum_definition _languageEnum[] = {
|
|||
|
||||
config_property_definition _generalDefinitions[] = {
|
||||
{ offsetof(general_configuration, always_show_gridlines), "always_show_gridlines", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
|
||||
{ offsetof(general_configuration, autosave_frequency), "autosave", CONFIG_VALUE_TYPE_UINT8, AUTOSAVE_EVERY_MONTH, NULL },
|
||||
{ offsetof(general_configuration, confirmation_prompt), "confirmation_prompt", CONFIG_VALUE_TYPE_UINT8, 0, NULL },
|
||||
{ offsetof(general_configuration, construction_marker_colour), "construction_marker_colour", CONFIG_VALUE_TYPE_UINT8, false, NULL },
|
||||
{ offsetof(general_configuration, currency_format), "currency_format", CONFIG_VALUE_TYPE_UINT8, CURRENCY_POUNDS, _currencyEnum },
|
||||
|
@ -200,7 +201,24 @@ void config_set_defaults()
|
|||
config_property_definition *property = §ion->property_definitions[j];
|
||||
|
||||
value_union *destValue = (value_union*)((size_t)section->base_address + (size_t)property->offset);
|
||||
memcpy(destValue, &property->default_value, _configValueTypeSize[property->type]);
|
||||
|
||||
if (strcmp(property->property_name, "language") == 0){
|
||||
destValue->value_uint16 = platform_get_locale_language();
|
||||
if (destValue->value_uint16 == LANGUAGE_UNDEFINED)
|
||||
memcpy(destValue, &property->default_value, _configValueTypeSize[property->type]);
|
||||
}
|
||||
else if (strcmp(property->property_name, "currency_format") == 0){
|
||||
destValue->value_uint8 = platform_get_locale_currency();
|
||||
}
|
||||
else if (strcmp(property->property_name, "measurement_format") == 0){
|
||||
destValue->value_uint8 = platform_get_locale_measurement_format();
|
||||
}
|
||||
else if (strcmp(property->property_name, "temperature_format") == 0){
|
||||
destValue->value_uint8 = platform_get_locale_temperature_format();
|
||||
}
|
||||
else {
|
||||
memcpy(destValue, &property->default_value, _configValueTypeSize[property->type]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
12
src/config.h
|
@ -96,6 +96,15 @@ enum{
|
|||
|
||||
};
|
||||
|
||||
enum {
|
||||
AUTOSAVE_EVERY_WEEK,
|
||||
AUTOSAVE_EVERY_2_WEEKS,
|
||||
AUTOSAVE_EVERY_MONTH,
|
||||
AUTOSAVE_EVERY_4_MONTHS,
|
||||
AUTOSAVE_EVERY_YEAR,
|
||||
AUTOSAVE_NEVER
|
||||
};
|
||||
|
||||
typedef struct general_configuration {
|
||||
uint8 play_intro;
|
||||
uint8 confirmation_prompt;
|
||||
|
@ -119,6 +128,7 @@ typedef struct general_configuration {
|
|||
sint32 window_height;
|
||||
uint16 language;
|
||||
uint8 window_snap_proximity;
|
||||
uint8 autosave_frequency;
|
||||
} general_configuration;
|
||||
|
||||
typedef struct sound_configuration {
|
||||
|
@ -141,6 +151,8 @@ void config_set_defaults();
|
|||
bool config_open_default();
|
||||
bool config_save_default();
|
||||
|
||||
uint16 getLanguage();
|
||||
|
||||
void config_reset_shortcut_keys();
|
||||
bool config_find_or_browse_install_directory();
|
||||
|
||||
|
|
|
@ -89,6 +89,8 @@ void editor_load()
|
|||
load_palette();
|
||||
gfx_invalidate_screen();
|
||||
RCT2_GLOBAL(0x009DEA66, sint16) = 0;
|
||||
|
||||
strcpy((char*)RCT2_ADDRESS_SCENARIO_NAME, language_get_string(2749));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
12
src/game.c
|
@ -694,6 +694,8 @@ int game_load_save(const char *path)
|
|||
|
||||
load_palette();
|
||||
gfx_invalidate_screen();
|
||||
|
||||
scenario_set_filename((char*)0x0135936C);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -793,6 +795,16 @@ char save_game()
|
|||
}
|
||||
}
|
||||
|
||||
void game_autosave()
|
||||
{
|
||||
char path[MAX_PATH];
|
||||
|
||||
platform_get_user_directory(path, "save");
|
||||
strcat(path, "autosave.sv6");
|
||||
|
||||
scenario_save(path, 0x80000000);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006E3879
|
||||
|
|
|
@ -73,7 +73,7 @@ enum GAME_COMMAND {
|
|||
GAME_COMMAND_START_MARKETING_CAMPAIGN, // 48
|
||||
GAME_COMMAND_49,
|
||||
GAME_COMMAND_50, // New banner? (possibly scenery)
|
||||
GAME_COMMAND_51,
|
||||
GAME_COMMAND_51, // Remove banner
|
||||
GAME_COMMAND_52,
|
||||
GAME_COMMAND_53,
|
||||
GAME_COMMAND_54,
|
||||
|
@ -109,5 +109,6 @@ int game_load_save(const char *path);
|
|||
void game_pause_toggle(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
|
||||
char save_game();
|
||||
void rct2_exit();
|
||||
void game_autosave();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "../addresses.h"
|
||||
#include "localisation.h"
|
||||
#include "../object.h"
|
||||
|
||||
const char *language_names[LANGUAGE_COUNT] = {
|
||||
"", // LANGUAGE_UNDEFINED
|
||||
|
@ -224,3 +225,64 @@ void language_close()
|
|||
|
||||
gCurrentLanguage = LANGUAGE_UNDEFINED;
|
||||
}
|
||||
|
||||
const int OpenRCT2LangIdToObjectLangId[] = {
|
||||
0, 0, 1, 3, 6, 2, 0, 0, 4, 7
|
||||
};
|
||||
|
||||
//0x006A9E24
|
||||
rct_string_id object_get_localised_text(uint8_t** pStringTable/*ebp*/, int type/*ecx*/, int index/*ebx*/, int tableindex/*edx*/)
|
||||
{
|
||||
char* pString;
|
||||
int result = 0;
|
||||
while (true)
|
||||
{
|
||||
uint8_t language_code = ((uint8_t*)*pStringTable)[0];
|
||||
(*pStringTable)++;
|
||||
if (language_code == 0xFF) //end of string table
|
||||
break;
|
||||
if (language_code == OpenRCT2LangIdToObjectLangId[gCurrentLanguage])//1)
|
||||
{
|
||||
pString = *pStringTable;
|
||||
result |= 1;
|
||||
}
|
||||
if (language_code == 0 && !(result & 1))
|
||||
{
|
||||
pString = *pStringTable;
|
||||
result |= 2;
|
||||
}
|
||||
if (!(result & 7))
|
||||
{
|
||||
pString = *pStringTable;
|
||||
result |= 4;
|
||||
}
|
||||
while (true)
|
||||
{
|
||||
uint8_t character = ((uint8_t*)*pStringTable)[0];
|
||||
(*pStringTable)++;
|
||||
if (character == 0) break;
|
||||
}
|
||||
}
|
||||
if (RCT2_GLOBAL(0x9ADAFC, uint8_t) == 0)
|
||||
{
|
||||
int stringid = 0xD87;
|
||||
int i;
|
||||
for (i = 0; i < type; i++)
|
||||
{
|
||||
int nrobjects = object_entry_group_counts[i];
|
||||
int nrstringtables = RCT2_GLOBAL(0x98DA16 + i * 2, uint16_t);//the number of string tables in a type
|
||||
stringid += nrobjects * nrstringtables;
|
||||
}
|
||||
stringid += index * RCT2_GLOBAL(0x98DA16 + type * 2, uint16_t);
|
||||
RCT2_GLOBAL(0x00F42BBC, uint32) = stringid;
|
||||
stringid += tableindex;
|
||||
RCT2_GLOBAL(0x009BF2D4 + stringid * 4, char*) = pString;//put pointer in stringtable
|
||||
return stringid;
|
||||
}
|
||||
else
|
||||
{
|
||||
int stringid = 0xD77 + tableindex;
|
||||
RCT2_GLOBAL(0x009BF2D4 + stringid * 4, char*) = pString;//put pointer in stringtable
|
||||
return stringid;
|
||||
}
|
||||
}
|
|
@ -44,4 +44,6 @@ const char *language_get_string(rct_string_id id);
|
|||
int language_open(int id);
|
||||
void language_close();
|
||||
|
||||
rct_string_id object_get_localised_text(uint8_t** pStringTable/*ebp*/, int type/*ecx*/, int index/*ebx*/, int tableindex/*edx*/);
|
||||
|
||||
#endif
|
||||
|
|
302
src/object.c
|
@ -8,12 +8,12 @@
|
|||
* 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.
|
||||
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
@ -23,11 +23,12 @@
|
|||
#include "object.h"
|
||||
#include "platform/platform.h"
|
||||
#include "util/sawyercoding.h"
|
||||
#include "drawing/drawing.h"
|
||||
|
||||
int object_load_entry(const char *path, rct_object_entry *outEntry)
|
||||
{
|
||||
FILE *file;
|
||||
|
||||
|
||||
file = fopen(path, "rb");
|
||||
if (file == NULL)
|
||||
return 0;
|
||||
|
@ -70,7 +71,7 @@ int object_load_file(int groupIndex, const rct_object_entry *entry, int* chunkSi
|
|||
// Read chunk size
|
||||
*chunkSize = *((uint32*)installedObject_pointer);
|
||||
char *chunk;
|
||||
|
||||
|
||||
if (*chunkSize == 0xFFFFFFFF) {
|
||||
chunk = rct2_malloc(0x600000);
|
||||
*chunkSize = sawyercoding_read_chunk(file, chunk);
|
||||
|
@ -82,7 +83,7 @@ int object_load_file(int groupIndex, const rct_object_entry *entry, int* chunkSi
|
|||
}
|
||||
fclose(file);
|
||||
|
||||
|
||||
|
||||
|
||||
// Calculate and check checksum
|
||||
if (object_calculate_checksum(&openedEntry, chunk, *chunkSize) != openedEntry.checksum) {
|
||||
|
@ -109,7 +110,7 @@ int object_load_file(int groupIndex, const rct_object_entry *entry, int* chunkSi
|
|||
rct2_free(chunk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
uint8** chunk_list = object_entry_groups[objectType].chunks;
|
||||
if (groupIndex == -1) {
|
||||
for (groupIndex = 0; chunk_list[groupIndex] != (uint8*)-1; groupIndex++) {
|
||||
|
@ -136,7 +137,7 @@ int object_load_file(int groupIndex, const rct_object_entry *entry, int* chunkSi
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* rct2: 0x006A985D
|
||||
*/
|
||||
int object_load(int groupIndex, rct_object_entry *entry, int* chunkSize)
|
||||
|
@ -166,7 +167,7 @@ int object_load(int groupIndex, rct_object_entry *entry, int* chunkSize)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/** rct2: 0x006a9f42
|
||||
/** rct2: 0x006a9f42
|
||||
* ebx : file
|
||||
* ebp : entry
|
||||
*/
|
||||
|
@ -176,7 +177,7 @@ int sub_6A9F42(FILE *file, rct_object_entry* entry){
|
|||
if (eax == 0) return 0;
|
||||
|
||||
object_paint(type, 1, entryGroupIndex, type, edx, chunk, edi, ebp);
|
||||
|
||||
|
||||
|
||||
rct_object_entry_extended* installed_entry = &object_entry_groups[type].entries[entryGroupIndex];
|
||||
uint8* dst_buffer = malloc(0x600000);
|
||||
|
@ -184,7 +185,7 @@ int sub_6A9F42(FILE *file, rct_object_entry* entry){
|
|||
|
||||
uint32 size_dst = sizeof(rct_object_entry);
|
||||
|
||||
sawyercoding_chunk_header chunkHeader;
|
||||
sawyercoding_chunk_header chunkHeader;
|
||||
// Encoding type (not used anymore)
|
||||
RCT2_GLOBAL(0x9E3CBD, uint8) = object_entry_group_encoding[type];
|
||||
|
||||
|
@ -328,7 +329,7 @@ int object_load_packed(FILE *file)
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* rct2: 0x006A9CAF
|
||||
*/
|
||||
void object_unload(int groupIndex, rct_object_entry_extended *entry)
|
||||
|
@ -345,7 +346,8 @@ int object_entry_compare(const rct_object_entry *a, const rct_object_entry *b)
|
|||
return 0;
|
||||
if (*((uint32*)(&a->name[4])) != *((uint32*)(&b->name[4])))
|
||||
return 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (a->flags != b->flags)
|
||||
return 0;
|
||||
if (*((uint32*)a->name) != *((uint32*)b->name))
|
||||
|
@ -380,27 +382,240 @@ int object_calculate_checksum(const rct_object_entry *entry, const char *data, i
|
|||
return checksum;
|
||||
}
|
||||
|
||||
/**
|
||||
* rct2: 0x66B355 part
|
||||
* If al is 0
|
||||
* chunk : esi
|
||||
*/
|
||||
int object_scenario_load_custom_text(char* chunk){
|
||||
int ebp = (int)(&((uint32*)chunk)[2]);
|
||||
int sub_6A9ED1(uint8_t** ebp)
|
||||
{
|
||||
int result;
|
||||
int eax = result = RCT2_GLOBAL(0x9ADAF0, uint32_t);
|
||||
int ecx = ((uint32_t*)(*ebp))[0];
|
||||
int ebx = ecx;
|
||||
ebx += eax;
|
||||
RCT2_GLOBAL(0x9ADAF0, uint32_t) = ebx;
|
||||
ebx = ecx;
|
||||
ebx *= 0x10;
|
||||
(*ebp) += 8;
|
||||
ebx += (uint32_t)(*ebp);
|
||||
int esi = eax;
|
||||
esi *= 0x10;
|
||||
int edx = 0;
|
||||
int eax, ebx, ecx, edi;
|
||||
RCT2_CALLFUNC_X(0x6A9E24, &eax, &ebx, &ecx, &edx, (int*)&chunk, &edi, &ebp);
|
||||
*((uint16*)chunk) = eax;
|
||||
edx++;
|
||||
RCT2_CALLFUNC_X(0x6A9E24, &eax, &ebx, &ecx, &edx, (int*)&chunk, &edi, &ebp);
|
||||
*((uint16*)chunk + 1) = eax;
|
||||
edx++;
|
||||
RCT2_CALLFUNC_X(0x6A9E24, &eax, &ebx, &ecx, &edx, (int*)&chunk, &edi, &ebp);
|
||||
*((uint16*)chunk + 2) = eax;
|
||||
while (true)
|
||||
{
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_G1_ELEMENTS + esi, uint32_t) = ((uint32_t*)(edx + (*ebp)))[0];
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_G1_ELEMENTS + esi + 4, uint32_t) = ((uint32_t*)(edx + (*ebp)))[1];
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_G1_ELEMENTS + esi + 8, uint32_t) = ((uint32_t*)(edx + (*ebp)))[2];
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_G1_ELEMENTS + esi + 0xC, uint32_t) = ((uint32_t*)(edx + (*ebp)))[3];
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_G1_ELEMENTS + esi, uint32_t) += ebx;
|
||||
esi += 0x10;
|
||||
edx += 0x10;
|
||||
ecx--;
|
||||
if (ecx == 0) break;
|
||||
}
|
||||
ebx = ((uint32_t*)((*ebp) - 8))[0];
|
||||
ebx *= 0x10;
|
||||
(*ebp) += ((uint32_t*)((*ebp) - 4))[0];
|
||||
(*ebp) += ebx;
|
||||
return result;
|
||||
}
|
||||
|
||||
if (RCT2_GLOBAL(0x9ADAF4, int) == -1)return 0;
|
||||
else *(RCT2_GLOBAL(0x9ADAF4, uint32*)) = 0;
|
||||
return 1;
|
||||
int paint_path_entry(int flags, int ebx, int ecx, int edx, rct_drawpixelinfo* dpi, int esi, int ebp)
|
||||
{
|
||||
if ((flags & 0xFF) != 3)
|
||||
{
|
||||
if ((flags & 0xFF) != 1)
|
||||
{
|
||||
if ((flags & 0xFF) <= 1)//0
|
||||
{
|
||||
uint8_t* ebp = esi + 0xE;
|
||||
((rct_string_id*)esi)[0] = object_get_localised_text(&ebp, ecx, ebx, 0);
|
||||
int a = sub_6A9ED1(&ebp);
|
||||
((uint32_t*)(esi + 2))[0] = a;
|
||||
a += 0x6D;
|
||||
((uint32_t*)(esi + 6))[0] = a;
|
||||
if (RCT2_GLOBAL(0x9ADAF4, uint32_t) != 0xFFFFFFFF) RCT2_GLOBAL(0x9ADAF4, uint16_t*)[0] = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16) = 0;
|
||||
int b = -1;
|
||||
while (true)
|
||||
{
|
||||
b++;
|
||||
if (b >= 0x10) break;
|
||||
uint8_t* edi = object_entry_groups[5].chunks[ebx];
|
||||
if (edi == 0xFFFFFFFF) continue;
|
||||
if (!(edi[0xB] & 4))
|
||||
{
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16) = ebx;
|
||||
break;
|
||||
}
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16) = ebx;
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((uint8_t*)(esi + 0xA))[0] >= 2) return 1;//actually the carry bit should be set (stc)
|
||||
else return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
((rct_string_id*)esi)[0] = 0;
|
||||
((uint32_t*)(esi + 2))[0] = 0;
|
||||
((uint32_t*)(esi + 6))[0] = 0;
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!((flags >> 8) & 0xFF))
|
||||
{
|
||||
//Draws preview for scenario editor!
|
||||
int b = ((uint32_t*)(ebp + 2))[0];
|
||||
b += 0x47;
|
||||
ecx -= 0x31;
|
||||
edx -= 0x11;
|
||||
gfx_draw_sprite(dpi, b, ecx, edx, ebp);
|
||||
b++;
|
||||
ecx += 0x35;
|
||||
gfx_draw_sprite(dpi, b, ecx, edx, ebp);
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
|
||||
int paint_park_entrance_entry(int flags, int ebx, int ecx, int edx, rct_drawpixelinfo* dpi, int esi, int ebp)
|
||||
{
|
||||
if ((flags & 0xFF) != 3)
|
||||
{
|
||||
if ((flags & 0xFF) != 1)
|
||||
{
|
||||
if ((flags & 0xFF) <= 1)//0
|
||||
{
|
||||
uint8_t* ebp = esi + 8;
|
||||
((rct_string_id*)esi)[0] = object_get_localised_text(&ebp, ecx, ebx, 0);
|
||||
int a = sub_6A9ED1(&ebp);
|
||||
((uint32_t*)(esi + 2))[0] = a;
|
||||
if (RCT2_GLOBAL(0x9ADAF4, uint32_t) != 0xFFFFFFFF) RCT2_GLOBAL(0x9ADAF4, uint16_t*)[0] = 0;
|
||||
return flags;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
((rct_string_id*)esi)[0] = 0;
|
||||
((uint32_t*)(esi + 2))[0] = 0;
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!((flags >> 8) & 0xFF))
|
||||
{
|
||||
dpi = clip_drawpixelinfo(dpi, ecx - 0x38, 0x70, edx - 0x38, 0x70);
|
||||
if (dpi == NULL) return flags;
|
||||
int b = ((uint32_t*)(ebp + 2))[0];
|
||||
gfx_draw_sprite(dpi, b + 1, 0x18, 0x44, ebp);
|
||||
gfx_draw_sprite(dpi, b, 0x38, 0x54, ebp);
|
||||
gfx_draw_sprite(dpi, b + 2, 0x58, 0x64, ebp);
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
|
||||
int paint_water_entry(int flags, int ebx, int ecx, int edx, rct_drawpixelinfo* dpi, int esi, int ebp)
|
||||
{
|
||||
if ((flags & 0xFF) != 3)
|
||||
{
|
||||
if ((flags & 0xFF) != 1)
|
||||
{
|
||||
if ((flags & 0xFF) <= 1)//0
|
||||
{
|
||||
uint8_t* ebp = esi + 0x10;
|
||||
((rct_string_id*)esi)[0] = object_get_localised_text(&ebp, ecx, ebx, 0);
|
||||
int a = sub_6A9ED1(&ebp);
|
||||
((uint32_t*)(esi + 2))[0] = a;
|
||||
a++;
|
||||
((uint32_t*)(esi + 6))[0] = a;
|
||||
a += 3;
|
||||
((uint32_t*)(esi + 0xA))[0] = a;
|
||||
if (RCT2_GLOBAL(0x9ADAF4, uint32_t) != 0xFFFFFFFF) RCT2_GLOBAL(0x9ADAF4, uint16_t*)[0] = 0;
|
||||
if (RCT2_GLOBAL(0x9ADAFD, uint8_t) == 0)
|
||||
{
|
||||
load_palette();
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
((rct_string_id*)esi)[0] = 0;
|
||||
((uint32_t*)(esi + 2))[0] = 0;
|
||||
((uint32_t*)(esi + 6))[0] = 0;
|
||||
((uint32_t*)(esi + 0xA))[0] = 0;
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!((flags >> 8) & 0xFF))
|
||||
{
|
||||
gfx_draw_string_centred(dpi, 3326, ecx, edx, 0, esi);
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
|
||||
//0x0066B355
|
||||
int paint_stex_entry(int flags, int ebx, int ecx, int edx, rct_drawpixelinfo* dpi, int esi, int ebp)
|
||||
{
|
||||
if ((flags & 0xFF) != 3)
|
||||
{
|
||||
if ((flags & 0xFF) != 1)
|
||||
{
|
||||
if ((flags & 0xFF) <= 1)//0
|
||||
{
|
||||
uint8_t* ebp = esi + 8;
|
||||
((rct_string_id*)esi)[0] = object_get_localised_text(&ebp, ecx, ebx, 0);
|
||||
((rct_string_id*)esi)[1] = object_get_localised_text(&ebp, ecx, ebx, 1);
|
||||
((rct_string_id*)esi)[2] = object_get_localised_text(&ebp, ecx, ebx, 2);
|
||||
if (RCT2_GLOBAL(0x9ADAF4, int) != -1) RCT2_GLOBAL(0x9ADAF4, uint16_t*)[0] = 0;
|
||||
return flags;
|
||||
}
|
||||
else//2
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else//1
|
||||
{
|
||||
((rct_string_id*)esi)[0] = 0;
|
||||
((rct_string_id*)esi)[1] = 0;
|
||||
((rct_string_id*)esi)[2] = 0;
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
else//3
|
||||
{
|
||||
if (!((flags >> 8) & 0xFF))
|
||||
{
|
||||
gfx_draw_string_centred(dpi, 0xCFE, ecx, edx, 0, esi);
|
||||
}
|
||||
else
|
||||
{
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, short) = *((uint16_t*)(ebp + 4));
|
||||
int width = *((uint16_t*)(esi + 0x2C));
|
||||
width += *((uint16_t*)(esi + 0x30));
|
||||
width -= 4;
|
||||
width -= ecx;
|
||||
gfx_draw_string_left_wrapped(dpi, RCT2_ADDRESS_COMMON_FORMAT_ARGS, ecx, edx, width, 3168, 0);
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
|
||||
int object_paint(int type, int eax, int ebx, int ecx, int edx, int esi, int edi, int ebp)
|
||||
|
@ -408,11 +623,25 @@ int object_paint(int type, int eax, int ebx, int ecx, int edx, int esi, int edi,
|
|||
//if (type == OBJECT_TYPE_SCENARIO_TEXT){
|
||||
// if (eax == 0) return object_scenario_load_custom_text((char*)esi);
|
||||
//}
|
||||
return RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098D9D4, uint32)[type], eax, ebx, ecx, edx, esi, edi, ebp) & 0x100;
|
||||
//return RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098D9D4, uint32)[type], eax, ebx, ecx, edx, esi, edi, ebp) & 0x100;
|
||||
//just use the rct2 function as long as this is not complete!
|
||||
switch (type)
|
||||
{
|
||||
case OBJECT_TYPE_PATHS:
|
||||
return paint_path_entry(eax, ebx, ecx, edx, edi, esi, ebp);
|
||||
case OBJECT_TYPE_PARK_ENTRANCE:
|
||||
return paint_park_entrance_entry(eax, ebx, ecx, edx, edi, esi, ebp);
|
||||
case OBJECT_TYPE_WATER:
|
||||
return paint_water_entry(eax, ebx, ecx, edx, edi, esi, ebp);
|
||||
case OBJECT_TYPE_SCENARIO_TEXT:
|
||||
return paint_stex_entry(eax, ebx, ecx, edx, edi, esi, ebp);
|
||||
default:
|
||||
return RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098D9D4, uint32)[type], eax, ebx, ecx, edx, esi, edi, ebp) & 0x100;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* rct2: 0x006A9428
|
||||
*/
|
||||
int object_get_scenario_text(rct_object_entry *entry)
|
||||
|
@ -444,8 +673,9 @@ int object_get_scenario_text(rct_object_entry *entry)
|
|||
if (chunkSize == 0xFFFFFFFF) {
|
||||
chunk = malloc(0x600000);
|
||||
chunkSize = sawyercoding_read_chunk(file, chunk);
|
||||
chunk = realloc(chunk, chunkSize);
|
||||
} else {
|
||||
chunk = realloc(chunk, chunkSize);
|
||||
}
|
||||
else {
|
||||
chunk = malloc(chunkSize);
|
||||
sawyercoding_read_chunk(file, chunk);
|
||||
}
|
||||
|
@ -488,7 +718,7 @@ int object_get_scenario_text(rct_object_entry *entry)
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* rct2: 0x006A982D
|
||||
*/
|
||||
void object_free_scenario_text()
|
||||
|
|
|
@ -436,7 +436,7 @@ void peep_update_falling(rct_peep* peep){
|
|||
int height = map_height_from_slope(peep->x, peep->y, map_element->properties.surface.slope)
|
||||
+ map_element->base_height * 8;
|
||||
|
||||
if (height < peep->z - 1 || height - 4 > peep->z) continue;
|
||||
if (height < peep->z - 1 || height > peep->z + 4) continue;
|
||||
|
||||
saved_height = height;
|
||||
saved_map = map_element;
|
||||
|
@ -504,7 +504,7 @@ void peep_update_falling(rct_peep* peep){
|
|||
peep->next_z = saved_map->base_height;
|
||||
|
||||
int edx = saved_map->properties.surface.slope & 0x7;
|
||||
if (saved_map->type != MAP_ELEMENT_TYPE_PATH){
|
||||
if (map_element_get_type(saved_map) != MAP_ELEMENT_TYPE_PATH){
|
||||
edx = 8;
|
||||
}
|
||||
peep->next_var_29 = edx;
|
||||
|
@ -1927,7 +1927,7 @@ static void peep_update(rct_peep *peep)
|
|||
RCT2_CALLPROC_X(0x006C0CB8, 0, 0, 0, 0, (int)peep, 0, 0);
|
||||
break;
|
||||
case PEEP_STATE_FIXING:
|
||||
RCT2_CALLPROC_X(0x006C0E8B, 0, 0, 0, 0, (int)peep, 0, 0);
|
||||
RCT2_CALLPROC_X(0x006C0E8B, stepsToTake, 0, 0, 0, (int)peep, 0, 0);
|
||||
break;
|
||||
case PEEP_STATE_BUYING:
|
||||
peep_update_buying(peep);
|
||||
|
|
|
@ -105,6 +105,10 @@ void platform_get_user_directory(char *outPath, const char *subDirectory);
|
|||
void platform_show_messagebox(char *message);
|
||||
int platform_open_common_file_dialog(int type, char *title, char *filename, char *filterPattern, char *filterName);
|
||||
char *platform_open_directory_browser(char *title);
|
||||
uint8 platform_get_locale_currency();
|
||||
uint16 platform_get_locale_language();
|
||||
uint8 platform_get_locale_measurement_format();
|
||||
uint8 platform_get_locale_temperature_format();
|
||||
|
||||
// Windows specific definitions
|
||||
#ifdef _WIN32
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
#include "../addresses.h"
|
||||
#include "../cmdline.h"
|
||||
#include "../openrct2.h"
|
||||
#include "../localisation/language.h"
|
||||
#include "../localisation/currency.h"
|
||||
#include "../config.h"
|
||||
#include "platform.h"
|
||||
|
||||
// The name of the mutex used to prevent multiple instances of the game from running
|
||||
|
@ -591,4 +594,120 @@ PCHAR *CommandLineToArgvA(PCHAR CmdLine, int *_argc)
|
|||
return argv;
|
||||
}
|
||||
|
||||
#endif
|
||||
uint16 platform_get_locale_language(){
|
||||
CHAR langCode[4];
|
||||
|
||||
if (GetLocaleInfo(LOCALE_USER_DEFAULT,
|
||||
LOCALE_SABBREVLANGNAME,
|
||||
(LPSTR)&langCode,
|
||||
sizeof(langCode)) == 0){
|
||||
return LANGUAGE_UNDEFINED;
|
||||
}
|
||||
|
||||
if (strcmp(langCode, "ENG") == 0){
|
||||
return LANGUAGE_ENGLISH_UK;
|
||||
}
|
||||
else if (strcmp(langCode, "ENU") == 0){
|
||||
return LANGUAGE_ENGLISH_US;
|
||||
}
|
||||
else if (strcmp(langCode, "DEU") == 0){
|
||||
return LANGUAGE_GERMAN;
|
||||
}
|
||||
else if (strcmp(langCode, "NLD") == 0){
|
||||
return LANGUAGE_DUTCH;
|
||||
}
|
||||
else if (strcmp(langCode, "FRA") == 0){
|
||||
return LANGUAGE_FRENCH;
|
||||
}
|
||||
else if (strcmp(langCode, "HUN") == 0){
|
||||
return LANGUAGE_HUNGARIAN;
|
||||
}
|
||||
else if (strcmp(langCode, "PLK") == 0){
|
||||
return LANGUAGE_POLISH;
|
||||
}
|
||||
else if (strcmp(langCode, "ESP") == 0){
|
||||
return LANGUAGE_SPANISH;
|
||||
}
|
||||
else if (strcmp(langCode, "SVE") == 0){
|
||||
return LANGUAGE_SWEDISH;
|
||||
}
|
||||
return LANGUAGE_UNDEFINED;
|
||||
}
|
||||
|
||||
uint8 platform_get_locale_currency(){
|
||||
CHAR currCode[4];
|
||||
|
||||
if (GetLocaleInfo(LOCALE_USER_DEFAULT,
|
||||
LOCALE_SINTLSYMBOL,
|
||||
(LPSTR)&currCode,
|
||||
sizeof(currCode)) == 0){
|
||||
return CURRENCY_POUNDS;
|
||||
}
|
||||
if (strcmp(currCode, "GBP") == 0){
|
||||
return CURRENCY_POUNDS;
|
||||
}
|
||||
else if (strcmp(currCode, "USD") == 0){
|
||||
return CURRENCY_DOLLARS;
|
||||
}
|
||||
else if (strcmp(currCode, "EUR") == 0){
|
||||
return CURRENCY_EUROS;
|
||||
}
|
||||
else if (strcmp(currCode, "SEK") == 0){
|
||||
return CURRENCY_KRONA;
|
||||
}
|
||||
else if (strcmp(currCode, "DEM") == 0){
|
||||
return CURRENCY_DEUTSCHMARK;
|
||||
}
|
||||
else if (strcmp(currCode, "ITL") == 0){
|
||||
return CURRENCY_LIRA;
|
||||
}
|
||||
else if (strcmp(currCode, "JPY") == 0){
|
||||
return CURRENCY_YEN;
|
||||
}
|
||||
else if (strcmp(currCode, "ESP") == 0){
|
||||
return CURRENCY_PESETA;
|
||||
}
|
||||
else if (strcmp(currCode, "FRF") == 0){
|
||||
return CURRENCY_FRANC;
|
||||
}
|
||||
else if (strcmp(currCode, "NLG") == 0){
|
||||
return CURRENCY_GUILDERS;
|
||||
}
|
||||
return CURRENCY_POUNDS;
|
||||
}
|
||||
|
||||
uint8 platform_get_locale_measurement_format(){
|
||||
UINT measurement_system;
|
||||
if (GetLocaleInfo(LOCALE_USER_DEFAULT,
|
||||
LOCALE_IMEASURE | LOCALE_RETURN_NUMBER,
|
||||
(LPSTR)&measurement_system,
|
||||
sizeof(measurement_system)) == 0){
|
||||
return MEASUREMENT_FORMAT_IMPERIAL;
|
||||
}
|
||||
switch (measurement_system){
|
||||
case 0:
|
||||
return MEASUREMENT_FORMAT_METRIC;
|
||||
case 1:
|
||||
default:
|
||||
return MEASUREMENT_FORMAT_IMPERIAL;
|
||||
}
|
||||
}
|
||||
|
||||
uint8 platform_get_locale_temperature_format(){
|
||||
// There does not seem to be a function to obtain this, just check the countries
|
||||
UINT country;
|
||||
if (GetLocaleInfo(LOCALE_USER_DEFAULT,
|
||||
LOCALE_IMEASURE | LOCALE_RETURN_NUMBER,
|
||||
(LPSTR)&country,
|
||||
sizeof(country)) == 0){
|
||||
return TEMPERATURE_FORMAT_C;
|
||||
}
|
||||
switch (country){
|
||||
case CTRY_UNITED_STATES:
|
||||
case CTRY_BELIZE:
|
||||
return TEMPERATURE_FORMAT_F;
|
||||
default:
|
||||
return TEMPERATURE_FORMAT_C;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -569,15 +569,18 @@ void ride_construct_new(ride_list_item listItem)
|
|||
*/
|
||||
void ride_construct(int rideIndex)
|
||||
{
|
||||
rct_xy_element trackElement;
|
||||
rct_window *w;
|
||||
|
||||
// Open construction window
|
||||
// HACK In the original game this created a mouse up event. This has been
|
||||
// replaced with a direct call to the function that gets called.
|
||||
// Eventually should be changed so the ride window does not need to be opened.
|
||||
w = window_ride_main_open(rideIndex);
|
||||
window_ride_construct(w);
|
||||
window_close_by_number(WC_RIDE, rideIndex);
|
||||
if (sub_6CAF80(rideIndex, &trackElement)) {
|
||||
ride_find_track_gap(&trackElement, &trackElement);
|
||||
|
||||
w = window_get_main();
|
||||
if (w != NULL && ride_modify(&trackElement))
|
||||
window_scroll_to_location(w, trackElement.x, trackElement.y, trackElement.element->base_height * 8);
|
||||
} else {
|
||||
sub_6CC3FB(rideIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1319,6 +1322,7 @@ static void ride_breakdown_update(int rideIndex)
|
|||
ride->var_19C +
|
||||
ride->var_19D +
|
||||
ride->var_19E +
|
||||
ride->var_19F +
|
||||
ride->var_1A0 +
|
||||
ride->var_1A2 +
|
||||
ride->var_1A3;
|
||||
|
@ -1355,11 +1359,12 @@ static void ride_breakdown_update(int rideIndex)
|
|||
agePenalty = ax >> 2;
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
agePenalty = ax >> 1;
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
agePenalty = ax >> 0;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -742,8 +742,8 @@ void load_track_scenery_objects(){
|
|||
* the track preview window to place the whole track.
|
||||
* Depending on the value of bl it modifies the function.
|
||||
* bl == 0, Draw outlines on the ground
|
||||
* bl == 3, Returns the z value of a succesful placement
|
||||
* bl == 5, Returns cost to create the track. Places the track. (used by the preview)
|
||||
* bl == 3, Returns the z value of a succesful placement. Only lower 16 bits are the value, the rest may be garbage?
|
||||
* bl == 5, Returns cost to create the track. All 32 bits are used. Places the track. (used by the preview)
|
||||
* bl == 6, Clear white outlined track.
|
||||
* rct2: 0x006D01B3
|
||||
*/
|
||||
|
@ -758,7 +758,9 @@ int sub_6D01B3(int bl, int x, int y, int z)
|
|||
edi = 0;
|
||||
ebp = 0;
|
||||
RCT2_CALLFUNC_X(0x006D01B3, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||
return *((short*)&ebx);
|
||||
if (bl == 3)
|
||||
ebx &= 0xFFFF;
|
||||
return ebx;
|
||||
}
|
||||
|
||||
/* rct2: 0x006D2189
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "config.h"
|
||||
#include "game.h"
|
||||
#include "interface/viewport.h"
|
||||
#include "localisation/date.h"
|
||||
|
@ -170,7 +171,7 @@ int scenario_load(const char *path)
|
|||
// Check expansion pack
|
||||
// RCT2_CALLPROC_EBPSAFE(0x006757E6);
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x006A9FC0);
|
||||
sub_6A9FC0();
|
||||
map_update_tile_pointers();
|
||||
reset_0x69EBE4();// RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
return 1;
|
||||
|
@ -357,6 +358,12 @@ void scenario_end()
|
|||
window_park_objective_open();
|
||||
}
|
||||
|
||||
void scenario_set_filename(const char *value)
|
||||
{
|
||||
subsitute_path(_scenarioPath, RCT2_ADDRESS(RCT2_ADDRESS_SCENARIOS_PATH, char), value);
|
||||
_scenarioFileName = path_get_filename(_scenarioPath);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0066A752
|
||||
|
@ -616,6 +623,36 @@ void scenario_entrance_fee_too_high_check()
|
|||
}
|
||||
}
|
||||
|
||||
static void scenario_autosave_check()
|
||||
{
|
||||
uint32 next_month_tick = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16) + 4;
|
||||
uint16 month = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16);
|
||||
bool shouldSave = 0;
|
||||
|
||||
switch (gConfigGeneral.autosave_frequency) {
|
||||
case AUTOSAVE_EVERY_WEEK:
|
||||
shouldSave = (next_month_tick % 0x4000 == 0);
|
||||
break;
|
||||
case AUTOSAVE_EVERY_2_WEEKS:
|
||||
shouldSave = (next_month_tick % 0x8000 == 0);
|
||||
break;
|
||||
case AUTOSAVE_EVERY_MONTH:
|
||||
shouldSave = (next_month_tick >= 0x10000);
|
||||
break;
|
||||
case AUTOSAVE_EVERY_4_MONTHS:
|
||||
if (next_month_tick >= 0x10000)
|
||||
shouldSave = (((month + 1) & 3) == 0);
|
||||
break;
|
||||
case AUTOSAVE_EVERY_YEAR:
|
||||
if (next_month_tick >= 0x10000)
|
||||
shouldSave = (((month + 1) & 7) == 0);
|
||||
break;
|
||||
}
|
||||
|
||||
if (shouldSave)
|
||||
game_autosave();
|
||||
}
|
||||
|
||||
/*
|
||||
* Scenario and finance related update iteration.
|
||||
* rct2: 0x006C44B1
|
||||
|
@ -632,6 +669,8 @@ void scenario_update()
|
|||
if (screen_flags & (~SCREEN_FLAGS_PLAYING)) // only in normal play mode
|
||||
return;
|
||||
|
||||
scenario_autosave_check();
|
||||
|
||||
if ((current_days_in_month * next_month_tick) >> 16 != (current_days_in_month * month_tick) >> 16) {
|
||||
// daily checks
|
||||
finance_update_daily_profit();
|
||||
|
|
|
@ -407,6 +407,7 @@ void scenario_update();
|
|||
unsigned int scenario_rand();
|
||||
int scenario_prepare_for_save();
|
||||
int scenario_save(char *path, int flags);
|
||||
void scenario_set_filename(const char *value);
|
||||
void scenario_failure();
|
||||
void scenario_success();
|
||||
void scenario_success_submit_name(const char *name);
|
||||
|
|
|
@ -266,6 +266,7 @@ static void DrawOpenRCT2(int x, int y)
|
|||
void game_handle_input();
|
||||
void title_update()
|
||||
{
|
||||
|
||||
screenshot_check();
|
||||
title_handle_keyboard_input();
|
||||
|
||||
|
|
|
@ -571,25 +571,12 @@ static void window_cheats_paint()
|
|||
window_cheats_draw_tab_images(dpi, w);
|
||||
|
||||
if (w->page == WINDOW_CHEATS_PAGE_MONEY){
|
||||
char buffer[256];
|
||||
// Format text
|
||||
sprintf(buffer, "%c%c%s", FORMAT_MEDIUMFONT, FORMAT_BLACK, "Increases your money by 5,000.");
|
||||
// Draw shadow
|
||||
gfx_draw_string(dpi, buffer, 0, w->x + XPL(0) + TXTO, w->y + YPL(0) + TXTO);
|
||||
|
||||
sprintf(buffer, "%c%c%s", FORMAT_MEDIUMFONT, FORMAT_BLACK, "Toggle between Free and Paid Entry");
|
||||
// Draw shadow
|
||||
gfx_draw_string(dpi, buffer, 0, w->x + XPL(0) + TXTO, w->y + YPL(2) + TXTO);
|
||||
gfx_draw_string(dpi, language_get_string(2681), 0, w->x + XPL(0) + TXTO, w->y + YPL(0) + TXTO);
|
||||
gfx_draw_string(dpi, language_get_string(2682), 0, w->x + XPL(0) + TXTO, w->y + YPL(2) + TXTO);
|
||||
}
|
||||
else if (w->page == WINDOW_CHEATS_PAGE_GUESTS){
|
||||
char buffer[256];
|
||||
// Format text
|
||||
sprintf(buffer, "%c%c%s", FORMAT_MEDIUMFONT, FORMAT_BLACK, "Increases every peeps happiness to max.");
|
||||
// Draw shadow
|
||||
gfx_draw_string(dpi, buffer, 0, w->x + XPL(0) + TXTO, w->y + YPL(0) + TXTO);
|
||||
|
||||
sprintf(buffer, "%c%c%s", FORMAT_MEDIUMFONT, FORMAT_BLACK, "Large group of peeps arrive");
|
||||
gfx_draw_string(dpi, buffer, 0, w->x + XPL(0) + TXTO, w->y + YPL(2) + TXTO);
|
||||
gfx_draw_string(dpi, language_get_string(2683), 0, w->x + XPL(0) + TXTO, w->y + YPL(0) + TXTO);
|
||||
gfx_draw_string(dpi, language_get_string(2684), 0, w->x + XPL(0) + TXTO, w->y + YPL(2) + TXTO);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -610,13 +610,16 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rc
|
|||
break;
|
||||
case NEWS_ITEM_MONEY:
|
||||
gfx_draw_sprite(dpi, SPR_FINANCE, x, y, 0);
|
||||
break;
|
||||
case NEWS_ITEM_RESEARCH:
|
||||
gfx_draw_sprite(dpi, (newsItem->assoc < 0x10000 ? SPR_NEW_RIDE : SPR_SCENERY), x, y, 0);
|
||||
break;
|
||||
case NEWS_ITEM_PEEPS:
|
||||
gfx_draw_sprite(dpi, SPR_GUESTS, x, y, 0);
|
||||
break;
|
||||
case NEWS_ITEM_AWARD:
|
||||
gfx_draw_sprite(dpi, SPR_AWARD, x, y, 0);
|
||||
break;
|
||||
case NEWS_ITEM_GRAPH:
|
||||
gfx_draw_sprite(dpi, SPR_GRAPH, x, y, 0);
|
||||
break;
|
||||
|
|
|
@ -200,7 +200,7 @@ static void window_map_close()
|
|||
rct2_free(RCT2_GLOBAL(RCT2_ADDRESS_MAP_IMAGE_DATA, uint32*));
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) & INPUT_FLAG_TOOL_ACTIVE) &&
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, uint8) == w->classification &&
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WIDGETINDEX, uint16) == w->number) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWNUMBER, uint16) == w->number) {
|
||||
tool_cancel();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ static rct_widget window_mapgen_simplex_widgets[] = {
|
|||
|
||||
{ WWT_DROPDOWN_BUTTON, 1, 104, 198, 52, 63, 2694, STR_NONE },
|
||||
|
||||
{ WWT_12, 1, 4, 141, 52, 63, 2700, STR_NONE },
|
||||
{ WWT_12, 1, 4, 141, 52, 63, 2685, STR_NONE },
|
||||
|
||||
{ WWT_SPINNER, 1, 104, 198, 70, 81, STR_NONE, STR_NONE },
|
||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 71, 75, STR_NUMERIC_UP, STR_NONE },
|
||||
|
@ -946,10 +946,10 @@ static void window_mapgen_simplex_paint()
|
|||
window_draw_widgets(w, dpi);
|
||||
window_mapgen_draw_tab_images(dpi, w);
|
||||
|
||||
gfx_draw_string_left(dpi, 2701, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_LOW].top + 1);
|
||||
gfx_draw_string_left(dpi, 2702, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_HIGH].top + 1);
|
||||
gfx_draw_string_left(dpi, 2703, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1);
|
||||
gfx_draw_string_left(dpi, 2704, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1);
|
||||
gfx_draw_string_left(dpi, 2686, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_LOW].top + 1);
|
||||
gfx_draw_string_left(dpi, 2687, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_HIGH].top + 1);
|
||||
gfx_draw_string_left(dpi, 2688, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1);
|
||||
gfx_draw_string_left(dpi, 2689, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1);
|
||||
gfx_draw_string_left(dpi, STR_MAP_SIZE, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_MAP_SIZE].top + 1);
|
||||
gfx_draw_string_left(dpi, 2692, 0, 0, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1);
|
||||
|
||||
|
|
|
@ -129,8 +129,6 @@ int ride_name_compare(const void *a, const void *b)
|
|||
*/
|
||||
void window_new_campaign_open(sint16 campaignType)
|
||||
{
|
||||
// RCT2_CALLPROC_X(0x0069E16F, campaignType, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
rct_window *w;
|
||||
rct_ride *ride;
|
||||
int i, numApplicableRides;
|
||||
|
@ -178,7 +176,6 @@ void window_new_campaign_open(sint16 campaignType)
|
|||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8), uint32) & 0x03820000))
|
||||
window_new_campaign_rides[numApplicableRides++] = i;
|
||||
}
|
||||
window_new_campaign_rides[numApplicableRides] = 255;
|
||||
|
||||
// Take top 40 most reliable rides
|
||||
if (numApplicableRides > 40) {
|
||||
|
@ -188,6 +185,8 @@ void window_new_campaign_open(sint16 campaignType)
|
|||
|
||||
// Sort rides by name
|
||||
qsort(window_new_campaign_rides, numApplicableRides, sizeof(uint8), ride_name_compare);
|
||||
|
||||
window_new_campaign_rides[numApplicableRides] = 255;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -280,28 +279,26 @@ static void window_new_campaign_mousedown(int widgetIndex, rct_window *w, rct_wi
|
|||
);
|
||||
}
|
||||
} else {
|
||||
if (window_new_campaign_rides[0] != 255) {
|
||||
int numItems = 0;
|
||||
for (int i = 0; i < 40; i++) {
|
||||
if (window_new_campaign_rides[i] == 255)
|
||||
break;
|
||||
int numItems = 0;
|
||||
for (int i = 0; i < 40; i++) {
|
||||
if (window_new_campaign_rides[i] == 255)
|
||||
break;
|
||||
|
||||
rct_ride *ride = GET_RIDE(window_new_campaign_rides[i]);
|
||||
gDropdownItemsFormat[i] = 1142;
|
||||
gDropdownItemsArgs[i] = (ride->name_arguments << 16) | ride->name;
|
||||
numItems++;
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0x80,
|
||||
numItems,
|
||||
dropdownWidget->right - dropdownWidget->left - 3
|
||||
);
|
||||
rct_ride *ride = GET_RIDE(window_new_campaign_rides[i]);
|
||||
gDropdownItemsFormat[i] = 1142;
|
||||
gDropdownItemsArgs[i] = ((uint64)ride->name_arguments << 16ULL) | ride->name;
|
||||
numItems++;
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0x80,
|
||||
numItems,
|
||||
dropdownWidget->right - dropdownWidget->left - 3
|
||||
);
|
||||
}
|
||||
break;
|
||||
case WIDX_WEEKS_INCREASE_BUTTON:
|
||||
|
|
|
@ -96,6 +96,8 @@ enum WINDOW_OPTIONS_WIDGET_IDX {
|
|||
|
||||
WIDX_REAL_NAME_CHECKBOX,
|
||||
WIDX_SAVE_PLUGIN_DATA_CHECKBOX,
|
||||
WIDX_AUTOSAVE,
|
||||
WIDX_AUTOSAVE_DROPDOWN
|
||||
};
|
||||
|
||||
#define WW 310
|
||||
|
@ -153,6 +155,8 @@ static rct_widget window_options_widgets[] = {
|
|||
// Misc
|
||||
{ WWT_CHECKBOX, 2, 10, 299, 53, 64, STR_REAL_NAME, STR_REAL_NAME_TIP },
|
||||
{ WWT_CHECKBOX, 2, 10, 299, 68, 79, STR_SAVE_PLUGIN_DATA, STR_SAVE_PLUGIN_DATA_TIP },
|
||||
{ WWT_DROPDOWN, 0, 155, 299, 83, 94, STR_NONE, STR_NONE },
|
||||
{ WWT_DROPDOWN_BUTTON, 0, 288, 298, 84, 93, 876, STR_NONE },
|
||||
{ WIDGETS_END },
|
||||
};
|
||||
|
||||
|
@ -258,7 +262,9 @@ void window_options_open()
|
|||
(1ULL << WIDX_GRIDLINES_CHECKBOX) |
|
||||
(1ULL << WIDX_SOUND_SW_BUFFER_CHECKBOX) |
|
||||
(1ULL << WIDX_SOUND_PAUSED_CHECKBOX) |
|
||||
(1ULL << WIDX_SAVE_PLUGIN_DATA_CHECKBOX); // doesn't seem to work?
|
||||
(1ULL << WIDX_SAVE_PLUGIN_DATA_CHECKBOX) |
|
||||
(1ULL << WIDX_AUTOSAVE) |
|
||||
(1ULL << WIDX_AUTOSAVE_DROPDOWN);
|
||||
|
||||
w->page = WINDOW_OPTIONS_PAGE_DISPLAY;
|
||||
window_init_scroll_widgets(w);
|
||||
|
@ -351,6 +357,8 @@ static void window_options_mousedown(int widgetIndex, rct_window*w, rct_widget*
|
|||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_SOUND_DROPDOWN:
|
||||
audio_get_devices();
|
||||
|
||||
// populate the list with the sound devices
|
||||
for (i = 0; i < gAudioDeviceCount; i++) {
|
||||
gDropdownItemsFormat[i] = 1142;
|
||||
|
@ -493,6 +501,14 @@ static void window_options_mousedown(int widgetIndex, rct_window*w, rct_widget*
|
|||
window_options_show_dropdown(w, widget, LANGUAGE_COUNT - 1);
|
||||
gDropdownItemsChecked = 1 << (gCurrentLanguage - 1);
|
||||
break;
|
||||
case WIDX_AUTOSAVE_DROPDOWN:
|
||||
for (i = AUTOSAVE_EVERY_WEEK; i <= AUTOSAVE_NEVER; i++) {
|
||||
gDropdownItemsFormat[i] = 1142;
|
||||
gDropdownItemsArgs[i] = 2701 + i;
|
||||
}
|
||||
window_options_show_dropdown(w, widget, AUTOSAVE_NEVER + 1);
|
||||
gDropdownItemsChecked = 1 << gConfigGeneral.autosave_frequency;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -627,6 +643,13 @@ static void window_options_dropdown()
|
|||
gfx_invalidate_screen();
|
||||
}
|
||||
break;
|
||||
case WIDX_AUTOSAVE_DROPDOWN:
|
||||
if (dropdownIndex != gConfigGeneral.autosave_frequency) {
|
||||
gConfigGeneral.autosave_frequency = (uint8)dropdownIndex;
|
||||
config_save_default();
|
||||
window_invalidate(w);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -643,7 +666,7 @@ static void window_options_invalidate()
|
|||
window_get_register(w);
|
||||
|
||||
window_options_set_pressed_tab(w);
|
||||
for (i = WIDX_RESOLUTION; i <= WIDX_SAVE_PLUGIN_DATA_CHECKBOX; i++) {
|
||||
for (i = WIDX_RESOLUTION; i <= WIDX_AUTOSAVE_DROPDOWN; i++) {
|
||||
window_options_widgets[i].type = WWT_EMPTY;
|
||||
}
|
||||
|
||||
|
@ -787,6 +810,8 @@ static void window_options_invalidate()
|
|||
|
||||
window_options_widgets[WIDX_REAL_NAME_CHECKBOX].type = WWT_CHECKBOX;
|
||||
window_options_widgets[WIDX_SAVE_PLUGIN_DATA_CHECKBOX].type = WWT_CHECKBOX;
|
||||
window_options_widgets[WIDX_AUTOSAVE].type = WWT_DROPDOWN;
|
||||
window_options_widgets[WIDX_AUTOSAVE_DROPDOWN].type = WWT_DROPDOWN_BUTTON;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -850,6 +875,17 @@ static void window_options_paint()
|
|||
w->y + window_options_widgets[WIDX_TITLE_MUSIC].top
|
||||
);
|
||||
break;
|
||||
case WINDOW_OPTIONS_PAGE_MISC:
|
||||
gfx_draw_string_left(dpi, 2700, w, 12, w->x + 10, w->y + window_options_widgets[WIDX_AUTOSAVE].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
2701 + gConfigGeneral.autosave_frequency,
|
||||
NULL,
|
||||
12,
|
||||
w->x + window_options_widgets[WIDX_AUTOSAVE].left + 1,
|
||||
w->y + window_options_widgets[WIDX_AUTOSAVE].top
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1530,23 +1530,8 @@ static void window_ride_init_viewport(rct_window *w)
|
|||
*/
|
||||
void window_ride_construct(rct_window *w)
|
||||
{
|
||||
int rideIndex = w->number;
|
||||
rct_xy_element trackElement;
|
||||
|
||||
window_close_by_class(WC_RIDE_CONSTRUCTION);
|
||||
w = window_find_by_number(WC_RIDE, rideIndex);
|
||||
if (w == NULL)
|
||||
return;
|
||||
|
||||
if (sub_6CAF80(rideIndex, &trackElement)) {
|
||||
ride_find_track_gap(&trackElement, &trackElement);
|
||||
|
||||
w = window_get_main();
|
||||
if (w != NULL && ride_modify(&trackElement))
|
||||
window_scroll_to_location(w, trackElement.x, trackElement.y, trackElement.element->base_height * 8);
|
||||
} else {
|
||||
sub_6CC3FB(rideIndex);
|
||||
}
|
||||
ride_construct(w->number);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1099,7 +1099,7 @@ void window_scenery_scrollpaint()
|
|||
gfx_draw_sprite(clipdpi, imageId, 0x2F, (sceneryEntry->wall.height * 2) + 0x32,
|
||||
tertiaryColour);
|
||||
|
||||
imageId = (sceneryEntry->image + 0x40000006) | (window_scenery_primary_colour << 19);
|
||||
imageId = (sceneryEntry->image + 0x40000006) | ((window_scenery_primary_colour + 0x70) << 19);
|
||||
gfx_draw_sprite(clipdpi, imageId, 0x2F, (sceneryEntry->wall.height * 2) + 0x32,
|
||||
tertiaryColour);
|
||||
}
|
||||
|
|
|
@ -337,6 +337,17 @@ static money32 footpath_place_real(int type, int x, int y, int z, int slope, int
|
|||
footpath_element_update(x, y, mapElement, type, flags);
|
||||
}
|
||||
|
||||
/* rct2: 0x006BA23E */
|
||||
void remove_banners_at_element(int x, int y, rct_map_element* mapElement){
|
||||
while (!map_element_is_last_for_tile(mapElement++)){
|
||||
if (map_element_get_type(mapElement) == MAP_ELEMENT_TYPE_PATH)return;
|
||||
else if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_BANNER)continue;
|
||||
|
||||
game_do_command(x, 1, y, mapElement->base_height | mapElement->properties.banner.position << 8, GAME_COMMAND_51, 0, 0);
|
||||
mapElement--;
|
||||
}
|
||||
}
|
||||
|
||||
money32 footpath_remove_real(int x, int y, int z, int flags)
|
||||
{
|
||||
rct_map_element *mapElement;
|
||||
|
@ -362,7 +373,7 @@ money32 footpath_remove_real(int x, int y, int z, int flags)
|
|||
mapElement = map_get_footpath_element(x / 32, y / 32, z);
|
||||
if (mapElement != NULL && (flags & GAME_COMMAND_FLAG_APPLY)) {
|
||||
RCT2_GLOBAL(0x00F3EFF4, uint32) = 0x00F3EFF8;
|
||||
RCT2_CALLPROC_X(0x006BA23E, 0, 0, 0, 0, (int)mapElement, 0, 0);
|
||||
remove_banners_at_element(x, y, mapElement);
|
||||
sub_6A6AA7(x, y, mapElement);
|
||||
map_invalidate_tile_full(x, y);
|
||||
map_element_remove(mapElement);
|
||||
|
|
|
@ -56,11 +56,46 @@ int map_smooth(int l, int t, int r, int b)
|
|||
|
||||
if (highest >= mapElement->base_height + 4) {
|
||||
count = 0;
|
||||
int canCompensate = 1;
|
||||
for (i = 0; i < 4; i++)
|
||||
if (cornerHeights[i] == highest)
|
||||
if (cornerHeights[i] == highest){
|
||||
count++;
|
||||
|
||||
if (count == 1) {
|
||||
// Check if surrounding corners aren't too high. The current tile
|
||||
// can't compensate for all the height differences anymore if it has
|
||||
// the extra height slope.
|
||||
int highestOnLowestSide;
|
||||
switch (i){
|
||||
case 0:
|
||||
highestOnLowestSide = max(
|
||||
map_get_surface_element_at(x + 1, y)->base_height,
|
||||
map_get_surface_element_at(x, y + 1)->base_height);
|
||||
break;
|
||||
case 1:
|
||||
highestOnLowestSide = max(
|
||||
map_get_surface_element_at(x - 1, y)->base_height,
|
||||
map_get_surface_element_at(x, y + 1)->base_height);
|
||||
break;
|
||||
case 2:
|
||||
highestOnLowestSide = max(
|
||||
map_get_surface_element_at(x - 1, y)->base_height,
|
||||
map_get_surface_element_at(x, y - 1)->base_height);
|
||||
break;
|
||||
case 3:
|
||||
highestOnLowestSide = max(
|
||||
map_get_surface_element_at(x + 1, y)->base_height,
|
||||
map_get_surface_element_at(x, y - 1)->base_height);
|
||||
break;
|
||||
}
|
||||
|
||||
if (highestOnLowestSide > mapElement->base_height){
|
||||
mapElement->base_height = mapElement->clearance_height = highestOnLowestSide;
|
||||
raisedLand = 1;
|
||||
canCompensate = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 1 && canCompensate) {
|
||||
if (mapElement->base_height < highest - 4) {
|
||||
mapElement->base_height = mapElement->clearance_height = highest - 4;
|
||||
raisedLand = 1;
|
||||
|
|
|
@ -190,7 +190,7 @@ void mapgen_generate(mapgen_settings *settings)
|
|||
mapgen_set_height();
|
||||
free(_height);
|
||||
|
||||
// Set the tile slopes so that their are no cliffs
|
||||
// Set the tile slopes so that there are no cliffs
|
||||
while (map_smooth(1, 1, mapSize - 1, mapSize - 1)) { }
|
||||
|
||||
// Add the water
|
||||
|
|