- clearcamera and ssp.

This commit is contained in:
Christoph Oelckers 2020-10-21 19:38:53 +02:00
parent be21cb0602
commit 46d90f5d49
8 changed files with 21 additions and 19 deletions

View File

@ -210,12 +210,11 @@ void clearcamera(player_struct* ps)
updatesector(ps->posx, ps->posy, &ps->cursectnum); updatesector(ps->posx, ps->posy, &ps->cursectnum);
setpal(ps); setpal(ps);
StatIterator it(STAT_ACTOR); DukeStatIterator it(STAT_ACTOR);
int k; while (auto k = it.Next())
while ((k = it.NextIndex()) >= 0)
{ {
if (sprite[k].picnum == TILE_CAMERA1) if (k->s.picnum == TILE_CAMERA1)
sprite[k].yvel = 0; k->s.yvel = 0;
} }
} }
@ -225,16 +224,13 @@ void clearcamera(player_struct* ps)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
int ssp(int i, unsigned int cliptype) //The set sprite function int ssp(DDukeActor* const actor, unsigned int cliptype) //The set sprite function
{ {
spritetype* s;
int movetype; int movetype;
s = &sprite[i]; movetype = fi.movesprite(actor->GetIndex(),
(actor->s.xvel * (sintable[(actor->s.ang + 512) & 2047])) >> 14,
movetype = fi.movesprite(i, (actor->s.xvel * (sintable[actor->s.ang & 2047])) >> 14, actor->s.zvel,
(s->xvel * (sintable[(s->ang + 512) & 2047])) >> 14,
(s->xvel * (sintable[s->ang & 2047])) >> 14, s->zvel,
cliptype); cliptype);
return (movetype == 0); return (movetype == 0);

View File

@ -142,11 +142,6 @@ inline DDukeActor* EGS(short whatsect, int s_x, int s_y, int s_z, short s_pn, si
return &hittype[EGS(whatsect, s_x, s_y, s_z, s_pn, s_s, s_xr, s_yr, s_a, s_ve, s_zv, Owner ? Owner->GetIndex() : -1, s_ss)]; return &hittype[EGS(whatsect, s_x, s_y, s_z, s_pn, s_s, s_xr, s_yr, s_a, s_ve, s_zv, Owner ? Owner->GetIndex() : -1, s_ss)];
} }
inline int ssp(DDukeActor* i, unsigned int cliptype) //The set sprite function
{
return ssp(i->GetIndex(), cliptype);
}
inline int ActorToScriptIndex(DDukeActor* a) inline int ActorToScriptIndex(DDukeActor* a)
{ {
if (!a) return -1; if (!a) return -1;
@ -213,4 +208,10 @@ inline void deletesprite(int num)
deletesprite(&hittype[num]); deletesprite(&hittype[num]);
} }
inline int ssp(int i, unsigned int cliptype) //The set sprite function
{
return ssp(&hittype[i], cliptype);
}
END_DUKE_NS END_DUKE_NS

View File

@ -100,7 +100,7 @@ void checkavailweapon(struct player_struct* p);
void deletesprite(DDukeActor* num); void deletesprite(DDukeActor* num);
void addammo(int weapon, struct player_struct* p, int amount); void addammo(int weapon, struct player_struct* p, int amount);
int ssp(int i, unsigned int cliptype); //The set sprite function int ssp(DDukeActor* i, unsigned int cliptype); //The set sprite function
void insertspriteq(int i); void insertspriteq(int i);
int wakeup(int sn, int pn); int wakeup(int sn, int pn);

View File

@ -37,6 +37,7 @@ source as it is released.
#include "global.h" #include "global.h"
#include "gamevar.h" #include "gamevar.h"
#include "names_d.h" #include "names_d.h"
#include "dukeactor.h"
BEGIN_DUKE_NS BEGIN_DUKE_NS

View File

@ -36,7 +36,8 @@ source as it is released.
#include "ns.h" #include "ns.h"
#include "global.h" #include "global.h"
#include "gamevar.h" #include "gamevar.h"
#include "names_d.h" #include "names_d.h"
#include "dukeactor.h"
BEGIN_DUKE_NS BEGIN_DUKE_NS

View File

@ -37,6 +37,7 @@ source as it is released.
#include "global.h" #include "global.h"
#include "sounds.h" #include "sounds.h"
#include "automap.h" #include "automap.h"
#include "dukeactor.h"
BEGIN_DUKE_NS BEGIN_DUKE_NS

View File

@ -36,6 +36,7 @@ source as it is released.
#include "global.h" #include "global.h"
#include "sounds.h" #include "sounds.h"
#include "names_d.h" #include "names_d.h"
#include "dukeactor.h"
BEGIN_DUKE_NS BEGIN_DUKE_NS

View File

@ -31,6 +31,7 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
#include "global.h" #include "global.h"
#include "sounds.h" #include "sounds.h"
#include "names_r.h" #include "names_r.h"
#include "dukeactor.h"
BEGIN_DUKE_NS BEGIN_DUKE_NS