From 25a048c62ff6649cad616564b82b8dc53dbf01a6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 7 Feb 2022 11:00:15 +0100 Subject: [PATCH] - fully floatified the crane data. --- source/games/duke/src/actors.cpp | 10 +++++----- source/games/duke/src/spawn.cpp | 11 +++++------ source/games/duke/src/types.h | 4 ++-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 62ffa7a54..1fd053cf3 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -640,8 +640,8 @@ void movecrane(DDukeActor *actor, int crane) case STAT_ZOMBIEACTOR: case STAT_STANDABLE: case STAT_PLAYER: - actor->spr.ang = getangle(cpt.pole.X - actor->int_pos().X, cpt.pole.Y - actor->int_pos().Y); - SetActor(a2, vec3_t( cpt.pole.X, cpt.pole.Y, a2->int_pos().Z )); + actor->spr.ang = getangle(cpt.pole - actor->spr.pos.XY()); + SetActor(a2, DVector3( cpt.pole.X, cpt.pole.Y, a2->spr.pos.Z )); actor->temp_data[0]++; return; } @@ -737,7 +737,7 @@ void movecrane(DDukeActor *actor, int crane) if ((sectp->floorz - actor->spr.pos.Z) > 32) actor->spr.picnum++; - if (actor->int_pos().Z < cpt.pos.Z) + if (actor->spr.pos.Z < cpt.pos.Z) { actor->temp_data[0]++; actor->spr.xvel = 0; @@ -749,9 +749,9 @@ void movecrane(DDukeActor *actor, int crane) { if (actor->spr.xvel < 192) actor->spr.xvel += 8; - actor->spr.ang = getangle(cpt.pos.X - actor->int_pos().X, cpt.pos.Y - actor->int_pos().Y); + actor->spr.ang = getangle(cpt.pos.XY() - actor->spr.pos.XY()); ssp(actor, CLIPMASK0); - if (((actor->int_pos().X - cpt.pos.X) * (actor->int_pos().X - cpt.pos.X) + (actor->int_pos().Y - cpt.pos.Y) * (actor->int_pos().Y - cpt.pos.Y)) < (128 * 128)) + if (((actor->spr.pos.X - cpt.pos.X) * (actor->spr.pos.X - cpt.pos.X) + (actor->spr.pos.Y - cpt.pos.Y) * (actor->spr.pos.Y - cpt.pos.Y)) < (8 * 8)) actor->temp_data[0]++; } diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 4fa8df41b..9694126ff 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -478,11 +478,11 @@ void initcrane(DDukeActor* actj, DDukeActor* act, int CRANEPOLE) act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_ONE_SIDE; act->spr.picnum += 2; - act->set_int_z(sect->int_ceilingz() + (48 << 8)); + act->spr.pos.Z = sect->ceilingz + 48; act->temp_data[4] = cranes.Reserve(1); auto& apt = cranes[act->temp_data[4]]; - apt.pos = act->int_pos(); + apt.pos = act->spr.pos; apt.poleactor = nullptr; DukeStatIterator it(STAT_DEFAULT); @@ -497,13 +497,12 @@ void initcrane(DDukeActor* actj, DDukeActor* act, int CRANEPOLE) actk->spr.xrepeat = 48; actk->spr.yrepeat = 128; - apt.pole.X = actk->int_pos().X; - apt.pole.Y = actk->int_pos().Y; + apt.pole = actk->spr.pos.XY(); - actk->set_int_pos(act->int_pos()); + actk->spr.pos = act->spr.pos; actk->spr.shade = act->spr.shade; - SetActor(actk, actk->int_pos()); + SetActor(actk, actk->spr.pos); break; } } diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 68080757e..464bfa796 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -197,8 +197,8 @@ struct player_orig struct CraneDef { - vec3_t pos; - vec2_t pole; + DVector3 pos; + DVector2 pole; TObjPtr poleactor; };