1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Unify rct1_award and rct2_award

This commit is contained in:
Ted John
2017-01-16 18:41:16 +00:00
parent 5efd23dbe5
commit f6dee8c58d
8 changed files with 45 additions and 27 deletions

View File

@@ -411,6 +411,7 @@
<ClInclude Include="audio\AudioMixer.h" />
<ClInclude Include="audio\AudioSource.h" />
<ClInclude Include="FileClassifier.h" />
<ClInclude Include="rct12.h" />
<ClInclude Include="rct2\addresses.h" />
<ClInclude Include="audio\audio.h" />
<ClInclude Include="cheats.h" />

View File

@@ -20,6 +20,7 @@
#include "management/award.h"
#include "management/news_item.h"
#include "management/research.h"
#include "rct12.h"
#include "rct2.h"
#include "ride/ride.h"
#include "world/banner.h"
@@ -28,7 +29,6 @@
#define RCT1_MAX_MAP_ELEMENTS 0xC000
#define RCT1_MAX_SPRITES 5000
#define RCT1_MAX_AWARDS 4
#pragma pack(push, 1)
typedef struct rct1_entrance {
@@ -426,14 +426,6 @@ typedef struct rct1_research_item {
} rct1_research_item;
assert_struct_size(rct1_research_item, 5);
#pragma pack(push, 1)
typedef struct rct1_award {
uint16 time;
uint16 type;
} rct1_award;
assert_struct_size(rct1_award, 4);
#pragma pack(pop)
/**
* RCT1,AA,LL scenario / saved game structure.
* size: 0x1F850C
@@ -529,7 +521,7 @@ typedef struct rct1_s4 {
money32 admission_total_income;
money32 company_value;
uint8 thought_timer[16];
rct1_award awards[RCT1_MAX_AWARDS];
rct12_award awards[RCT12_MAX_AWARDS];
money16 land_price;
money16 construction_rights_price;
uint16 unk_199BCC;

View File

@@ -1439,9 +1439,9 @@ private:
// Awards
award_reset();
for (sint32 i = 0; i < RCT1_MAX_AWARDS; i++)
for (sint32 i = 0; i < RCT12_MAX_AWARDS; i++)
{
rct1_award * src = &_s4.awards[i];
rct12_award * src = &_s4.awards[i];
Award * dst = &gCurrentAwards[i];
dst->Time = src->time;
dst->Type = src->type;

34
src/openrct2/rct12.h Normal file
View File

@@ -0,0 +1,34 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/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.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#pragma once
// Structures shared between both RCT1 and RCT2.
#include "common.h"
#define RCT12_MAX_AWARDS 4
#pragma pack(push, 1)
typedef struct rct12_award
{
uint16 time;
uint16 type;
} rct12_award;
assert_struct_size(rct12_award, 4);
#pragma pack(pop)

View File

@@ -29,14 +29,6 @@ typedef struct rct2_install_info {
uint32 activeExpansionPacks; //0xB10
} rct2_install_info;
#pragma pack(push, 1)
typedef struct rct2_award {
uint16 time;
uint16 type;
} rct2_award;
assert_struct_size(rct2_award, 4);
#pragma pack(pop)
enum {
// Although this is labeled a flag it actually means when
// zero the screen is in playing mode.

View File

@@ -351,10 +351,10 @@ void S6Exporter::Export()
memcpy(_s6.peep_warning_throttle, gPeepWarningThrottle, sizeof(_s6.peep_warning_throttle));
// Awards
for (int i = 0; i < RCT2_MAX_AWARDS; i++)
for (sint32 i = 0; i < RCT12_MAX_AWARDS; i++)
{
Award * src = &gCurrentAwards[i];
rct2_award * dst = &_s6.awards[i];
rct12_award * dst = &_s6.awards[i];
dst->time = src->Time;
dst->type = src->Type;
}

View File

@@ -268,9 +268,9 @@ void S6Importer::Import()
// Awards
award_reset();
for (int i = 0; i < RCT2_MAX_AWARDS; i++)
for (sint32 i = 0; i < RCT12_MAX_AWARDS; i++)
{
rct2_award * src = &_s6.awards[i];
rct12_award * src = &_s6.awards[i];
Award * dst = &gCurrentAwards[i];
dst->Time = src->time;
dst->Type = src->type;

View File

@@ -23,6 +23,7 @@
#include "../management/research.h"
#include "../object.h"
#include "../platform/platform.h"
#include "../rct12.h"
#include "../rct2.h"
#include "../rct2/addresses.h"
#include "../ride/ride.h"
@@ -32,8 +33,6 @@
#include "../world/map_animation.h"
#include "../world/sprite.h"
#define RCT2_MAX_AWARDS 4
#pragma pack(push, 1)
/**
* SV6/SC6 header chunk
@@ -247,7 +246,7 @@ typedef struct rct_s6_data {
money32 income_from_admissions;
money32 company_value;
uint8 peep_warning_throttle[16];
rct2_award awards[RCT2_MAX_AWARDS];
rct12_award awards[RCT12_MAX_AWARDS];
money16 land_price;
money16 construction_rights_price;
uint16 word_01358774;