forked from rosebudai/OpenRCT2-Web
add screenshot and error window base functions
This commit is contained in:
1 parent
e63b027683
commit
2afb4e12eb
10 files changed
+207
-22
No files matched your search
@@ -34,6 +34,7 @@
|
||||
<ClInclude Include="..\src\ride.h" />
|
||||
<ClInclude Include="..\src\sawyercoding.h" />
|
||||
<ClInclude Include="..\src\scenario.h" />
|
||||
<ClInclude Include="..\src\screenshot.h" />
|
||||
<ClInclude Include="..\src\sprite.h" />
|
||||
<ClInclude Include="..\src\sprites.h" />
|
||||
<ClInclude Include="..\src\strings.h" />
|
||||
@@ -45,6 +46,7 @@
|
||||
<ClInclude Include="..\src\widget.h" />
|
||||
<ClInclude Include="..\src\window.h" />
|
||||
<ClInclude Include="..\src\window_dropdown.h" />
|
||||
<ClInclude Include="..\src\window_error.h" />
|
||||
<ClInclude Include="..\src\window_tooltip.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
@@ -67,6 +69,7 @@
|
||||
<ClCompile Include="..\src\ride.c" />
|
||||
<ClCompile Include="..\src\sawyercoding.c" />
|
||||
<ClCompile Include="..\src\scenario.c" />
|
||||
<ClCompile Include="..\src\screenshot.c" />
|
||||
<ClCompile Include="..\src\strings.c" />
|
||||
<ClCompile Include="..\src\title.c" />
|
||||
<ClCompile Include="..\src\track.c" />
|
||||
@@ -77,6 +80,7 @@
|
||||
<ClCompile Include="..\src\window.c" />
|
||||
<ClCompile Include="..\src\window_cheats.c" />
|
||||
<ClCompile Include="..\src\window_clear_scenery.c" />
|
||||
<ClCompile Include="..\src\window_error.c" />
|
||||
<ClCompile Include="..\src\window_game_bottom_toolbar.c" />
|
||||
<ClCompile Include="..\src\window_dropdown.c" />
|
||||
<ClCompile Include="..\src\window_land.c" />
|
||||
|
||||
@@ -114,6 +114,12 @@
|
||||
<ClInclude Include="..\src\window_tooltip.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\window_error.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\screenshot.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\game.c">
|
||||
@@ -239,6 +245,12 @@
|
||||
<ClCompile Include="..\src\window_tooltip.c">
|
||||
<Filter>Windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\window_error.c">
|
||||
<Filter>Windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\screenshot.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\openrct2.exe">
|
||||
|
||||
@@ -103,6 +103,7 @@
|
||||
#define RCT2_ADDRESS_CURSOR_OVER_WIDGETINDEX 0x009DE560
|
||||
|
||||
#define RCT2_ADDRESS_SCREEN_FLAGS 0x009DEA68
|
||||
#define RCT2_ADDRESS_SCREENSHOT_COUNTDOWN 0x009DEA6D
|
||||
#define RCT2_ADDRESS_PLACE_OBJECT_MODIFIER 0x009DEA70
|
||||
#define RCT2_ADDRESS_ON_TUTORIAL 0x009DEA71
|
||||
|
||||
|
||||
+21
-4
@@ -26,11 +26,15 @@
|
||||
#include "news_item.h"
|
||||
#include "osinterface.h"
|
||||
#include "peep.h"
|
||||
#include "screenshot.h"
|
||||
#include "strings.h"
|
||||
#include "widget.h"
|
||||
#include "window.h"
|
||||
#include "window_error.h"
|
||||
#include "window_tooltip.h"
|
||||
|
||||
void game_handle_input();
|
||||
void game_handle_keyboard_input();
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -50,6 +54,8 @@ void game_update()
|
||||
|
||||
// 0x006E3AEC // screen_game_process_mouse_input();
|
||||
// RCT2_CALLPROC_EBPSAFE(0x006E3AEC); // screen_game_process_keyboard_input();
|
||||
screenshot_check();
|
||||
game_handle_keyboard_input();
|
||||
|
||||
// do game logic
|
||||
eax = RCT2_GLOBAL(0x009DE588, uint16) / 31;
|
||||
@@ -119,7 +125,7 @@ void game_update()
|
||||
|
||||
void game_logic_update()
|
||||
{
|
||||
short _bx, _dx;
|
||||
short stringId, _dx;
|
||||
|
||||
RCT2_GLOBAL(0x013628F4, sint32)++;
|
||||
RCT2_GLOBAL(0x00F663AC, sint32)++;
|
||||
@@ -151,15 +157,15 @@ void game_logic_update()
|
||||
window_dispatch_update_all();
|
||||
|
||||
if (RCT2_GLOBAL(0x009AC31B, uint8) != 0) {
|
||||
_bx = 3010;
|
||||
stringId = STR_UNABLE_TO_LOAD_FILE;
|
||||
_dx = RCT2_GLOBAL(0x009AC31C, uint16);
|
||||
if (RCT2_GLOBAL(0x009AC31B, uint8) != 254) {
|
||||
_bx = RCT2_GLOBAL(0x009AC31C, uint16);
|
||||
stringId = RCT2_GLOBAL(0x009AC31C, uint16);
|
||||
_dx = 0xFFFF;
|
||||
}
|
||||
RCT2_GLOBAL(0x009AC31B, uint8) = 0;
|
||||
|
||||
RCT2_CALLPROC_X(0x0066792F, 0, _bx, 0, _dx, 0, 0, 0);
|
||||
window_error_open(stringId, _dx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -753,4 +759,15 @@ static void input_leftmousedown(int x, int y, rct_window *w, int widgetIndex)
|
||||
RCT2_CALLPROC_X(w->event_handlers[WE_MOUSE_DOWN], 0, 0, 0, widgetIndex, w, widget, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006E3B43
|
||||
*/
|
||||
void game_handle_keyboard_input()
|
||||
{
|
||||
RCT2_CALLPROC_EBPSAFE(0x006E3B43);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* 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/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "rct2.h"
|
||||
#include "screenshot.h"
|
||||
#include "strings.h"
|
||||
#include "window_error.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006E3AEC
|
||||
*/
|
||||
void screenshot_check()
|
||||
{
|
||||
int screenshotIndex;
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREENSHOT_COUNTDOWN, uint8) != 0) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SCREENSHOT_COUNTDOWN, uint8)--;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREENSHOT_COUNTDOWN, uint8) == 0) {
|
||||
RCT2_CALLPROC_EBPSAFE(0x00684218);
|
||||
screenshotIndex = screenshot_dump();
|
||||
RCT2_GLOBAL(0x013CE952, uint16) = STR_SCR_BMP;
|
||||
RCT2_GLOBAL(0x013CE952 + 2, uint16) = screenshotIndex;
|
||||
RCT2_GLOBAL(0x009A8C29, uint8) |= 1;
|
||||
|
||||
window_error_open(screenshotIndex == -1 ? STR_SCREENSHOT_FAILED : STR_SCREENSHOT_SAVED_AS, -1);
|
||||
RCT2_GLOBAL(0x009A8C29, uint8) &= ~1;
|
||||
RCT2_CALLPROC_EBPSAFE(0x006843DC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00683D20
|
||||
*/
|
||||
int screenshot_dump()
|
||||
{
|
||||
int eax, ebx, ecx, edx, esi, edi, ebp;
|
||||
RCT2_CALLFUNC_X(0x00683D20, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||
return eax & 0xFFFF;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* 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/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _SCREENSHOT_H_
|
||||
#define _SCREENSHOT_H_
|
||||
|
||||
void screenshot_check();
|
||||
int screenshot_dump();
|
||||
|
||||
#endif
|
||||
@@ -144,6 +144,11 @@ enum {
|
||||
STR_PAUSE_GAME_TIP = 833,
|
||||
STR_DISC_AND_GAME_OPTIONS_TIP = 834,
|
||||
|
||||
STR_SCR_BMP = 890,
|
||||
STR_SCREENSHOT = 891,
|
||||
STR_SCREENSHOT_SAVED_AS = 892,
|
||||
STR_SCREENSHOT_FAILED = 893,
|
||||
|
||||
STR_VIEW_OPTIONS_TIP = 937,
|
||||
STR_ADJUST_LAND_TIP = 938,
|
||||
|
||||
@@ -352,6 +357,8 @@ enum {
|
||||
STR_LICENCE_AGREEMENT_NOTICE_1 = 2969,
|
||||
STR_LICENCE_AGREEMENT_NOTICE_2 = 2970,
|
||||
|
||||
STR_UNABLE_TO_LOAD_FILE = 3010,
|
||||
|
||||
STR_BEGINNER_PARKS = 3064,
|
||||
STR_CHALLENGING_PARKS = STR_BEGINNER_PARKS + 1,
|
||||
STR_EXPERT_PARKS = STR_BEGINNER_PARKS + 2,
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* 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/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "window_error.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0066792F
|
||||
*/
|
||||
void window_error_open(int stringId, int edx)
|
||||
{
|
||||
RCT2_CALLPROC_X(0x0066792F, 0, stringId, 0, edx, 0, 0, 0);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* 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/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _WINDOW_ERROR_H_
|
||||
#define _WINDOW_ERROR_H_
|
||||
|
||||
void window_error_open(int stringId, int edx);
|
||||
|
||||
#endif
|
||||
+18
-18
@@ -1,22 +1,22 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* 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/>.
|
||||
*****************************************************************************/
|
||||
* Copyright (c) 2014 Ted John
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* 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/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <memory.h>
|
||||
#include "addresses.h"
|
||||
|
||||
Reference in new issue
Block a user