1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

implement sub_6CC3FB

This commit is contained in:
IntelOrca
2014-11-04 21:39:03 +00:00
parent 39ad49bac9
commit 508ed131f7
9 changed files with 111 additions and 3 deletions

View File

@@ -124,6 +124,7 @@
<ClCompile Include="..\src\windows\publisher_credits.c" />
<ClCompile Include="..\src\windows\research.c" />
<ClCompile Include="..\src\windows\ride.c" />
<ClCompile Include="..\src\windows\ride_construction.c" />
<ClCompile Include="..\src\windows\ride_list.c" />
<ClCompile Include="..\src\windows\save_prompt.c" />
<ClCompile Include="..\src\windows\scenery.c" />

View File

@@ -380,7 +380,6 @@
<ClCompile Include="..\lib\lodepng\lodepng.c" />
<ClCompile Include="..\lib\lodepng\lodepng.c" />
<ClCompile Include="..\lib\lodepng\lodepng.c" />
<ClCompile Include="..\lib\lodepng\lodepng.c" />
<ClCompile Include="..\src\drawing\rain.c">
<Filter>Source\Drawing</Filter>
</ClCompile>
@@ -437,6 +436,10 @@
<ClCompile Include="..\src\ride\station.c">
<Filter>Source\Ride</Filter>
</ClCompile>
<ClCompile Include="..\lib\libspeex\resample.c;..\lib\lodepng\lodepng.c" />
<ClCompile Include="..\src\windows\ride_construction.c">
<Filter>Source\Windows</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\management\award.h">

View File

@@ -504,6 +504,7 @@ rct_window *window_ride_main_open(int rideIndex);
void window_ride_demolish_prompt_open(int rideIndex);
void window_ride_construct(rct_window *w);
void window_ride_list_open();
rct_window * window_construction_open();
void window_track_place_open();
void window_new_ride_open();
void window_banner_open(rct_windownumber number);

View File

@@ -489,6 +489,7 @@ enum {
STR_HEADING_TO_RIDE_FOR_INSPECTION = 1793,
STR_FIXING_RIDE = 1794,
STR_ANSWERING_RADIO_CALL = 1795,
STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING = 1796,
STR_SAFETY_CUT_OUT = 1800,
STR_RESTRAINTS_STUCK_CLOSED = 1801,

View File

@@ -22,6 +22,7 @@
#include "../addresses.h"
#include "../audio/audio.h"
#include "../game.h"
#include "../input.h"
#include "../interface/window.h"
#include "../localisation/date.h"
#include "../localisation/localisation.h"
@@ -30,6 +31,7 @@
#include "../peep/staff.h"
#include "../scenario.h"
#include "../util/util.h"
#include "../windows/error.h"
#include "../world/map.h"
#include "../world/sprite.h"
#include "ride.h"
@@ -499,6 +501,72 @@ int ride_try_construct(rct_map_element *trackMapElement)
return 1;
}
/**
*
* rct2: 0x006CC3FB
*/
void sub_6CC3FB(int rideIndex)
{
rct_ride *ride;
rct_window *w;
tool_cancel();
ride = GET_RIDE(rideIndex);
if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) {
RCT2_GLOBAL(0x013CE952 + 6, uint16) = ride->name;
RCT2_GLOBAL(0x013CE952 + 8, uint32) = ride->name_arguments;
window_error_open(STR_CANT_START_CONSTRUCTION_ON, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING);
return;
}
if (ride->status != RIDE_STATUS_CLOSED) {
RCT2_GLOBAL(0x013CE952 + 6, uint16) = ride->name;
RCT2_GLOBAL(0x013CE952 + 8, uint32) = ride->name_arguments;
window_error_open(STR_CANT_START_CONSTRUCTION_ON, STR_MUST_BE_CLOSED_FIRST);
return;
}
RCT2_CALLPROC_X(0x006DD4AC, 0, 0, 0, rideIndex, 0, 0, 0);
RCT2_CALLPROC_X(0x006664DF, 0, 0, 0, rideIndex, 0, 0, 0);
w = window_find_by_class(WC_RIDE_CONSTRUCTION);
if (w == NULL || w->number != rideIndex) {
window_close_construction_windows();
RCT2_GLOBAL(0x00F440A7, uint8) = rideIndex;
w = window_construction_open(rideIndex);
} else {
RCT2_CALLPROC_X(0x006C9627, 0, 0, 0, 0, 0, 0, 0);
RCT2_GLOBAL(0x00F440A7, uint8) = rideIndex;
}
tool_set(w, 23, 12);
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) |= INPUT_FLAG_6;
ride = GET_RIDE(RCT2_GLOBAL(0x00F440A7, uint8));
RCT2_GLOBAL(0x00F440A0, uint16) = RCT2_ADDRESS(0x0097CC68, uint8)[ride->type * 2] | 0x100;
RCT2_GLOBAL(0x00F440B2, uint8) = 0;
RCT2_GLOBAL(0x00F440B3, uint8) = 0;
RCT2_GLOBAL(0x00F440B4, uint8) = 0;
RCT2_GLOBAL(0x00F440B5, uint8) = 0;
if (RCT2_GLOBAL(0x0097D4F2 + (ride->type * 8), uint16) & 0x8000)
RCT2_GLOBAL(0x00F440B5, uint8) |= 2;
RCT2_GLOBAL(0x00F440B6, uint8) = 0;
RCT2_GLOBAL(0x00F440B7, uint8) = 0;
RCT2_GLOBAL(0x00F440AE, uint8) = 0;
RCT2_GLOBAL(0x00F440A6, uint8) = 4;
RCT2_GLOBAL(0x00F440B0, uint8) = 0;
RCT2_GLOBAL(0x00F440B1, uint8) = 0;
RCT2_GLOBAL(0x00F44159, uint8) = 0;
RCT2_GLOBAL(0x00F4415C, uint8) = 0;
RCT2_CALLPROC_X(0x006C84CE, 0, 0, 0, 0, 0, ride->type, 0);
// return 0;
}
#pragma endregion
#pragma region Update functions

View File

@@ -624,5 +624,6 @@ void ride_measurements_update();
rct_ride_measurement *ride_get_measurement(int rideIndex, rct_string_id *message);
void ride_breakdown_add_news_item(int rideIndex);
rct_peep *ride_find_closest_mechanic(rct_ride *ride, int forInspection);
void sub_6CC3FB(int rideIndex);
#endif

View File

@@ -1382,7 +1382,7 @@ void window_ride_construct(rct_window *w)
trackMapElement = sub_6CAF80(rideIndex, &trackX, &trackY);
if (trackMapElement == (rct_map_element*)-1) {
RCT2_CALLPROC_X(0x006CC3FB, 0, 0, 0, rideIndex, 0, 0, 0);
sub_6CC3FB(rideIndex);
} else {
trackMapElement = ride_find_track_gap(trackMapElement, &trackX, &trackY);

View File

@@ -0,0 +1,33 @@
/*****************************************************************************
* 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 "../interface/window.h"
/**
*
* rct2: 0x006CB481
*/
rct_window *window_construction_open()
{
int eax, ebx, ecx, edx, esi, edi, ebp;
RCT2_CALLFUNC_X(0x006CB481, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
return (rct_window*)esi;
}

View File

@@ -607,7 +607,7 @@ static void window_track_place_tooldown()
window_ride_main_open(rideIndex);
window_close(w);
} else {
RCT2_CALLPROC_X(0x006CC3FB, 0, 0, 0, rideIndex, 0, 0, 0);
sub_6CC3FB(rideIndex);
w = window_find_by_class(WC_RIDE_CONSTRUCTION);
window_event_helper(w, 29, WE_MOUSE_UP);
}