moved sprite.cpp into gs-entbase/client/env_sprite.cpp
This commit is contained in:
parent
f66792ef49
commit
9442a597fa
15 changed files with 50 additions and 39 deletions
|
@ -22,7 +22,6 @@
|
|||
../cstrike/init.c
|
||||
|
||||
../fade.c
|
||||
../sprite.cpp
|
||||
../titles.c
|
||||
../text.c
|
||||
|
||||
|
|
|
@ -45,7 +45,12 @@ void CSQC_Ent_Update(float new)
|
|||
n.ReadEntity(readfloat());
|
||||
break;
|
||||
case ENT_SPRITE:
|
||||
Sprite_Animated();
|
||||
env_sprite spr = (env_sprite)self;
|
||||
if (new) {
|
||||
spawnfunc_env_sprite();
|
||||
}
|
||||
spr.ReadEntity(readfloat());
|
||||
break;
|
||||
break;
|
||||
case ENT_SPRAY:
|
||||
Spray_Parse();
|
||||
|
|
|
@ -479,7 +479,7 @@ CSQC_Parse_Event(void)
|
|||
Fade_Parse();
|
||||
break;
|
||||
case EV_SPRITE:
|
||||
Sprite_ParseEvent();
|
||||
EnvSprite_ParseEvent();
|
||||
break;
|
||||
case EV_TEXT:
|
||||
GameText_Parse();
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
../../vgui/include.src
|
||||
../util.c
|
||||
../fade.c
|
||||
../sprite.cpp
|
||||
../titles.c
|
||||
../text.c
|
||||
../sentences.c
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
../../vgui/include.src
|
||||
../util.c
|
||||
../fade.c
|
||||
../sprite.cpp
|
||||
../titles.c
|
||||
../text.c
|
||||
../sentences.c
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
../../vgui/include.src
|
||||
../util.c
|
||||
../fade.c
|
||||
../sprite.cpp
|
||||
../titles.c
|
||||
../text.c
|
||||
../sentences.c
|
||||
|
|
|
@ -129,7 +129,7 @@ class decore_torch:CBaseDecor
|
|||
CBaseDecor::Initialized();
|
||||
this.effects |= EF_FULLBRIGHT;
|
||||
|
||||
sprite flame = spawn(sprite);
|
||||
env_sprite flame = spawn(env_sprite);
|
||||
setorigin(flame, origin + [0,0,24]);
|
||||
setmodel(flame, "sprites/torch.spr");
|
||||
flame.effects = EF_ADDITIVE;
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
init.c
|
||||
|
||||
../fade.c
|
||||
../sprite.cpp
|
||||
../titles.c
|
||||
../text.c
|
||||
../sentences.c
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
../util.c
|
||||
|
||||
../fade.c
|
||||
../sprite.cpp
|
||||
../titles.c
|
||||
../text.c
|
||||
../sentences.c
|
||||
|
|
|
@ -23,7 +23,6 @@ vgui_chooseteam.cpp
|
|||
init.c
|
||||
|
||||
../fade.c
|
||||
../sprite.cpp
|
||||
../titles.c
|
||||
../text.c
|
||||
../sentences.c
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
../valve/init.c
|
||||
|
||||
../fade.c
|
||||
../sprite.cpp
|
||||
../titles.c
|
||||
../text.c
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ client/env_cubemap.cpp
|
|||
client/env_glow.cpp
|
||||
client/env_sound.cpp
|
||||
client/env_soundscape.cpp
|
||||
client/env_sprite.cpp
|
||||
client/env_particle.cpp
|
||||
client/env_laser.cpp
|
||||
client/func_lod.cpp
|
||||
|
|
|
@ -14,16 +14,19 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
class sprite
|
||||
class env_sprite:CBaseEntity
|
||||
{
|
||||
float framerate;
|
||||
int loops;
|
||||
int maxframe;
|
||||
|
||||
|
||||
virtual void() Init;
|
||||
virtual void() Initialized;
|
||||
virtual void(float flChanged) ReadEntity;
|
||||
virtual void() think;
|
||||
};
|
||||
|
||||
void sprite::think(void)
|
||||
void env_sprite::think(void)
|
||||
{
|
||||
if (frame >= (maxframe-1)) {
|
||||
if (loops == 0) {
|
||||
|
@ -37,32 +40,41 @@ void sprite::think(void)
|
|||
|
||||
nextthink = time + (1 / framerate);
|
||||
}
|
||||
|
||||
void Sprite_Animated(void)
|
||||
|
||||
void env_sprite::ReadEntity(float flChanged)
|
||||
{
|
||||
spawnfunc_sprite();
|
||||
sprite me = (sprite)self;
|
||||
me.origin[0] = readcoord();
|
||||
me.origin[1] = readcoord();
|
||||
me.origin[2] = readcoord();
|
||||
me.modelindex = readfloat();
|
||||
me.framerate = readfloat();
|
||||
me.scale = readfloat();
|
||||
me.alpha = readfloat();
|
||||
me.effects = readfloat();
|
||||
me.colormod[0] = readfloat();
|
||||
me.colormod[1] = readfloat();
|
||||
me.colormod[2] = readfloat();
|
||||
me.drawmask = MASK_ENGINE;
|
||||
me.nextthink = time + (1 / me.framerate);
|
||||
me.maxframe = modelframecount(me.modelindex);
|
||||
me.loops = 1; /* repeats */
|
||||
setorigin(me, me.origin);
|
||||
origin[0] = readcoord();
|
||||
origin[1] = readcoord();
|
||||
origin[2] = readcoord();
|
||||
modelindex = readfloat();
|
||||
framerate = readfloat();
|
||||
scale = readfloat();
|
||||
alpha = readfloat();
|
||||
effects = readfloat();
|
||||
colormod[0] = readfloat();
|
||||
colormod[1] = readfloat();
|
||||
colormod[2] = readfloat();
|
||||
drawmask = MASK_ENGINE;
|
||||
nextthink = time + (1 / framerate);
|
||||
maxframe = modelframecount(modelindex);
|
||||
loops = 1; /* repeats */
|
||||
setorigin(this, origin);
|
||||
}
|
||||
|
||||
void Sprite_ParseEvent(void)
|
||||
/* make sure we're not spawning on the client-side */
|
||||
void env_sprite::Init(void)
|
||||
{
|
||||
sprite spr = spawn(sprite);
|
||||
}
|
||||
void env_sprite::Initialized(void)
|
||||
{
|
||||
}
|
||||
void env_sprite::env_sprite(void)
|
||||
{
|
||||
}
|
||||
|
||||
void EnvSprite_ParseEvent(void)
|
||||
{
|
||||
env_sprite spr = spawn(env_sprite);
|
||||
spr.origin[0] = readcoord();
|
||||
spr.origin[1] = readcoord();
|
||||
spr.origin[2] = readcoord();
|
|
@ -55,6 +55,7 @@ float env_sprite::Network(entity pvsent, float flags)
|
|||
return FALSE;
|
||||
}
|
||||
WriteByte(MSG_ENTITY, ENT_SPRITE);
|
||||
WriteFloat(MSG_ENTITY, 666);
|
||||
WriteCoord(MSG_ENTITY, origin[0]);
|
||||
WriteCoord(MSG_ENTITY, origin[1]);
|
||||
WriteCoord(MSG_ENTITY, origin[2]);
|
||||
|
|
|
@ -134,7 +134,7 @@ Effect_CreateExplosion(vector vPos)
|
|||
msg_entity = self;
|
||||
multicast(vPos, MULTICAST_PVS);
|
||||
#else
|
||||
sprite eExplosion = spawn(sprite);
|
||||
env_sprite eExplosion = spawn(env_sprite);
|
||||
setorigin(eExplosion, vPos);
|
||||
setmodel(eExplosion, "sprites/fexplo.spr");
|
||||
sound(eExplosion, CHAN_WEAPON, sprintf("weapons/explode%d.wav", floor(random() * 3) + 3), 1, ATTN_NORM);
|
||||
|
@ -164,7 +164,7 @@ void Effect_CreateBlood(vector pos, vector color) {
|
|||
msg_entity = self;
|
||||
multicast(pos, MULTICAST_PVS);
|
||||
#else
|
||||
sprite eBlood = spawn(sprite);
|
||||
env_sprite eBlood = spawn(env_sprite);
|
||||
setorigin(eBlood, pos);
|
||||
setmodel(eBlood, "sprites/bloodspray.spr");
|
||||
|
||||
|
@ -179,7 +179,7 @@ void Effect_CreateBlood(vector pos, vector color) {
|
|||
eBlood.nextthink = time + 0.05f;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
sprite ePart = spawn(sprite);
|
||||
env_sprite ePart = spawn(env_sprite);
|
||||
setorigin(ePart, pos);
|
||||
setmodel(ePart, "sprites/blood.spr");
|
||||
ePart.movetype = MOVETYPE_BOUNCE;
|
||||
|
|
Loading…
Reference in a new issue