- SW: SpawnActor with float vector

This commit is contained in:
Christoph Oelckers 2022-08-17 00:25:03 +02:00
parent 8f4c418a1b
commit 0c8ed75d54
2 changed files with 8 additions and 3 deletions

View file

@ -871,7 +871,7 @@ void SpawnUser(DSWActor* actor, short id, STATE* state)
actor->user.hi_sectp = actor->sector();
}
DSWActor* SpawnActor(int stat, int id, STATE* state, sectortype* sect, int x, int y, int z, int init_ang, int vel)
DSWActor* SpawnActor(int stat, int id, STATE* state, sectortype* sect, const DVector3& pos, int init_ang, int vel)
{
if (sect == nullptr)
return nullptr;
@ -880,7 +880,7 @@ DSWActor* SpawnActor(int stat, int id, STATE* state, sectortype* sect, int x, in
auto spawnedActor = insertActor(sect, stat);
spawnedActor->set_int_pos({ x, y, z });
spawnedActor->spr.pos = pos;
SpawnUser(spawnedActor, id, state);

View file

@ -31,7 +31,12 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
void KillActor(DSWActor* actor);
DSWActor* SpawnActor(int stat, int id, STATE* state, sectortype* sect, int x, int y, int z, int ang, int vel);
DSWActor* SpawnActor(int stat, int id, STATE* state, sectortype* sect, const DVector3& pos, int ang, int vel);
inline DSWActor* SpawnActor(int stat, int id, STATE* state, sectortype* sect, int x, int y, int z, int ang, int vel)
{
auto vec= DVector3(x * inttoworld, y * inttoworld, z * zinttoworld);
return SpawnActor(stat, id, state, sect, vec, ang, vel);
}
void SpriteSetup(void);
int move_actor(DSWActor* actor, int xchange, int ychange, int zchange);