mirror of https://github.com/OpenRCT2/OpenRCT2.git
59 lines
1.7 KiB
C
59 lines
1.7 KiB
C
/*****************************************************************************
|
|
* 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 "sprite.h"
|
|
#include "vehicle.h"
|
|
|
|
static void vehicle_update(rct_vehicle *vehicle);
|
|
|
|
/**
|
|
*
|
|
* rct2: 0x006D4204
|
|
*/
|
|
void vehicle_update_all()
|
|
{
|
|
uint16 sprite_index;
|
|
rct_vehicle *vehicle;
|
|
|
|
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2)
|
|
return;
|
|
|
|
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 4) && RCT2_GLOBAL(0x0141F570, uint8) != 6)
|
|
return;
|
|
|
|
|
|
sprite_index = RCT2_GLOBAL(RCT2_ADDRESS_SPRITES_START_VEHICLE, uint16);
|
|
while (sprite_index != SPRITE_INDEX_NULL) {
|
|
vehicle = &(g_sprite_list[sprite_index].vehicle);
|
|
sprite_index = vehicle->next;
|
|
|
|
vehicle_update(vehicle);
|
|
}
|
|
}
|
|
|
|
/**
|
|
*
|
|
* rct2: 0x006D77F2
|
|
*/
|
|
static void vehicle_update(rct_vehicle *vehicle)
|
|
{
|
|
RCT2_CALLPROC_X(0x006D77F2, 0, 0, 0, 0, (int)vehicle, 0, 0);
|
|
} |