mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-17 20:13:07 +01:00
Merge branch 'testing' of https://github.com/anyc/OpenRCT2 into anyc-testing
This commit is contained in:
12
readme.md
12
readme.md
@@ -50,12 +50,20 @@ The aim is to completely decompile RollerCoaster Tycoon 2 into C so that cross-p
|
||||
# 2 Building the source code
|
||||
|
||||
## 2.1 Prerequisites
|
||||
### Windows:
|
||||
- Windows XP / Vista / 7 / 8
|
||||
- RollerCoaster Tycoon 2
|
||||
- Visual Studio 2013 (paid) / [Visual Studio Express 2013](http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-desktop) (free)
|
||||
- [SDL2 development library for Visual C++](http://www.libsdl.org/release/SDL2-devel-2.0.3-VC.zip).
|
||||
|
||||
### Linux:
|
||||
- [MinGW-w64](mingw-w64.sourceforge.net)
|
||||
- [Wine](http://www.winehq.org/)
|
||||
- RollerCoaster Tycoon 2
|
||||
- libsdl2 compiled with MinGW-w64
|
||||
|
||||
## 2.2 Compiling and running
|
||||
### Windows:
|
||||
1. Check out the repository. This can be done using [GitHub Windows](https://windows.github.com/) or [other tools](https://help.github.com/articles/which-remote-url-should-i-use).
|
||||
2. Download the [SDL2 development library for Visual C++]((http://www.libsdl.org/release/SDL2-devel-2.0.3-VC.zip)) and copy it to a new directory called "sdl" in the repository. This directory should contain "include". The path should resemble ```\OpenRCT2\sdl\include\```.
|
||||
3. Open the solution in the projects directory (**openrct2.vcxproj**) with Visual C++.
|
||||
@@ -64,6 +72,10 @@ The aim is to completely decompile RollerCoaster Tycoon 2 into C so that cross-p
|
||||
6. When OpenRCT2 is run for the first time, it creates a settings file in `My Documents/OpenRCT2`. If it can't find the original installation of RCT2, you will need to edit `config.ini` in that folder and change the value of `game_path` to where RCT2 is installed.
|
||||
7. If the game crashes, you may need to press the red, square Stop button along the top of VS Express to stop the program.
|
||||
|
||||
### Linux:
|
||||
As the easiest approach depends on your distribution, please take a look at the [wiki](https://github.com/IntelOrca/OpenRCT2/wiki).
|
||||
|
||||
|
||||
# 3 Contributing
|
||||
|
||||
## 3.1 Decompiling
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
|
||||
#define RCT2_ADDRESS_RIDE_PROPERTIES 0x00997C9D
|
||||
#define RCT2_ADDRESS_LAND_TOOL_SIZE 0x009A9800
|
||||
#define RCT2_ADDRESS_SAVE_PROMPT_MODE 0x009A9802
|
||||
|
||||
#define RCT2_ADDRESS_SCENARIO_LIST 0x009A9FF4
|
||||
#define RCT2_ADDRESS_NUM_SCENARIOS 0x009AA008
|
||||
|
||||
@@ -1362,13 +1362,12 @@ static void game_load_or_quit()
|
||||
__asm__ ( "mov %[input_di], di " : [input_di] "+m" (input_di) );
|
||||
#endif
|
||||
|
||||
|
||||
if (!(input_bl & 1))
|
||||
return; // 0;
|
||||
|
||||
|
||||
switch (input_dl) {
|
||||
case 0:
|
||||
RCT2_GLOBAL(0x009A9802, uint16) = input_di;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SAVE_PROMPT_MODE, uint16) = input_di;
|
||||
window_save_prompt_open();
|
||||
break;
|
||||
case 1:
|
||||
@@ -1604,14 +1603,14 @@ static void rct2_exit()
|
||||
*/
|
||||
void game_load_or_quit_no_save_prompt()
|
||||
{
|
||||
if (RCT2_GLOBAL(0x009A9802, uint16) < 1) {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_SAVE_PROMPT_MODE, uint16) < 1) {
|
||||
game_do_command(0, 1, 0, 1, 5, 0, 0);
|
||||
tool_cancel();
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2)
|
||||
load_landscape();
|
||||
else
|
||||
load_game();
|
||||
} else if (RCT2_GLOBAL(0x009A9802, uint16) == 1) {
|
||||
} else if (RCT2_GLOBAL(RCT2_ADDRESS_SAVE_PROMPT_MODE, uint16) == 1) {
|
||||
game_do_command(0, 1, 0, 1, 5, 0, 0);
|
||||
if (RCT2_GLOBAL(0x009DE518, uint32) & (1 << 5)) {
|
||||
RCT2_CALLPROC_EBPSAFE(0x0040705E);
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <setjmp.h>
|
||||
#ifdef _MSC_VER
|
||||
#include <time.h>
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <shlobj.h>
|
||||
#include <SDL.h>
|
||||
|
||||
@@ -36,7 +36,7 @@ typedef enum {
|
||||
WWT_FLATBTN = 9,
|
||||
WWT_DROPDOWN_BUTTON = 10,
|
||||
WWT_11,
|
||||
WWT_12,
|
||||
WWT_12, // looks like a normal label to me
|
||||
WWT_13,
|
||||
WWT_14,
|
||||
WWT_SPINNER = 15,
|
||||
|
||||
@@ -32,7 +32,7 @@ enum WINDOW_SAVE_PROMPT_WIDGET_IDX {
|
||||
WIDX_BACKGROUND,
|
||||
WIDX_TITLE,
|
||||
WIDX_CLOSE,
|
||||
WIDX_3,
|
||||
WIDX_LABEL,
|
||||
WIDX_SAVE,
|
||||
WIDX_DONT_SAVE,
|
||||
WIDX_CANCEL
|
||||
@@ -42,10 +42,10 @@ static rct_widget window_save_prompt_widgets[] = {
|
||||
{ WWT_FRAME, 0, 0, 259, 0, 49, -1, STR_NONE }, // panel / background
|
||||
{ WWT_CAPTION, 0, 1, 258, 1, 14, 0, STR_WINDOW_TITLE_TIP }, // title bar
|
||||
{ WWT_CLOSEBOX, 0, 247, 257, 2, 13, 824, STR_CLOSE_WINDOW_TIP }, // close x button
|
||||
{ WWT_12, 0, 2, 257, 19, 30, 0, STR_NONE }, //
|
||||
{ WWT_DROPDOWN_BUTTON, 0, 8, 85, 35, 46, STR_SAVE_PROMPT_SAVE, STR_NONE }, // save
|
||||
{ WWT_DROPDOWN_BUTTON, 0, 91, 168, 35, 46, STR_SAVE_PROMPT_DONT_SAVE, STR_NONE }, // don't save
|
||||
{ WWT_DROPDOWN_BUTTON, 0, 174, 251, 35, 46, STR_SAVE_PROMPT_CANCEL, STR_NONE }, // cancel
|
||||
{ WWT_12, 0, 2, 257, 19, 30, 0, STR_NONE }, // question/label
|
||||
{ WWT_DROPDOWN_BUTTON, 0, 8, 85, 35, 46, 0, STR_SAVE_PROMPT_SAVE }, // save
|
||||
{ WWT_DROPDOWN_BUTTON, 0, 91, 168, 35, 46, 0, STR_SAVE_PROMPT_DONT_SAVE },// don't save
|
||||
{ WWT_DROPDOWN_BUTTON, 0, 174, 251, 35, 46, 0, STR_SAVE_PROMPT_CANCEL }, // cancel
|
||||
{ WIDGETS_END },
|
||||
};
|
||||
|
||||
@@ -123,13 +123,14 @@ void window_save_prompt_open()
|
||||
window_invalidate_by_id(0x80 | WC_TOP_TOOLBAR, 0);
|
||||
}
|
||||
|
||||
stringId = RCT2_GLOBAL(0x009A9802, uint16) + STR_LOAD_GAME;
|
||||
stringId = RCT2_GLOBAL(RCT2_ADDRESS_SAVE_PROMPT_MODE, uint16) + STR_LOAD_GAME;
|
||||
if (stringId == STR_LOAD_GAME && RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2)
|
||||
stringId = STR_LOAD_LANDSCAPE;
|
||||
if (stringId == STR_QUIT_GAME && RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2)
|
||||
stringId = STR_QUIT_SCENARIO_EDITOR;
|
||||
window_save_prompt_widgets[WIDX_TITLE].image = stringId;
|
||||
window_save_prompt_widgets[WIDX_3].image = RCT2_GLOBAL(0x009A9802, uint16) + STR_SAVE_BEFORE_LOADING;
|
||||
window_save_prompt_widgets[WIDX_LABEL].image =
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SAVE_PROMPT_MODE, uint16) + STR_SAVE_BEFORE_LOADING;
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0D) {
|
||||
game_load_or_quit_no_save_prompt();
|
||||
@@ -189,6 +190,20 @@ static void window_save_prompt_mouseup()
|
||||
|
||||
|
||||
// TODO
|
||||
switch (widgetIndex) {
|
||||
case WIDX_CLOSE:
|
||||
window_close(w);
|
||||
window_save_prompt_close();
|
||||
break;
|
||||
case WIDX_SAVE:
|
||||
break;
|
||||
case WIDX_DONT_SAVE:
|
||||
break;
|
||||
case WIDX_CANCEL:
|
||||
window_close(w);
|
||||
window_save_prompt_close();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void window_save_prompt_paint()
|
||||
@@ -210,4 +225,18 @@ static void window_save_prompt_paint()
|
||||
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
|
||||
gfx_draw_string_centred(dpi, window_save_prompt_widgets[WIDX_LABEL].image,
|
||||
w->x + window_save_prompt_widgets[WIDX_LABEL].left + 125,
|
||||
w->y + window_save_prompt_widgets[WIDX_LABEL].top + 1, 2, w);
|
||||
|
||||
gfx_draw_string_centred(dpi, STR_SAVE_PROMPT_SAVE,
|
||||
w->x + window_save_prompt_widgets[WIDX_SAVE].left + 38,
|
||||
w->y + window_save_prompt_widgets[WIDX_SAVE].top + 1, 2, w);
|
||||
gfx_draw_string_centred(dpi, STR_SAVE_PROMPT_DONT_SAVE,
|
||||
w->x + window_save_prompt_widgets[WIDX_DONT_SAVE].left + 38,
|
||||
w->y + window_save_prompt_widgets[WIDX_DONT_SAVE].top + 1, 2, w);
|
||||
gfx_draw_string_centred(dpi, STR_SAVE_PROMPT_CANCEL,
|
||||
w->x + window_save_prompt_widgets[WIDX_CANCEL].left + 38,
|
||||
w->y + window_save_prompt_widgets[WIDX_CANCEL].top + 1, 2, w);
|
||||
}
|
||||
Reference in New Issue
Block a user