re3-wiiu/src/control/TrafficLights.cpp

23 lines
714 B
C++
Raw Normal View History

2019-06-30 21:06:55 +02:00
#include "common.h"
#include "patcher.h"
#include "TrafficLights.h"
2019-08-08 02:21:38 +02:00
#include "Timer.h"
2019-08-11 19:11:54 +02:00
#include "Vehicle.h"
2019-06-30 21:06:55 +02:00
WRAPPER void CTrafficLights::DisplayActualLight(CEntity *ent) { EAXJMP(0x455800); }
2019-10-19 00:23:40 +02:00
WRAPPER void CTrafficLights::ScanForLightsOnMap(void) { EAXJMP(0x454F40); }
2019-08-11 19:11:54 +02:00
WRAPPER bool CTrafficLights::ShouldCarStopForLight(CVehicle*, bool) { EAXJMP(0x455350); }
WRAPPER bool CTrafficLights::ShouldCarStopForBridge(CVehicle*) { EAXJMP(0x456460); }
2019-08-08 02:21:38 +02:00
uint8
CTrafficLights::LightForPeds(void)
{
uint32 period = CTimer::GetTimeInMilliseconds() & 0x3FFF; // Equals to % 16384
if (period >= 15384)
return PED_LIGHTS_WALK_BLINK;
else if (period >= 12000)
return PED_LIGHTS_WALK;
else
return PED_LIGHTS_DONT_WALK;
}