Skip to content

Commit

Permalink
Make all aligned structs used by cgame static so lcc doesn't mess the…
Browse files Browse the repository at this point in the history
…m up.
  • Loading branch information
Viech committed Dec 29, 2014
1 parent 04ef970 commit da5d90d
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/engine/qcommon/q_math.cpp
Expand Up @@ -3850,7 +3850,7 @@ void TransCombine( const transform_t *a, const transform_t *b,
void TransInverse( const transform_t *in, transform_t *out )
{
quat_t inverse;
transform_t tmp;
static transform_t tmp; // static for proper alignment in QVMs

TransInit( &tmp );
VectorNegate( in->trans, tmp.trans );
Expand Down
4 changes: 2 additions & 2 deletions src/gamelogic/cgame/cg_animmapobj.c
Expand Up @@ -44,7 +44,7 @@ CG_ModelDoor
*/
void CG_ModelDoor( centity_t *cent )
{
refEntity_t ent;
static refEntity_t ent; // static for proper alignment in QVMs
entityState_t *es;
animation_t anim;
lerpFrame_t *lf = &cent->lerpFrame;
Expand Down Expand Up @@ -132,7 +132,7 @@ CG_animMapObj
*/
void CG_AnimMapObj( centity_t *cent )
{
refEntity_t ent;
static refEntity_t ent; // static for proper alignment in QVMs
entityState_t *es;
float scale;
animation_t anim;
Expand Down
4 changes: 2 additions & 2 deletions src/gamelogic/cgame/cg_buildable.c
Expand Up @@ -2517,7 +2517,7 @@ void CG_Buildable( centity_t *cent )
// MD3 turret special treatment part 1. TODO: Remove.
if ( cg_buildables[ es->modelindex ].models[ 1 ] )
{
refEntity_t turretBarrel;
static refEntity_t turretBarrel; // static for proper alignment in QVMs
vec3_t flatAxis[ 3 ];

memset( &turretBarrel, 0, sizeof( turretBarrel ) );
Expand Down Expand Up @@ -2563,7 +2563,7 @@ void CG_Buildable( centity_t *cent )
// MD3 turret special treatment part 2. TODO: Remove.
if ( cg_buildables[ es->modelindex ].models[ 2 ] )
{
refEntity_t turretTop;
static refEntity_t turretTop; // static for proper alignment in QVMs
vec3_t flatAxis[ 3 ];
vec3_t swivelAngles;

Expand Down
4 changes: 2 additions & 2 deletions src/gamelogic/cgame/cg_drawtools.c
Expand Up @@ -575,7 +575,7 @@ CG_DrawSphere
*/
void CG_DrawSphere( const vec3_t center, float radius, int customShader, const float *shaderRGBA )
{
refEntity_t re;
static refEntity_t re; // static for proper alignment in QVMs
memset( &re, 0, sizeof( re ) );

re.reType = RT_MODEL;
Expand Down Expand Up @@ -612,7 +612,7 @@ CG_DrawSphericalCone
void CG_DrawSphericalCone( const vec3_t tip, const vec3_t rotation, float radius,
qboolean a240, int customShader, const float *shaderRGBA )
{
refEntity_t re;
static refEntity_t re; // static for proper alignment in QVMs
memset( &re, 0, sizeof( re ) );

re.reType = RT_MODEL;
Expand Down
10 changes: 5 additions & 5 deletions src/gamelogic/cgame/cg_ents.c
Expand Up @@ -312,7 +312,7 @@ CG_General
*/
static void CG_General( centity_t *cent )
{
refEntity_t ent;
static refEntity_t ent; // static for proper alignment in QVMs
entityState_t *s1;

s1 = &cent->currentState;
Expand Down Expand Up @@ -424,7 +424,7 @@ CG_Missile
*/
static void CG_Missile( centity_t *cent )
{
refEntity_t ent;
static refEntity_t ent; // static for proper alignment in QVMs
entityState_t *es;
const missileAttributes_t *ma;

Expand Down Expand Up @@ -554,7 +554,7 @@ CG_Mover
*/
static void CG_Mover( centity_t *cent )
{
refEntity_t ent;
static refEntity_t ent; // static for proper alignment in QVMs
entityState_t *s1;

s1 = &cent->currentState;
Expand Down Expand Up @@ -599,7 +599,7 @@ CG_Portal
*/
static void CG_Portal( centity_t *cent )
{
refEntity_t ent;
static refEntity_t ent; // static for proper alignment in QVMs
entityState_t *s1;

s1 = &cent->currentState;
Expand Down Expand Up @@ -667,7 +667,7 @@ CG_LightFlare
*/
static void CG_LightFlare( centity_t *cent )
{
refEntity_t flare;
static refEntity_t flare; // static for proper alignment in QVMs
entityState_t *es;
vec3_t forward, delta;
float len;
Expand Down
2 changes: 1 addition & 1 deletion src/gamelogic/cgame/cg_particles.c
Expand Up @@ -2528,7 +2528,7 @@ Actually render a particle
*/
static void CG_RenderParticle( particle_t *p )
{
refEntity_t re;
static refEntity_t re; // static for proper alignment in QVMs
float timeFrac, scale;
int index;
baseParticle_t *bp = p->class_;
Expand Down
9 changes: 4 additions & 5 deletions src/gamelogic/cgame/cg_players.c
Expand Up @@ -2618,11 +2618,10 @@ static void CG_JetpackAnimation( centity_t *cent, int *old, int *now, float *bac

static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *torso )
{
// These are static because otherwise we have >32K of locals, and lcc doesn't like that.
// Also, jetpack and battpack are never both in use together, so just #define.
refEntity_t jetpack;
refEntity_t flash;
static refEntity_t jetpack; // static for proper alignment in QVMs
static refEntity_t flash; // static for proper alignment in QVMs

// jetpack and battpack are never both in use together
# define radar jetpack

int held, publicFlags;
Expand Down Expand Up @@ -2803,7 +2802,7 @@ Float a sprite over the player's head
static void CG_PlayerFloatSprite( centity_t *cent, qhandle_t shader )
{
int rf;
refEntity_t ent;
static refEntity_t ent; // static for proper alignment in QVMs

if ( cent->currentState.number == cg.snap->ps.clientNum && !cg.renderingThirdPerson )
{
Expand Down
2 changes: 1 addition & 1 deletion src/gamelogic/cgame/cg_weapons.c
Expand Up @@ -1818,7 +1818,7 @@ Add the weapon, and flash for the player's view

void CG_AddViewWeapon( playerState_t *ps )
{
refEntity_t hand;
static refEntity_t hand; // static for proper alignment in QVMs
centity_t *cent;
clientInfo_t *ci;
float fovOffset;
Expand Down

0 comments on commit da5d90d

Please sign in to comment.