- use 4 byte entries for the script.

We no longer store pointers in here.
This commit is contained in:
Christoph Oelckers 2020-05-15 11:36:46 +02:00
parent cb1824ca25
commit 693b15a556
6 changed files with 7 additions and 10 deletions

View file

@ -4889,11 +4889,10 @@ void alterang(int a, int g_i, int g_p)
{
short aang, angdif, goalang, j;
int ticselapsed;
intptr_t* moveptr;
int* g_t = hittype[g_i].t_data;
auto* g_sp = &sprite[g_i];
moveptr = &ScriptCode[g_t[1]];
auto moveptr = &ScriptCode[g_t[1]];
ticselapsed = (g_t[0]) & 31;

View file

@ -3963,7 +3963,6 @@ void move_d(int g_i, int g_p, int g_x)
auto g_sp = &sprite[g_i];
auto g_t = hittype[g_i].t_data;
int l;
intptr_t* moveptr;
short a, goalang, angdif;
int daxvel;
@ -4030,7 +4029,7 @@ void move_d(int g_i, int g_p, int g_x)
return;
}
moveptr = &ScriptCode[g_t[1]];
auto moveptr = &ScriptCode[g_t[1]];
if (a & geth) g_sp->xvel += (*moveptr - g_sp->xvel) >> 1;
if (a & getv) g_sp->zvel += ((*(moveptr + 1) << 4) - g_sp->zvel) >> 1;

View file

@ -4057,7 +4057,6 @@ void move_r(int g_i, int g_p, int g_x)
auto g_sp = &sprite[g_i];
auto g_t = hittype[g_i].t_data;
int l;
intptr_t *moveptr;
short a, goalang, angdif;
int daxvel;
@ -4203,7 +4202,7 @@ void move_r(int g_i, int g_p, int g_x)
return;
}
moveptr = &ScriptCode[g_t[1]];
auto moveptr = &ScriptCode[g_t[1]];
if (a & geth) g_sp->xvel += (*moveptr - g_sp->xvel) >> 1;
if (a & getv) g_sp->zvel += ((*(moveptr + 1) << 4) - g_sp->zvel) >> 1;

View file

@ -61,7 +61,7 @@ int checking_ifelse;
extern char tempbuf[];
extern int* labelcode;
TArray<intptr_t> ScriptCode;
TArray<int> ScriptCode;
//---------------------------------------------------------------------------
//

View file

@ -46,7 +46,7 @@ static int g_x;
static int* g_t;
static uint8_t killit_flag;
static spritetype* g_sp;
static intptr_t* insptr;
static int* insptr;
int parse(void);
int furthestcanseepoint(int i, spritetype* ts, int* dax, int* day);
@ -1620,7 +1620,7 @@ void OnEvent(int iEventID, int p, int i, int x)
int* og_t;
spritetype* og_sp;
uint8_t okillit_flag;
intptr_t* oinsptr;
int* oinsptr;
char done;

View file

@ -77,7 +77,7 @@ enum
EVENT_MAXEVENT = EVENT_NUMEVENTS - 1
};
extern TArray<intptr_t> ScriptCode;
extern TArray<int> ScriptCode;
void OnEvent(int id, int pnum = -1, int snum = -1, int dist = -1);