Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized compilation time on linux #4

Merged
merged 1 commit into from
Dec 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion regamedll/common/entity_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct entity_state_s

};/* size: 340, cachelines: 6, members: 62 */

struct clientdata_s
typedef struct clientdata_s
{
Vector origin;
Vector velocity;
Expand Down
144 changes: 72 additions & 72 deletions regamedll/dlls/airtank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,82 +22,82 @@ LINK_ENTITY_TO_CLASS(item_airtank, CAirtank);
/* <5211> ../cstrike/dlls/airtank.cpp:47 */
IMPLEMENT_SAVERESTORE(CAirtank, CGrenade);

/* <50dd> ../cstrike/dlls/airtank.cpp:50 */
void CAirtank::__MAKE_VHOOK(Spawn)(void)
{
Precache();

// motor
pev->movetype = MOVETYPE_FLY;
pev->solid = SOLID_BBOX;

SET_MODEL(ENT(pev), "models/w_oxygen.mdl");
UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 36));
UTIL_SetOrigin(pev, pev->origin);

SetTouch(&CAirtank::TankTouch);
SetThink(&CAirtank::TankThink);

pev->flags |= FL_MONSTER;
pev->takedamage = DAMAGE_YES;
pev->health = 20;
pev->dmg = 50;
m_state = 1;
}

/* <4fef> ../cstrike/dlls/airtank.cpp:71 */
void CAirtank::__MAKE_VHOOK(Precache)(void)
{
PRECACHE_MODEL("models/w_oxygen.mdl");
PRECACHE_SOUND("doors/aliendoor3.wav");
/* <50dd> ../cstrike/dlls/airtank.cpp:50 */
void CAirtank::__MAKE_VHOOK(Spawn)(void)
{
Precache();

// motor
pev->movetype = MOVETYPE_FLY;
pev->solid = SOLID_BBOX;

SET_MODEL(ENT(pev), "models/w_oxygen.mdl");
UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 36));
UTIL_SetOrigin(pev, pev->origin);

SetTouch(&CAirtank::TankTouch);
SetThink(&CAirtank::TankThink);

pev->flags |= FL_MONSTER;
pev->takedamage = DAMAGE_YES;
pev->health = 20;
pev->dmg = 50;
m_state = 1;
}

/* <503d> ../cstrike/dlls/airtank.cpp:78 */
void CAirtank::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib)
/* <4fef> ../cstrike/dlls/airtank.cpp:71 */
void CAirtank::__MAKE_VHOOK(Precache)(void)
{
pev->owner = ENT(pevAttacker);

// UNDONE: this should make a big bubble cloud, not an explosion
PRECACHE_MODEL("models/w_oxygen.mdl");
PRECACHE_SOUND("doors/aliendoor3.wav");
}

/* <503d> ../cstrike/dlls/airtank.cpp:78 */
void CAirtank::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib)
{
pev->owner = ENT(pevAttacker);

// UNDONE: this should make a big bubble cloud, not an explosion
Explode(pev->origin, Vector(0, 0, -1));
}

/* <5016> ../cstrike/dlls/airtank.cpp:88 */
void CAirtank::TankThink(void)
{
// Fire trigger
m_state = 1;
SUB_UseTargets(this, USE_TOGGLE, 0);
/* <5016> ../cstrike/dlls/airtank.cpp:88 */
void CAirtank::TankThink(void)
{
// Fire trigger
m_state = 1;
SUB_UseTargets(this, USE_TOGGLE, 0);
}

/* <525d> ../cstrike/dlls/airtank.cpp:96 */
void CAirtank::TankTouch(CBaseEntity *pOther)
{
if (!pOther->IsPlayer())
{
return;
}

if (!m_state)
{
// "no oxygen" sound
EMIT_SOUND(ENT(pev), CHAN_BODY, "player/pl_swim2.wav", VOL_NORM, ATTN_NORM);
return;
}

// give player 12 more seconds of air
pOther->pev->air_finished = gpGlobals->time + 12;

// suit recharge sound
EMIT_SOUND(ENT(pev), CHAN_VOICE, "doors/aliendoor3.wav", VOL_NORM, ATTN_NORM);

// recharge airtank in 30 seconds
pev->nextthink = gpGlobals->time + 30;
m_state = 0;
SUB_UseTargets(this, USE_TOGGLE, 1);
}

/* <525d> ../cstrike/dlls/airtank.cpp:96 */
void CAirtank::TankTouch(CBaseEntity *pOther)
{
if (!pOther->IsPlayer())
{
return;
}

if (!m_state)
{
// "no oxygen" sound
EMIT_SOUND(ENT(pev), CHAN_BODY, "player/pl_swim2.wav", VOL_NORM, ATTN_NORM);
return;
}

// give player 12 more seconds of air
pOther->pev->air_finished = gpGlobals->time + 12;

// suit recharge sound
EMIT_SOUND(ENT(pev), CHAN_VOICE, "doors/aliendoor3.wav", VOL_NORM, ATTN_NORM);

// recharge airtank in 30 seconds
pev->nextthink = gpGlobals->time + 30;
m_state = 0;
SUB_UseTargets(this, USE_TOGGLE, 1);
}

#ifdef HOOK_GAMEDLL


#ifdef HOOK_GAMEDLL

void CAirtank::Spawn(void)
{
Spawn_();
Expand All @@ -121,6 +121,6 @@ int CAirtank::Restore(CRestore &restore)
void CAirtank::Killed(entvars_t *pevAttacker, int iGib)
{
Killed_(pevAttacker, iGib);
}

#endif // HOOK_GAMEDLL
}
#endif // HOOK_GAMEDLL
44 changes: 24 additions & 20 deletions regamedll/dlls/bmodels.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
#define SF_CONVEYOR_VISUAL 0x0001
#define SF_CONVEYOR_NOTSOLID 0x0002

#define SF_WORLD_DARK 0x0001 // Fade from black at startup
#define SF_WORLD_TITLE 0x0002 // Display game title at startup
#define SF_WORLD_FORCETEAM 0x0004 // Force teams

#define FANPITCHMIN 30
#define FANPITCHMAX 100

Expand All @@ -53,7 +57,7 @@

// This is just a solid wall if not inhibited

/* <1c494> ../cstrike/dlls/bmodels.cpp:53 */
/* <1c494> ../cstrike/dlls/bmodels.cpp:53 */
class CFuncWall: public CBaseEntity
{
public:
Expand All @@ -75,7 +79,7 @@ class CFuncWall: public CBaseEntity

};/* size: 152, cachelines: 3, members: 1 */

/* <1c4e1> ../cstrike/dlls/bmodels.cpp:86 */
/* <1c4e1> ../cstrike/dlls/bmodels.cpp:86 */
class CFuncWallToggle: public CFuncWall
{
public:
Expand All @@ -94,9 +98,9 @@ class CFuncWallToggle: public CFuncWall
void TurnOn(void);
BOOL IsOn(void);

};/* size: 152, cachelines: 3, members: 1 */
};/* size: 152, cachelines: 3, members: 1 */

/* <1c52e> ../cstrike/dlls/bmodels.cpp:147 */
/* <1c52e> ../cstrike/dlls/bmodels.cpp:147 */
class CFuncConveyor: public CFuncWall
{
public:
Expand All @@ -117,7 +121,7 @@ class CFuncConveyor: public CFuncWall

// A simple entity that looks solid but lets you walk through it.

/* <1c65b> ../cstrike/dlls/bmodels.cpp:208 */
/* <1c65b> ../cstrike/dlls/bmodels.cpp:208 */
class CFuncIllusionary: public CBaseToggle
{
public:
Expand All @@ -140,15 +144,15 @@ class CFuncIllusionary: public CBaseToggle

};/* size: 312, cachelines: 5, members: 1 */

// Monster only clip brush
//
// This brush will be solid for any entity who has the FL_MONSTERCLIP flag set
// in pev->flags
//
// otherwise it will be invisible and not solid. This can be used to keep
// Monster only clip brush
//
// This brush will be solid for any entity who has the FL_MONSTERCLIP flag set
// in pev->flags
//
// otherwise it will be invisible and not solid. This can be used to keep
// specific monsters out of certain areas

/* <1c6a8> ../cstrike/dlls/bmodels.cpp:255 */
/* <1c6a8> ../cstrike/dlls/bmodels.cpp:255 */
class CFuncMonsterClip: public CFuncWall
{
public:
Expand All @@ -169,7 +173,7 @@ class CFuncMonsterClip: public CFuncWall

};/* size: 152, cachelines: 3, members: 1 */

/* <1c6fa> ../cstrike/dlls/bmodels.cpp:274 */
/* <1c6fa> ../cstrike/dlls/bmodels.cpp:274 */
class CFuncRotating: public CBaseEntity
{
public:
Expand Down Expand Up @@ -216,7 +220,7 @@ class CFuncRotating: public CBaseEntity

};/* size: 172, cachelines: 3, members: 7 */

/* <1c748> ../cstrike/dlls/bmodels.cpp:720 */
/* <1c748> ../cstrike/dlls/bmodels.cpp:720 */
class CPendulum: public CBaseEntity
{
public:
Expand Down Expand Up @@ -270,12 +274,12 @@ Vector VecBModelOrigin(entvars_t *pevBModel);
#ifdef HOOK_GAMEDLL

// linked objects
C_DLLEXPORT void func_wall(entvars_t *pev);
C_DLLEXPORT void func_wall_toggle(entvars_t *pev);
C_DLLEXPORT void func_conveyor(entvars_t *pev);
C_DLLEXPORT void func_illusionary(entvars_t *pev);
C_DLLEXPORT void func_monsterclip(entvars_t *pev);
C_DLLEXPORT void func_rotating(entvars_t *pev);
C_DLLEXPORT void func_wall(entvars_t *pev);
C_DLLEXPORT void func_wall_toggle(entvars_t *pev);
C_DLLEXPORT void func_conveyor(entvars_t *pev);
C_DLLEXPORT void func_illusionary(entvars_t *pev);
C_DLLEXPORT void func_monsterclip(entvars_t *pev);
C_DLLEXPORT void func_rotating(entvars_t *pev);
C_DLLEXPORT void func_pendulum(entvars_t *pev);

#endif // HOOK_GAMEDLL
Expand Down
Loading