doom: fix alignment issues for arm

This commit is contained in:
cinap_lenrek 2014-09-04 23:02:37 +02:00
parent 3a322e9f32
commit 460f482ad0
5 changed files with 11 additions and 15 deletions

View file

@ -211,7 +211,6 @@ typedef struct
short options; short options;
} mapthing_t; } mapthing_t;
#pragma pack off #pragma pack off

View file

@ -184,7 +184,7 @@ wipe_doMelt
width/=2; width/=2;
while (ticks--) while (ticks-- >= 0)
{ {
for (i=0;i<width;i++) for (i=0;i<width;i++)
{ {

View file

@ -396,7 +396,7 @@ P_NightmareRespawn (mobj_t* mobj)
// inherit attributes from deceased one // inherit attributes from deceased one
mo = P_SpawnMobj (x,y,z, mobj->type); mo = P_SpawnMobj (x,y,z, mobj->type);
mo->spawnpoint = mobj->spawnpoint; memcpy (&mo->spawnpoint, mthing, sizeof(*mthing));
mo->angle = ANG45 * (mthing->angle/45); mo->angle = ANG45 * (mthing->angle/45);
if (mthing->options & MTF_AMBUSH) if (mthing->options & MTF_AMBUSH)
@ -552,7 +552,7 @@ void P_RemoveMobj (mobj_t* mobj)
&& (mobj->type != MT_INV) && (mobj->type != MT_INV)
&& (mobj->type != MT_INS)) && (mobj->type != MT_INS))
{ {
itemrespawnque[iquehead] = mobj->spawnpoint; memcpy (&itemrespawnque[iquehead], &mobj->spawnpoint, sizeof(mobj->spawnpoint));
itemrespawntime[iquehead] = leveltime; itemrespawntime[iquehead] = leveltime;
iquehead = (iquehead+1)&(ITEMQUESIZE-1); iquehead = (iquehead+1)&(ITEMQUESIZE-1);
@ -625,7 +625,7 @@ void P_RespawnSpecials (void)
z = ONFLOORZ; z = ONFLOORZ;
mo = P_SpawnMobj (x,y,z, i); mo = P_SpawnMobj (x,y,z, i);
mo->spawnpoint = *mthing; memcpy (&mo->spawnpoint, mthing, sizeof(*mthing));
mo->angle = ANG45 * (mthing->angle/45); mo->angle = ANG45 * (mthing->angle/45);
// pull it from the que // pull it from the que
@ -728,10 +728,10 @@ void P_SpawnMapThing (mapthing_t* mthing)
} }
// check for players specially // check for players specially
if (mthing->type <= 4) if (mthing->type <= MAXPLAYERS)
{ {
// save spots for respawning in network games // save spots for respawning in network games
playerstarts[mthing->type-1] = *mthing; memcpy (&playerstarts[mthing->type-1], mthing, sizeof(*mthing));
if (!deathmatch) if (!deathmatch)
P_SpawnPlayer (mthing); P_SpawnPlayer (mthing);
@ -784,7 +784,7 @@ void P_SpawnMapThing (mapthing_t* mthing)
z = ONFLOORZ; z = ONFLOORZ;
mobj = P_SpawnMobj (x,y,z, i); mobj = P_SpawnMobj (x,y,z, i);
mobj->spawnpoint = *mthing; memcpy (&mobj->spawnpoint, mthing, sizeof(*mthing));
if (mobj->tics > 0) if (mobj->tics > 0)
mobj->tics = 1 + (P_Random () % mobj->tics); mobj->tics = 1 + (P_Random () % mobj->tics);

View file

@ -91,6 +91,7 @@ typedef struct
mappatch_t patches[1]; mappatch_t patches[1];
} maptexture_t; } maptexture_t;
#pragma pack off
/* A single patch from a texture definition, /* A single patch from a texture definition,
** basically a rectangular area within ** basically a rectangular area within
@ -126,10 +127,6 @@ typedef struct
texpatch_t patches[1]; texpatch_t patches[1];
} texture_t; } texture_t;
#pragma pack off
int firstflat; int firstflat;
int lastflat; int lastflat;
int numflats; int numflats;

View file

@ -173,12 +173,12 @@ void R_InitSpriteDefs (char** namelist)
/* char** check; */ /* char** check; */
int i; int i;
int l; int l;
int intname;
int frame; int frame;
int rotation; int rotation;
int start; int start;
int end; int end;
int patched; int patched;
char* name;
/* BUG /* BUG
This would work if the namelist was NULL terminated which it is not. This would work if the namelist was NULL terminated which it is not.
@ -213,13 +213,13 @@ numsprites = NUMSPRITES;
memset (sprtemp,-1, sizeof(sprtemp)); memset (sprtemp,-1, sizeof(sprtemp));
maxframe = -1; maxframe = -1;
intname = *(int *)namelist[i]; name = namelist[i];
// scan the lumps, // scan the lumps,
// filling in the frames for whatever is found // filling in the frames for whatever is found
for (l=start+1 ; l<end ; l++) for (l=start+1 ; l<end ; l++)
{ {
if (*(int *)lumpinfo[l].name == intname) if (memcmp(lumpinfo[l].name, name, 4) == 0)
{ {
frame = lumpinfo[l].name[4] - 'A'; frame = lumpinfo[l].name[4] - 'A';
rotation = lumpinfo[l].name[5] - '0'; rotation = lumpinfo[l].name[5] - '0';