mirror of https://github.com/OpenRCT2/OpenRCT2.git
add intro screen code
This commit is contained in:
parent
bfd3ad8b28
commit
182db27ab3
|
@ -16,15 +16,21 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\addresses.h" />
|
||||
<ClInclude Include="..\src\audio.h" />
|
||||
<ClInclude Include="..\src\game.h" />
|
||||
<ClInclude Include="..\src\gfx.h" />
|
||||
<ClInclude Include="..\src\intro.h" />
|
||||
<ClInclude Include="..\src\osinterface.h" />
|
||||
<ClInclude Include="..\src\rct2.h" />
|
||||
<ClInclude Include="..\src\strings.h" />
|
||||
<ClInclude Include="..\src\title.h" />
|
||||
<ClInclude Include="..\src\window.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\audio.c" />
|
||||
<ClCompile Include="..\src\game.c" />
|
||||
<ClCompile Include="..\src\gfx.c" />
|
||||
<ClCompile Include="..\src\intro.c" />
|
||||
<ClCompile Include="..\src\osinterface.c" />
|
||||
<ClCompile Include="..\src\rct2.c" />
|
||||
|
|
|
@ -36,6 +36,18 @@
|
|||
<ClInclude Include="..\src\window.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\audio.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\gfx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\strings.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\game.c">
|
||||
|
@ -56,6 +68,12 @@
|
|||
<ClCompile Include="..\src\window.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\audio.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\gfx.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\openrct2.exe">
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by openrct2.rc
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
|
@ -28,6 +28,18 @@
|
|||
#define RCT2_CALLPROC(address) (((void(*)())address)())
|
||||
#define RCT2_CALLFUNC(address, returnType) (((returnType(*)())address)())
|
||||
|
||||
#define RCT2_CALLFUNC_1(address, returnType, a1, v1) (((returnType(*)(a1))address)(v1))
|
||||
#define RCT2_CALLFUNC_2(address, returnType, a1, a2, v1, v2) (((returnType(*)(a1, a2))address)(v1, v2))
|
||||
#define RCT2_CALLFUNC_3(address, returnType, a1, a2, a3, v1, v2, v3) (((returnType(*)(a1, a2, a3))address)(v1, v2, v3))
|
||||
#define RCT2_CALLFUNC_4(address, returnType, a1, a2, a3, a4, v1, v2, v3, v4) (((returnType(*)(a1, a2, a3, a4))address)(v1, v2, v3, v4))
|
||||
#define RCT2_CALLFUNC_5(address, returnType, a1, a2, a3, a4, a5, v1, v2, v3, v4, v5) (((returnType(*)(a1, a2, a3, a4, a5))address)(v1, v2, v3, v4, v5))
|
||||
|
||||
#define RCT2_CALLPROC_1(address, a1, v1) RCT2_CALLFUNC_1(address, void, a1, v1)
|
||||
#define RCT2_CALLPROC_2(address, a1, a2, v1, v2) RCT2_CALLFUNC_2(address, void, a1, a2, v1, v2)
|
||||
#define RCT2_CALLPROC_3(address, a1, a2, a3, v1, v2, v3) RCT2_CALLFUNC_3(address, void, a1, a2, a3, v1, v2, v3)
|
||||
#define RCT2_CALLPROC_4(address, a1, a2, a3, a4, v1, v2, v3, v4) RCT2_CALLFUNC_4(address, void, a1, a2, a3, a4, v1, v2, v3, v4)
|
||||
#define RCT2_CALLPROC_5(address, a1, a2, a3, a4, a5, v1, v2, v3, v4, v5) RCT2_CALLFUNC_4(address, void, a1, a2, a3, a4, a5, v1, v2, v3, v4, v5)
|
||||
|
||||
#define RCT2_ADDRESS_CMDLINE 0x009E2D98
|
||||
|
||||
#define RCT2_ADDRESS_APP_PATH 0x009AA214
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
/*****************************************************************************
|
||||
* 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 "audio.h"
|
||||
#include "addresses.h"
|
||||
|
||||
void get_dsound_devices()
|
||||
{
|
||||
RCT2_CALLPROC(0x0040502E);
|
||||
}
|
||||
|
||||
int sound_prepare(int sound_id, rct_sound *sound, int var_8, int var_c)
|
||||
{
|
||||
return RCT2_CALLFUNC_4(0x00404C6D, int, int, rct_sound*, int, int, sound_id, sound, var_8, var_c);
|
||||
}
|
||||
|
||||
int sound_play(rct_sound* sound, int looping, int volume, int pan, int frequency)
|
||||
{
|
||||
return RCT2_CALLFUNC_5(0x00404E7F, int, rct_sound*, int, int, int, int, sound, looping, volume, pan, frequency);
|
||||
}
|
||||
|
||||
void sound_stop(rct_sound* sound)
|
||||
{
|
||||
return RCT2_CALLPROC_1(0x00404DD8, rct_sound*, sound);
|
||||
}
|
277
src/intro.c
277
src/intro.c
|
@ -19,10 +19,285 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "audio.h"
|
||||
#include "gfx.h"
|
||||
#include "intro.h"
|
||||
#include "rct2.h"
|
||||
#include "osinterface.h"
|
||||
#include "strings.h"
|
||||
|
||||
static void screen_intro_process_mouse_input();
|
||||
static void screen_intro_process_keyboard_input();
|
||||
static void screen_intro_skip_part();
|
||||
|
||||
static int _sound_playing_flag = 0; ///< Used to test if a sound is currently playing.
|
||||
static rct_sound _prepared_sound; ///< A prepared sound for playing.
|
||||
static int _tick_counter; ///< Used mainly for timing but also for Y coordinate and fading.
|
||||
|
||||
// rct2: 0x0068E966
|
||||
void intro_update()
|
||||
{
|
||||
RCT2_CALLPROC(0x0068E966);
|
||||
rct_drawpixelinfo *screenDPI = RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo);
|
||||
int screenWidth = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, sint16);
|
||||
int screenHeight = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, sint16);
|
||||
uint8 (*part) = RCT2_ADDRESS(RCT2_ADDRESS_RUN_INTRO_TICK_PART, uint8);
|
||||
|
||||
screen_intro_process_mouse_input();
|
||||
screen_intro_process_keyboard_input();
|
||||
|
||||
RCT2_GLOBAL(0x009E2C78, int) = 1;
|
||||
switch ((*part)) {
|
||||
case 8:
|
||||
// Clear the screen
|
||||
gfx_clear(screenDPI, 10);
|
||||
|
||||
// Draw the disclaimer text
|
||||
gfx_draw_string_centred(screenDPI, STR_LICENCE_AGREEMENT_NOTICE_1, screenWidth / 2, 180, 13, 0);
|
||||
gfx_draw_string_centred(screenDPI, STR_LICENCE_AGREEMENT_NOTICE_2, screenWidth / 2, 195, 13, 0);
|
||||
|
||||
// Set palette thing
|
||||
gfx_transpose_palette(1532, 255);
|
||||
|
||||
// Reset wait counter
|
||||
_tick_counter = 0;
|
||||
|
||||
// Move to next part
|
||||
(*part)++;
|
||||
break;
|
||||
case 9:
|
||||
// Wait 320 game ticks, then move to part 1
|
||||
_tick_counter++;
|
||||
if (_tick_counter >= 320)
|
||||
(*part) = 1;
|
||||
break;
|
||||
case 1:
|
||||
// Clear the screen
|
||||
gfx_clear(screenDPI, 10);
|
||||
|
||||
// Set the Y for the Infogrammes logo
|
||||
_tick_counter = -580;
|
||||
|
||||
// Chain lift sound
|
||||
_sound_playing_flag = 0;
|
||||
if (RCT2_GLOBAL(0x009AF280, sint32) != -1) {
|
||||
// Prepare and play the sound
|
||||
if (sound_prepare(RCT2_SOUND_CHAINLIFT, &_prepared_sound, 0, 1))
|
||||
if (sound_play(&_prepared_sound, 1, 0, 0, 0))
|
||||
_sound_playing_flag = 1;
|
||||
}
|
||||
|
||||
// Move to next part
|
||||
(*part)++;
|
||||
break;
|
||||
case 2:
|
||||
// Move the Infogrammes logo down by 5 pixels
|
||||
_tick_counter += 5;
|
||||
|
||||
// Clear the screen
|
||||
gfx_clear(screenDPI, 10);
|
||||
|
||||
// Draw a white rectangle for the logo background (gives a bit of white margin)
|
||||
gfx_fill_rect(screenDPI,
|
||||
(screenWidth / 2) - 320 + 50, _tick_counter + 50,
|
||||
(screenWidth / 2) - 320 + 50 + 540, _tick_counter + 50 + 425,
|
||||
129);
|
||||
|
||||
// Draw the logo
|
||||
gfx_draw_sprite(screenDPI, 0x5ABA, (screenWidth / 2) - 320 + 69, _tick_counter + 69);
|
||||
gfx_draw_sprite(screenDPI, 0x5ABB, (screenWidth / 2) - 320 + 319, _tick_counter + 69);
|
||||
gfx_draw_sprite(screenDPI, 0x5ABC, (screenWidth / 2) - 320 + 69, _tick_counter + 319);
|
||||
gfx_draw_sprite(screenDPI, 0x5ABD, (screenWidth / 2) - 320 + 319, _tick_counter + 319);
|
||||
|
||||
// Check if logo is off the screen .ish
|
||||
if (_tick_counter > 520) {
|
||||
// Clear the screen
|
||||
gfx_clear(screenDPI, 10);
|
||||
|
||||
_tick_counter = -116;
|
||||
|
||||
// Move to the next part
|
||||
(*part)++;
|
||||
}
|
||||
|
||||
break;
|
||||
case 3:
|
||||
//
|
||||
_tick_counter += 5;
|
||||
|
||||
// Clear the screen
|
||||
gfx_clear(screenDPI, 10);
|
||||
|
||||
// Set some palette thing
|
||||
gfx_transpose_palette(23217, 255);
|
||||
|
||||
// Set the Y for the Chris Sawyer logo
|
||||
_tick_counter = -116;
|
||||
|
||||
// Move to the next part
|
||||
(*part)++;
|
||||
break;
|
||||
case 4:
|
||||
// Chris Sawyer logo
|
||||
_tick_counter += 5;
|
||||
|
||||
// Clear the screen
|
||||
gfx_clear(screenDPI, 10);
|
||||
|
||||
// Draw Chris Sawyer logo
|
||||
gfx_draw_sprite(screenDPI, 0x5AAF, (screenWidth / 2) - 320 + 70, _tick_counter);
|
||||
gfx_draw_sprite(screenDPI, 0x5AB0, (screenWidth / 2) - 320 + 320, _tick_counter);
|
||||
|
||||
// Check if logo is at 259 pixels
|
||||
if (_tick_counter == 259) {
|
||||
// Stop the chain lift sound
|
||||
if (_sound_playing_flag == 1) {
|
||||
sound_stop(&_prepared_sound);
|
||||
_sound_playing_flag = 0;
|
||||
}
|
||||
|
||||
// Play the track friction sound
|
||||
if (RCT2_GLOBAL(0x009AF280, sint32) != -1) {
|
||||
// Prepare and play the sound
|
||||
if (sound_prepare(RCT2_SOUND_TRACKFRICTION, &_prepared_sound, 1, 1))
|
||||
if (sound_play(&_prepared_sound, 1, -800, 0, 0x3A98))
|
||||
_sound_playing_flag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if logo is off the screen .ish
|
||||
if (_tick_counter >= 680) {
|
||||
// Clear the screen
|
||||
gfx_clear(screenDPI, 245);
|
||||
|
||||
// Draw RollerCoaster Tycoon 2 logo
|
||||
gfx_draw_sprite(screenDPI, 0x5AB2, (screenWidth / 2) - 320 + 0, 0);
|
||||
gfx_draw_sprite(screenDPI, 0x5AB3, (screenWidth / 2) - 320 + 220, 0);
|
||||
gfx_draw_sprite(screenDPI, 0x5AB4, (screenWidth / 2) - 320 + 440, 0);
|
||||
gfx_draw_sprite(screenDPI, 0x5AB5, (screenWidth / 2) - 320 + 0, 240);
|
||||
gfx_draw_sprite(screenDPI, 0x5AB6, (screenWidth / 2) - 320 + 220, 240);
|
||||
gfx_draw_sprite(screenDPI, 0x5AB7, (screenWidth / 2) - 320 + 440, 240);
|
||||
|
||||
// Set palette thing
|
||||
gfx_transpose_palette(23224, 0);
|
||||
|
||||
// Stop the track friction sound
|
||||
if (_sound_playing_flag == 1) {
|
||||
sound_stop(&_prepared_sound);
|
||||
_sound_playing_flag = 0;
|
||||
}
|
||||
|
||||
// Play long peep scream sound
|
||||
if (RCT2_GLOBAL(0x009AF280, sint32) != -1)
|
||||
if (sound_prepare(RCT2_SOUND_SCREAM, &_prepared_sound, 0, 1))
|
||||
if (sound_play(&_prepared_sound, 0, 0, 0, 0))
|
||||
_sound_playing_flag = 1;
|
||||
|
||||
// Move to the next part
|
||||
(*part)++;
|
||||
|
||||
// Set the current fade to 0
|
||||
_tick_counter = 0;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
// Fade in, add 4 / 256 to fading
|
||||
_tick_counter += 0x000400;
|
||||
if (_tick_counter <= 0x00FF00) {
|
||||
// Set palette thing
|
||||
gfx_transpose_palette(23224, (_tick_counter >> 8) & 0xFF);
|
||||
}
|
||||
else {
|
||||
// Set palette thing
|
||||
gfx_transpose_palette(23224, 255);
|
||||
|
||||
// Move to next part
|
||||
(*part)++;
|
||||
|
||||
// Set the fade to 0
|
||||
_tick_counter = 0;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
// Wait 80 game ticks
|
||||
_tick_counter++;
|
||||
if (_tick_counter >= 80) {
|
||||
// Set fading to 256
|
||||
_tick_counter = 0x00FF00;
|
||||
|
||||
// Move to next part
|
||||
(*part)++;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
// Fade out, subtract 4 / 256 from fading
|
||||
_tick_counter -= 0x000400;
|
||||
if (_tick_counter >= 0) {
|
||||
// Do palette thing
|
||||
gfx_transpose_palette(23224, (_tick_counter >> 8) & 0xFF);
|
||||
}
|
||||
else {
|
||||
// Do palette thing
|
||||
gfx_transpose_palette(23224, 0);
|
||||
|
||||
// Finish the intro sequence
|
||||
(*part) = 254;
|
||||
}
|
||||
break;
|
||||
case 254:
|
||||
// Clear the screen
|
||||
gfx_clear(screenDPI, 10);
|
||||
|
||||
// Stop any playing sound
|
||||
if (_sound_playing_flag == 1) {
|
||||
sound_stop(&_prepared_sound);
|
||||
_sound_playing_flag = 0;
|
||||
}
|
||||
|
||||
// Move to next part
|
||||
(*part)++;
|
||||
_tick_counter = 0;
|
||||
break;
|
||||
case 255:
|
||||
// Finish the intro sequence
|
||||
(*part) = 0;
|
||||
|
||||
// Change palette
|
||||
RCT2_CALLPROC_EBPSAFE(0x006837E3);
|
||||
|
||||
RCT2_GLOBAL(0x009E2C78, sint32) = 0;
|
||||
gfx_invalidate_screen();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void screen_intro_process_mouse_input()
|
||||
{
|
||||
if (gCursorState.any == CURSOR_PRESSED)
|
||||
screen_intro_skip_part();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006E3AEC
|
||||
*/
|
||||
static void screen_intro_process_keyboard_input()
|
||||
{
|
||||
if (gLastKeyPressed != 0)
|
||||
screen_intro_skip_part();
|
||||
}
|
||||
|
||||
static void screen_intro_skip_part()
|
||||
{
|
||||
uint8 (*part) = RCT2_ADDRESS(RCT2_ADDRESS_RUN_INTRO_TICK_PART, uint8);
|
||||
|
||||
switch ((*part)) {
|
||||
case 0:
|
||||
break;
|
||||
case 9:
|
||||
(*part) = 1;
|
||||
break;
|
||||
default:
|
||||
(*part) = 254;
|
||||
break;
|
||||
}
|
||||
}
|
|
@ -23,11 +23,16 @@
|
|||
#include <SDL_syswm.h>
|
||||
|
||||
#include "addresses.h"
|
||||
#include "gfx.h"
|
||||
#include "osinterface.h"
|
||||
#include "rct2.h"
|
||||
|
||||
typedef void(*update_palette_func)(char*, int, int);
|
||||
|
||||
openrct2_cursor gCursorState;
|
||||
const unsigned char* gKeysState;
|
||||
unsigned int gLastKeyPressed;
|
||||
|
||||
static void osinterface_create_window();
|
||||
static void osinterface_close_window();
|
||||
static void osinterface_resize(int width, int height);
|
||||
|
@ -171,6 +176,13 @@ void osinterface_process_messages()
|
|||
{
|
||||
SDL_Event e;
|
||||
|
||||
gLastKeyPressed = 0;
|
||||
gCursorState.wheel = 0;
|
||||
gCursorState.left &= ~CURSOR_CHANGED;
|
||||
gCursorState.middle &= ~CURSOR_CHANGED;
|
||||
gCursorState.right &= ~CURSOR_CHANGED;
|
||||
gCursorState.old = 0;
|
||||
|
||||
SDL_PollEvent(&e);
|
||||
switch (e.type) {
|
||||
case SDL_QUIT:
|
||||
|
@ -183,23 +195,30 @@ void osinterface_process_messages()
|
|||
case SDL_MOUSEMOTION:
|
||||
RCT2_GLOBAL(0x0142406C, int) = e.motion.x;
|
||||
RCT2_GLOBAL(0x01424070, int) = e.motion.y;
|
||||
|
||||
gCursorState.x = e.motion.x;
|
||||
gCursorState.y = e.motion.y;
|
||||
break;
|
||||
case SDL_MOUSEWHEEL:
|
||||
RCT2_GLOBAL(0x009E2D80, int) += e.wheel.y * 128;
|
||||
gCursorState.wheel = e.wheel.y;
|
||||
break;
|
||||
case SDL_MOUSEBUTTONDOWN:
|
||||
RCT2_GLOBAL(0x01424318, int) = e.button.x;
|
||||
RCT2_GLOBAL(0x0142431C, int) = e.button.y;
|
||||
switch (e.button.button) {
|
||||
case SDL_BUTTON_LEFT:
|
||||
((void(*)(int))0x00406C96)(1);
|
||||
RCT2_CALLPROC_1(0x00406C96, int, 1);
|
||||
gCursorState.left = CURSOR_PRESSED;
|
||||
gCursorState.old = 1;
|
||||
break;
|
||||
case SDL_BUTTON_MIDDLE:
|
||||
gCursorState.middle = CURSOR_PRESSED;
|
||||
break;
|
||||
case SDL_BUTTON_RIGHT:
|
||||
__asm push ebp
|
||||
((void(*)(int))0x00406C96)(2);
|
||||
__asm pop ebp
|
||||
RCT2_CALLPROC_1(0x00406C96, int, 2);
|
||||
gCursorState.right = CURSOR_PRESSED;
|
||||
gCursorState.old = 2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -208,18 +227,32 @@ void osinterface_process_messages()
|
|||
*((int*)0x0142431C) = e.button.y;
|
||||
switch (e.button.button) {
|
||||
case SDL_BUTTON_LEFT:
|
||||
((void(*)(int))0x00406C96)(3);
|
||||
RCT2_CALLPROC_1(0x00406C96, int, 3);
|
||||
gCursorState.left = CURSOR_RELEASED;
|
||||
gCursorState.old = 3;
|
||||
break;
|
||||
case SDL_BUTTON_MIDDLE:
|
||||
gCursorState.middle = CURSOR_RELEASED;
|
||||
break;
|
||||
case SDL_BUTTON_RIGHT:
|
||||
((void(*)(int))0x00406C96)(4);
|
||||
RCT2_CALLPROC_1(0x00406C96, int, 4);
|
||||
gCursorState.right = CURSOR_RELEASED;
|
||||
gCursorState.old = 4;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SDL_KEYDOWN:
|
||||
gLastKeyPressed = e.key.keysym.sym;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
gCursorState.any = gCursorState.left | gCursorState.middle | gCursorState.right;
|
||||
|
||||
// Updates the state of the keys
|
||||
int numKeys = 256;
|
||||
gKeysState = SDL_GetKeyboardState(&numKeys);
|
||||
}
|
||||
|
||||
static void osinterface_close_window()
|
||||
|
|
|
@ -21,6 +21,25 @@
|
|||
#ifndef _SDL_INTERFACE_H_
|
||||
#define _SDL_INTERFACE_H_
|
||||
|
||||
enum {
|
||||
CURSOR_UP = 0,
|
||||
CURSOR_DOWN = 1,
|
||||
CURSOR_CHANGED = 2,
|
||||
CURSOR_RELEASED = CURSOR_UP | CURSOR_CHANGED,
|
||||
CURSOR_PRESSED = CURSOR_DOWN | CURSOR_CHANGED,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int x, y;
|
||||
unsigned char left, middle, right, any;
|
||||
int wheel;
|
||||
int old;
|
||||
} openrct2_cursor;
|
||||
|
||||
extern openrct2_cursor gCursorState;
|
||||
const extern unsigned char* gKeysState;
|
||||
extern unsigned int gLastKeyPressed;
|
||||
|
||||
void osinterface_init();
|
||||
void osinterface_process_messages();
|
||||
void osinterface_draw();
|
||||
|
|
11
src/rct2.c
11
src/rct2.c
|
@ -25,10 +25,11 @@
|
|||
#include <windows.h>
|
||||
#include <SDL.h>
|
||||
#include "addresses.h"
|
||||
#include "rct2.h"
|
||||
#include "osinterface.h"
|
||||
#include "intro.h"
|
||||
#include "game.h"
|
||||
#include "gfx.h"
|
||||
#include "intro.h"
|
||||
#include "osinterface.h"
|
||||
#include "rct2.h"
|
||||
#include "title.h"
|
||||
|
||||
void rct2_init_directories();
|
||||
|
@ -126,8 +127,8 @@ void rct2_init()
|
|||
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068E8DA); // screen_title_load();
|
||||
|
||||
// gfx_clear(screen_dpi, 10);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_RUN_INTRO_TICK_PART, int) = 0;
|
||||
gfx_clear(RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo), 10);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_RUN_INTRO_TICK_PART, int) = 8;
|
||||
}
|
||||
|
||||
// rct2: 0x00683499
|
||||
|
|
11
src/rct2.h
11
src/rct2.h
|
@ -30,17 +30,6 @@ typedef unsigned short uint16;
|
|||
typedef unsigned long uint32;
|
||||
typedef unsigned long long uint64;
|
||||
|
||||
typedef struct {
|
||||
char* bits; // 0x00
|
||||
short x; // 0x04
|
||||
short y; // 0x06
|
||||
short width; // 0x08
|
||||
short height; // 0x0A
|
||||
short pitch; // 0x0C
|
||||
char pad_0E; // 0x0E
|
||||
char var_0F; // 0x0F
|
||||
} rct_drawpixelinfo;
|
||||
|
||||
void rct2_finish();
|
||||
|
||||
#endif
|
|
@ -0,0 +1,232 @@
|
|||
/*****************************************************************************
|
||||
* 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 _STRINGS_H_
|
||||
#define _STRINGS_H_
|
||||
|
||||
typedef unsigned short rct_string_id;
|
||||
|
||||
void format_string(char* dest, rct_string_id format, void* args);
|
||||
void generate_string_file();
|
||||
|
||||
enum {
|
||||
STR_NONE = -1,
|
||||
|
||||
STR_DATE_DAY_1 = 779,
|
||||
STR_DATE_DAY_2 = STR_DATE_DAY_1 + 1,
|
||||
STR_DATE_DAY_3 = STR_DATE_DAY_1 + 2,
|
||||
STR_DATE_DAY_4 = STR_DATE_DAY_1 + 3,
|
||||
STR_DATE_DAY_5 = STR_DATE_DAY_1 + 4,
|
||||
STR_DATE_DAY_6 = STR_DATE_DAY_1 + 5,
|
||||
STR_DATE_DAY_7 = STR_DATE_DAY_1 + 6,
|
||||
STR_DATE_DAY_8 = STR_DATE_DAY_1 + 7,
|
||||
STR_DATE_DAY_9 = STR_DATE_DAY_1 + 8,
|
||||
STR_DATE_DAY_10 = STR_DATE_DAY_1 + 9,
|
||||
STR_DATE_DAY_11 = STR_DATE_DAY_1 + 10,
|
||||
STR_DATE_DAY_12 = STR_DATE_DAY_1 + 11,
|
||||
STR_DATE_DAY_13 = STR_DATE_DAY_1 + 12,
|
||||
STR_DATE_DAY_14 = STR_DATE_DAY_1 + 13,
|
||||
STR_DATE_DAY_15 = STR_DATE_DAY_1 + 14,
|
||||
STR_DATE_DAY_16 = STR_DATE_DAY_1 + 15,
|
||||
STR_DATE_DAY_17 = STR_DATE_DAY_1 + 16,
|
||||
STR_DATE_DAY_18 = STR_DATE_DAY_1 + 17,
|
||||
STR_DATE_DAY_19 = STR_DATE_DAY_1 + 18,
|
||||
STR_DATE_DAY_20 = STR_DATE_DAY_1 + 19,
|
||||
STR_DATE_DAY_21 = STR_DATE_DAY_1 + 20,
|
||||
STR_DATE_DAY_22 = STR_DATE_DAY_1 + 21,
|
||||
STR_DATE_DAY_23 = STR_DATE_DAY_1 + 22,
|
||||
STR_DATE_DAY_24 = STR_DATE_DAY_1 + 23,
|
||||
STR_DATE_DAY_25 = STR_DATE_DAY_1 + 24,
|
||||
STR_DATE_DAY_26 = STR_DATE_DAY_1 + 25,
|
||||
STR_DATE_DAY_27 = STR_DATE_DAY_1 + 26,
|
||||
STR_DATE_DAY_28 = STR_DATE_DAY_1 + 27,
|
||||
STR_DATE_DAY_29 = STR_DATE_DAY_1 + 28,
|
||||
STR_DATE_DAY_30 = STR_DATE_DAY_1 + 29,
|
||||
STR_DATE_DAY_31 = STR_DATE_DAY_1 + 30,
|
||||
STR_MONTH_SHORT_JAN = 810,
|
||||
STR_MONTH_SHORT_FEB = STR_MONTH_SHORT_JAN + 1,
|
||||
STR_MONTH_SHORT_MAR = STR_MONTH_SHORT_JAN + 2,
|
||||
STR_MONTH_SHORT_APR = STR_MONTH_SHORT_JAN + 3,
|
||||
STR_MONTH_SHORT_MAY = STR_MONTH_SHORT_JAN + 4,
|
||||
STR_MONTH_SHORT_JUN = STR_MONTH_SHORT_JAN + 5,
|
||||
STR_MONTH_SHORT_JUL = STR_MONTH_SHORT_JAN + 6,
|
||||
STR_MONTH_SHORT_AUG = STR_MONTH_SHORT_JAN + 7,
|
||||
STR_MONTH_SHORT_SEP = STR_MONTH_SHORT_JAN + 8,
|
||||
STR_MONTH_SHORT_OCT = STR_MONTH_SHORT_JAN + 9,
|
||||
STR_MONTH_SHORT_NOV = STR_MONTH_SHORT_JAN + 10,
|
||||
STR_MONTH_SHORT_DEC = STR_MONTH_SHORT_JAN + 11,
|
||||
|
||||
STR_CLOSE_WINDOW_TIP = 828,
|
||||
STR_WINDOW_TITLE_TIP = 829,
|
||||
|
||||
STR_ZOOM_IN_TIP = 830,
|
||||
STR_ZOOM_OUT_TIP = 831,
|
||||
STR_ROTATE_TIP = 832,
|
||||
STR_PAUSE_GAME_TIP = 833,
|
||||
STR_DISC_AND_GAME_OPTIONS_TIP = 834,
|
||||
|
||||
STR_VIEW_OPTIONS_TIP = 937,
|
||||
STR_ADJUST_LAND_TIP = 938,
|
||||
|
||||
STR_CANCEL = 972,
|
||||
STR_OK = 973,
|
||||
|
||||
STR_RAISE_COST_AMOUNT = 984,
|
||||
STR_LOWER_COST_AMOUNT = 985,
|
||||
STR_COST_AMOUNT = 986,
|
||||
|
||||
STR_LOCATE_SUBJECT_TIP = 1027,
|
||||
|
||||
STR_RIDES_IN_PARK_TIP = 1053,
|
||||
|
||||
STR_PLACE_SCENERY_TIP = 1159,
|
||||
STR_ADJUST_WATER_TIP = 1160,
|
||||
|
||||
STR_BUILD_FOOTPATH_TIP = 1173,
|
||||
|
||||
STR_GUESTS = 1463,
|
||||
|
||||
STR_GUESTS_TIP = 1693,
|
||||
STR_STAFF_TIP = 1694,
|
||||
|
||||
STR_INDIVIDUAL_GUESTS_TIP = 1752,
|
||||
STR_SUMMARISED_GUESTS_TIP = 1753,
|
||||
|
||||
STR_ACTIONS = 1814,
|
||||
STR_THOUGHTS = STR_ACTIONS + 1,
|
||||
STR_INFORMATION_TYPE_TIP = 1816,
|
||||
STR_GUESTS_COUNT_COMMA_SEP = 1817,
|
||||
STR_ALL_GUESTS = 1818,
|
||||
STR_ALL_GUESTS_SUMMARISED = 1819,
|
||||
STR_GUESTS_FILTER = 1820,
|
||||
STR_GUESTS_FILTER_THINKING = STR_GUESTS_FILTER + 1,
|
||||
STR_GUESTS_FILTER_THINKING_ABOUT = STR_GUESTS_FILTER + 2,
|
||||
|
||||
STR_NUM_GUESTS = 1846,
|
||||
|
||||
STR_BUILD_RIDE_TIP = 1895,
|
||||
|
||||
STR_START_NEW_GAME_TIP = 1921,
|
||||
STR_CONTINUE_SAVED_GAME_TIP = 1922,
|
||||
STR_SHOW_TUTORIAL_TIP = 1923,
|
||||
STR_EXIT = 1924,
|
||||
|
||||
STR_SHOW_SUBJECT_TIP = 1937,
|
||||
|
||||
STR_CELCIUS_VALUE = 2216,
|
||||
STR_FAHRENHEIT_VALUE = 2217,
|
||||
|
||||
STR_PARK_rating_TIP = 2221,
|
||||
|
||||
STR_PARK_INFORMATION_TIP = 2233,
|
||||
|
||||
STR_MONTH_JANUARY = 2236,
|
||||
STR_MONTH_FEBRUARY = STR_MONTH_JANUARY + 1,
|
||||
STR_MONTH_MARCH = STR_MONTH_JANUARY + 2,
|
||||
STR_MONTH_APRIL = STR_MONTH_JANUARY + 3,
|
||||
STR_MONTH_MAY = STR_MONTH_JANUARY + 4,
|
||||
STR_MONTH_JUNE = STR_MONTH_JANUARY + 5,
|
||||
STR_MONTH_JULY = STR_MONTH_JANUARY + 6,
|
||||
STR_MONTH_AUGUST = STR_MONTH_JANUARY + 7,
|
||||
STR_MONTH_SEPTEMBER = STR_MONTH_JANUARY + 8,
|
||||
STR_MONTH_OCTOBER = STR_MONTH_JANUARY + 9,
|
||||
STR_MONTH_NOVEMBER = STR_MONTH_JANUARY + 10,
|
||||
STR_MONTH_DECEMBER = STR_MONTH_JANUARY + 11,
|
||||
|
||||
STR_SELECT_SCENARIO = 2291,
|
||||
|
||||
STR_CHANGE_BASE_LAND_TIP = 2294,
|
||||
STR_CHANGE_VERTICAL_LAND_TIP = 2295,
|
||||
|
||||
STR_ADJUST_SMALLER_LAND_TIP = 2378,
|
||||
STR_ADJUST_LARGER_LAND_TIP = 2379,
|
||||
STR_ADJUST_SMALLER_WATER_TIP = 2380,
|
||||
STR_ADJUST_LARGER_WATER_TIP = 2381,
|
||||
STR_LAND = 2382,
|
||||
STR_WATER = 2383,
|
||||
|
||||
STR_OBJECTIVE_NONE = 2385,
|
||||
STR_OBJECTIVE_GUESTS_BY = STR_OBJECTIVE_NONE + 1,
|
||||
STR_OBJECTIVE_PARK_VALUE_BY = STR_OBJECTIVE_NONE + 2,
|
||||
STR_OBJECTIVE_HAVE_FUN = STR_OBJECTIVE_NONE + 3,
|
||||
STR_OBJECTIVE_BUILD_THE_BEST = STR_OBJECTIVE_NONE + 4,
|
||||
STR_OBJECTIVE_10_ROLLERCOASTERS = STR_OBJECTIVE_NONE + 5,
|
||||
STR_OBJECTIVE_GUESTS_AND_rating = STR_OBJECTIVE_NONE + 6,
|
||||
STR_OBJECTIVE_MONTHLY_RIDE_INCOME = STR_OBJECTIVE_NONE + 7,
|
||||
STR_OBJECTIVE_10_ROLLERCOASTERS_LENGTH = STR_OBJECTIVE_NONE + 8,
|
||||
STR_OBJECTIVE_FINISH_5_ROLLERCOASTERS = STR_OBJECTIVE_NONE + 9,
|
||||
STR_OBJECTIVE_REPLAY_LOAN_AND_PARK_VALUE = STR_OBJECTIVE_NONE + 10,
|
||||
STR_OBJECTIVE_MONTHLY_FOOD_INCOME = STR_OBJECTIVE_NONE + 11,
|
||||
|
||||
STR_PROFIT_PER_WEEK_AND_PARK_VALUE_TIP = 2482,
|
||||
|
||||
STR_COMPLETED_BY_WITH_COMPANY_VALUE = 2794,
|
||||
|
||||
STR_SHOW_GUESTS_ON_MAP_TIP = 2803,
|
||||
STR_SHOW_MAP_TIP = 2805,
|
||||
|
||||
STR_TUTORIAL = 2856,
|
||||
STR_PRESS_KEY_OR_MOUSE_BUTTON_FOR_CONTROL = 2857,
|
||||
|
||||
STR_LICENCE_AGREEMENT_NOTICE_1 = 2969,
|
||||
STR_LICENCE_AGREEMENT_NOTICE_2 = 2970,
|
||||
|
||||
STR_BEGINNER_PARKS = 3064,
|
||||
STR_CHALLENGING_PARKS = STR_BEGINNER_PARKS + 1,
|
||||
STR_EXPERT_PARKS = STR_BEGINNER_PARKS + 2,
|
||||
STR_REAL_PARKS = STR_BEGINNER_PARKS + 3,
|
||||
STR_OTHER_PARKS = STR_BEGINNER_PARKS + 4,
|
||||
|
||||
STR_SCROLL_LEFT_TIP = 3145,
|
||||
STR_SCROLL_RIGHT_TIP = STR_SCROLL_LEFT_TIP + 1,
|
||||
STR_SCROLL_LEFT_FAST_TIP = STR_SCROLL_LEFT_TIP + 2,
|
||||
STR_SCROLL_RIGHT_FAST_TIP = STR_SCROLL_LEFT_TIP + 3,
|
||||
STR_SCROLL_LEFT_RIGHT_TIP = STR_SCROLL_LEFT_TIP + 4,
|
||||
STR_SCROLL_UP_TIP = STR_SCROLL_LEFT_TIP + 5,
|
||||
STR_SCROLL_DOWN_TIP = STR_SCROLL_LEFT_TIP + 6,
|
||||
STR_SCROLL_UP_FAST_TIP = STR_SCROLL_LEFT_TIP + 7,
|
||||
STR_SCROLL_DOWN_FAST_TIP = STR_SCROLL_LEFT_TIP + 8,
|
||||
STR_SCROLL_UP_DOWN_TIP = STR_SCROLL_LEFT_TIP + 9,
|
||||
|
||||
|
||||
STR_LIST = 3159,
|
||||
|
||||
STR_OBJECTIVE = 3322,
|
||||
|
||||
STR_GAME_TOOLS = 3341,
|
||||
STR_SCENARIO_EDITOR = 3342,
|
||||
STR_CONVERT_SAVED_GAME_TO_SCENARIO = 3343,
|
||||
STR_ROLLER_COASTER_DESIGNER = 3344,
|
||||
STR_TRACK_DESIGNS_MANAGER = 3345,
|
||||
|
||||
STR_TUTORIAL_BEGINNERS = 3385,
|
||||
STR_TUTORIAL_CUSTOM_RIDES = 3386,
|
||||
STR_TUTORIAL_ROLLER_COASTER = 3387,
|
||||
|
||||
STR_CLEAR_SCENERY_TIP = 3437,
|
||||
|
||||
STR_PAGE_1 = 3440,
|
||||
STR_PAGE_2 = STR_PAGE_1 + 1,
|
||||
STR_PAGE_3 = STR_PAGE_1 + 2,
|
||||
STR_PAGE_4 = STR_PAGE_1 + 3,
|
||||
STR_PAGE_5 = STR_PAGE_1 + 4,
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue