1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-15 15:02:34 +02:00

Implement and declare more opcodes

This commit is contained in:
Daniel Evans 2014-12-16 03:30:51 +00:00
parent 7e4dea5139
commit 2709e7d252
3 changed files with 44 additions and 4 deletions

View File

@ -129,6 +129,11 @@ VM_OPCODE_DEF( 0x00C0 )
m->getWorld()->state.minute = p->at(1).integer;
}
VM_CONDOPCODE_DEF( 0x00DB )
{
return false;
}
VM_CONDOPCODE_DEF( 0x00DE )
{
auto vdata = m->getWorld()->findObjectType<VehicleData>(p->at(1).integer);
@ -360,6 +365,11 @@ VM_OPCODE_DEF( 0x01BD )
*p->at(0).globalInteger = m->getWorld()->gameTime * 1000;
}
VM_CONDOPCODE_DEF( 0x01C1 )
{
return false;
}
VM_OPCODE_DEF( 0x01C7 )
{
auto inst = (InstanceObject*)(*p->at(0).handle);
@ -386,6 +396,11 @@ VM_OPCODE_DEF( 0x01F0 )
m->getWorld()->state.maxWantedLevel = p->at(0).integer;
}
VM_CONDOPCODE_DEF( 0x01F4 )
{
return false;
}
// This does nothing for us.
VM_OPCODE_DEF( 0x01F5 )
{
@ -756,6 +771,11 @@ VM_CONDOPCODE_DEF( 0x03D0 )
return true;
}
VM_CONDOPCODE_DEF( 0x03D2 )
{
return true;
}
VM_OPCODE_DEF( 0x03E1 )
{
*p->at(0).globalInteger = m->getWorld()->state.numHiddenPackagesDiscovered;
@ -828,12 +848,15 @@ Opcodes3::Opcodes3()
VM_OPCODE_DEC( 0x00C0, 2, "Set Time Of Day" );
VM_OPCODE_DEC_U( 0x00DA, 2, "Store Player Car" );
VM_CONDOPCODE_DEC( 0x00DB, 2, "Is Character in Vehicle" );
VM_CONDOPCODE_DEC( 0x00DE, 2, "Is Player In Model" );
VM_CONDOPCODE_DEC( 0x00E0, 1, "Is Player In Any Vehicle" );
VM_CONDOPCODE_DEC( 0x00E1, 2, "Is Button Pressed" );
VM_OPCODE_DEC_U( 0x0E4, 6, "Locate Player on foot 2D" );
VM_OPCODE_DEC_U( 0x00F5, 8, "Locate Player In Sphere" );
VM_CONDOPCODE_DEC( 0x0100, 8, "Is Character near point in car" );
@ -860,6 +883,7 @@ Opcodes3::Opcodes3()
VM_OPCODE_DEC( 0x0152, 17, "Set zone car info" );
VM_OPCODE_DEC_U( 0x0158, 3, "Camera Follow Vehicle" );
VM_OPCODE_DEC_U( 0x0159, 3, "Camera Follow Character" );
VM_OPCODE_DEC_U( 0x015A, 0, "Reset Camera" );
@ -876,6 +900,7 @@ Opcodes3::Opcodes3()
VM_CONDOPCODE_DEC( 0x016B, 0, "Is Screen Fading" );
VM_OPCODE_DEC_U( 0x016C, 4, "Add Hospital Restart" );
VM_OPCODE_DEC_U( 0x016D, 4, "Add Police Restart" );
VM_OPCODE_DEC_U( 0x016E, 4, "Override Next Restart" );
VM_OPCODE_DEC( 0x0171, 2, "Set Player Heading" );
@ -889,6 +914,8 @@ Opcodes3::Opcodes3()
VM_OPCODE_DEC_U( 0x0181, 2, "Link Character Mission Flag" );
VM_OPCODE_DEC_U( 0x0182, 2, "Unknown Character Opcode" );
VM_OPCODE_DEC_U( 0x018E, 1, "Remove Sound" );
VM_CONDOPCODE_DEC( 0x019C, 8, "Is Player in Area on Foot" );
VM_OPCODE_DEC_U( 0x018B, 2, "Change Blip Display Mode" );
@ -910,9 +937,12 @@ Opcodes3::Opcodes3()
VM_OPCODE_DEC_U( 0x01EB, 1, "Set Traffic Density Multiplier" );
VM_OPCODE_DEC_U( 0x01ED, 1, "Clear Character Threat Search" );
VM_OPCODE_DEC_U( 0x01D4, 2, "Character Enter Vehicle as Passenger" );
VM_OPCODE_DEC( 0x01F0, 1, "Set Max Wanted Level" );
VM_CONDOPCODE_DEC( 0x01F4, 1, "Is Car Flipped" );
VM_OPCODE_DEC( 0x01F5, 2, "Get Player Character" );
VM_OPCODE_DEC_U( 0x01F7, 2, "Set Cops Ignore Player" );
@ -920,6 +950,8 @@ Opcodes3::Opcodes3()
VM_OPCODE_DEC_U( 0x01F9, 9, "Start Kill Frenzy" );
VM_OPCODE_DEC_U( 0x01C0, 2, "Store Wanted Level" );
VM_CONDOPCODE_DEC( 0x01C1, 1, "Is Vehicle Stopped" );
VM_CONDOPCODE_DEC( 0x0204, 5, "Is Char near Car in Car 2D" );
@ -938,6 +970,8 @@ Opcodes3::Opcodes3()
VM_OPCODE_DEC( 0x022B, 6, "Disable ped paths" );
VM_OPCODE_DEC_U( 0x022D, 2, "Set Character Always Face Player" );
VM_OPCODE_DEC_U( 0x022F, 1, "Stop Character Looking" );
VM_OPCODE_DEC_U( 0x0236, 2, "Set Gang Car" );
VM_OPCODE_DEC_U( 0x0237, 3, "Set Gang Weapons" );
@ -967,6 +1001,7 @@ Opcodes3::Opcodes3()
VM_OPCODE_DEC( 0x029B, 5, "Create Object no offset" );
VM_OPCODE_DEC_U( 0x02A2, 5, "Add Particle" );
VM_OPCODE_DEC_U( 0x02A3, 1, "Set Widescreen" );
VM_OPCODE_DEC_U( 0x02A7, 5, "Add Radar Contact Blip" );
@ -1062,7 +1097,12 @@ Opcodes3::Opcodes3()
VM_OPCODE_DEC_U( 0x03CF, 1, "Load Audio" );
VM_CONDOPCODE_DEC( 0x03D0, 0, "Audio Loaded" );
VM_CONDOPCODE_DEC( 0x03D0, 0, "Is Audio Loaded" );
VM_OPCODE_DEC_U( 0x03D1, 0, "Play Mission Audio" );
VM_CONDOPCODE_DEC( 0x03D2, 0, "Is Mission Audio Finished" );
VM_OPCODE_DEC_U( 0x03D5, 1, "Clear This Print" );
VM_OPCODE_DEC_U( 0x03D6, 1, "Clear This Big Print" );
VM_OPCODE_DEC_U( 0x03DA, 1, "Set Garage Camera Follows Player" );

View File

@ -11,7 +11,7 @@
RWGame::RWGame(const std::string& gamepath)
: engine(nullptr), inFocus(true),
accum(0.f), timescale(10.f)
accum(0.f), timescale(1.f)
{
if(! font.loadFromFile(gamepath + "/DejaVuSansMono.ttf")) {
std::cerr << "Failed to load font" << std::endl;

View File

@ -15,7 +15,7 @@ bool hitWorldRay(const glm::vec3& start, const glm::vec3& direction,
glm::vec3& hit, glm::vec3& normal, GameObject** object = nullptr);
#define ENV_GAME_PATH_NAME ("OPENRW_GAME_PATH")
#define GAME_TIMESTEP (1.f/10.f)
#define GAME_TIMESTEP (1.f/30.f)
#define GAME_WINDOW_WIDTH 800
#define GAME_WINDOW_HEIGHT 600