move input functions to input code file

This commit is contained in:
IntelOrca 2014-08-24 18:45:47 +01:00
parent 425881b8b1
commit 83ba89214c
8 changed files with 1838 additions and 1772 deletions

View File

@ -28,6 +28,7 @@
<ClInclude Include="..\src\game.h" />
<ClInclude Include="..\src\gfx.h" />
<ClInclude Include="..\src\graph.h" />
<ClInclude Include="..\src\input.h" />
<ClInclude Include="..\src\intro.h" />
<ClInclude Include="..\src\language.h" />
<ClInclude Include="..\src\map.h" />
@ -74,6 +75,7 @@
<ClCompile Include="..\src\game.c" />
<ClCompile Include="..\src\gfx.c" />
<ClCompile Include="..\src\graph.c" />
<ClCompile Include="..\src\input.c" />
<ClCompile Include="..\src\intro.c" />
<ClCompile Include="..\src\language.c" />
<ClCompile Include="..\src\map.c" />

View File

@ -159,6 +159,9 @@
<ClInclude Include="..\src\staff.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\input.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\game.c">
@ -377,6 +380,9 @@
<ClCompile Include="..\src\staff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\input.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\openrct2.exe">

1776
src/game.c

File diff suppressed because it is too large Load Diff

View File

@ -84,6 +84,8 @@ enum GAME_COMMAND {
typedef void (GAME_COMMAND_POINTER)(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);
extern int gGameSpeed;
void game_create_windows();
void game_update();
void game_logic_update();

1765
src/input.c Normal file

File diff suppressed because it is too large Load Diff

27
src/input.h Normal file
View File

@ -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 _INPUT_H_
#define _INPUT_H_
void game_handle_input();
void game_handle_keyboard_input();
#endif

View File

@ -1465,3 +1465,34 @@ void window_resize_gui_scenario_editor(int width, int height)
}
}
void RCT2_CALLPROC_WE_MOUSE_DOWN(int address, int widgetIndex, rct_window*w, rct_widget* widget )
{
#ifdef _MSC_VER
__asm {
push address
push widget
push w
push widgetIndex
mov edi, widget
mov edx, widgetIndex
mov esi, w
call[esp + 12]
add esp, 16
}
#else
__asm__("\
push %[address]\n\
mov edi, %[widget] \n\
mov eax, %[w] \n\
mov edx, %[widgetIndex] \n\
push edi \n\
push eax \n\
push edx \n\
mov esi, %[w] \n\
call [esp+12] \n\
add esp, 16 \n\
" :[address] "+m" (address), [w] "+m" (w), [widget] "+m" (widget), [widgetIndex] "+m" (widgetIndex): : "eax", "esi", "edx", "edi"
);
#endif
}

View File

@ -457,6 +457,7 @@ void window_new_ride_init_vars();
void window_staff_init_vars();
void window_event_helper(rct_window* w, short widgetIndex, WINDOW_EVENTS event);
void RCT2_CALLPROC_WE_MOUSE_DOWN(int address, int widgetIndex, rct_window*w, rct_widget* widget);
#ifdef _MSC_VER
#define window_get_register(w) \