diff --git a/README.md b/README.md index 0765d054..bbf5102f 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ You want this plugin if you want playback of a variety of media formats, includi This is the only component that requires a C++ compiler. ## Support -Join us on irc.vera-visions.com and chat if you're interested in using this in production. +Join us in #nuclide on irc.libera.chat and chat if you're interested in using this in production. **All this is provided to you for free as-is otherwise.** ## Special Thanks diff --git a/src/client/damage.qc b/src/client/damage.qc index 0795c99e..122a0ee3 100644 --- a/src/client/damage.qc +++ b/src/client/damage.qc @@ -14,66 +14,6 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -var string g_damage_spr_t; -var string g_damage_spr_b; -var string g_damage_spr_l; -var string g_damage_spr_r; - -void -Damage_Precache(void) -{ - g_damage_spr_t = spriteframe("sprites/640_pain.spr", 0, 0.0f); - g_damage_spr_r = spriteframe("sprites/640_pain.spr", 1, 0.0f); - g_damage_spr_b = spriteframe("sprites/640_pain.spr", 2, 0.0f); - g_damage_spr_l = spriteframe("sprites/640_pain.spr", 3, 0.0f); -} - -void -Damage_Draw(void) -{ - vector center; - vector rel_pos; - float fw, fw_alpha; - float rt, rt_alpha; - - if (pSeat->m_flDamageAlpha <= 0.0) { - return; - } - - center = video_mins + (video_res / 2); - - /* the pos relative to the player + view_dir determines which - * and how bright each indicator is drawn. so first get the relative - * position between us and the attacker, then calculate the strength - * of each direction based on a dotproduct tested against our - * camera direction. - */ - rel_pos = normalize(pSeat->m_vecDamagePos - getproperty(VF_ORIGIN)); - makevectors(getproperty(VF_CL_VIEWANGLES)); - fw = dotproduct(rel_pos, v_forward); - rt = dotproduct(rel_pos, v_right); - - fw_alpha = fabs(fw) * pSeat->m_flDamageAlpha; - if (fw > 0.25f) { - drawpic(center + [-64,-102], g_damage_spr_t, - [128,48], [1,1,1], fw_alpha, DRAWFLAG_ADDITIVE); - } else if (fw < -0.25f) { - drawpic(center + [-64,70], g_damage_spr_b, - [128,48], [1,1,1], fw_alpha, DRAWFLAG_ADDITIVE); - } - - rt_alpha = fabs(rt) * pSeat->m_flDamageAlpha; - if (rt > 0.25f) { - drawpic(center + [70,-64], g_damage_spr_r, - [48,128], [1,1,1], rt_alpha, DRAWFLAG_ADDITIVE); - } else if (rt < -0.25f) { - drawpic(center + [-102,-64], g_damage_spr_l, - [48,128], [1,1,1], rt_alpha, DRAWFLAG_ADDITIVE); - } - - pSeat->m_flDamageAlpha -= clframetime; -} - /* * engine specific callback for when dmg_ fields are set on the client side. * might want to replace it at some point? probably not... diff --git a/src/client/defs.h b/src/client/defs.h index 23eb8bb9..94d71bfd 100644 --- a/src/client/defs.h +++ b/src/client/defs.h @@ -66,9 +66,6 @@ int g_iIntermission; /* this actually belongs in builtins.h since its an undocumented global */ float clframetime; -/* prototypes */ -void Damage_Draw(void); - string(string modelname, int frame, float frametime) spriteframe = #0; void diff --git a/src/client/entry.qc b/src/client/entry.qc index 6bc3abc7..da27e48f 100644 --- a/src/client/entry.qc +++ b/src/client/entry.qc @@ -134,7 +134,6 @@ CSQC_RendererRestarted(string rstr) View_Init(); ClientGame_RendererRestart(rstr); HUD_Init(); - Damage_Precache(); /* GS-Entbase */ Fade_Init(); diff --git a/src/gs-entbase/client/env_glow.qc b/src/gs-entbase/client/env_glow.qc index 33540411..177f2491 100644 --- a/src/gs-entbase/client/env_glow.qc +++ b/src/gs-entbase/client/env_glow.qc @@ -38,6 +38,7 @@ class env_glow:NSEntity /* change to renderablentity? */ float m_flScale; void(void) env_glow; + virtual float() predraw; virtual void(string, string) SpawnKey; virtual void(void) RendererRestarted; @@ -169,7 +170,9 @@ env_glow::env_glow(void) drawmask = MASK_ENGINE; setsize(this, [0,0,0], [0,0,0]); effects &= ~EF_NOSHADOW; + Init(); + RendererRestarted(); setorigin(this, origin); } diff --git a/src/gs-entbase/shared/NSIO.h b/src/gs-entbase/shared/NSIO.h index e00d93dc..77f01769 100644 --- a/src/gs-entbase/shared/NSIO.h +++ b/src/gs-entbase/shared/NSIO.h @@ -47,6 +47,9 @@ class NSIO /* whenever gamerules want entities to respawn */ virtual void(void) Respawn; + virtual void(float) Save; + virtual void(float) Restore; + /* Handle incoming entities input messaging */ virtual void(entity, string, string) Input; #endif diff --git a/src/gs-entbase/shared/NSIO.qc b/src/gs-entbase/shared/NSIO.qc index 1e567f7b..5e90b0b3 100644 --- a/src/gs-entbase/shared/NSIO.qc +++ b/src/gs-entbase/shared/NSIO.qc @@ -150,6 +150,17 @@ NSIO::Respawn(void) { // Respawn code goes here... } + +void +NSIO::Save(float handle) +{ + +} +void +NSIO::Restore(float handle) +{ + +} #endif /* diff --git a/src/server/defs.h b/src/server/defs.h index c71f1ea6..9096fb6c 100644 --- a/src/server/defs.h +++ b/src/server/defs.h @@ -61,7 +61,6 @@ entity eActivator; .float deaths; .float identity; .float botinfo; -.void(float) Save; /* in idTech the .owner field causes collisions to fail against set entity, * we don't want this all of the time. so use this as a fallback */ diff --git a/src/server/entry.qc b/src/server/entry.qc index af7864f9..1060d0ff 100644 --- a/src/server/entry.qc +++ b/src/server/entry.qc @@ -520,13 +520,6 @@ as they do not exist yet. Keep this in mind. */ var int autocvar_sv_levelexec = 1; -void -worldspawn_save(float fh) -{ - SAVE_VECTOR(fh, "origin", self.origin); - SAVE_STRING(fh, "model", self.model); -} - void worldspawn(void) { @@ -561,8 +554,6 @@ worldspawn(void) } forceinfokey(world, "skyname", self.skyname); } - - self.Save = worldspawn_save; } /* @@ -669,9 +660,11 @@ SV_PerformLoad(float fh) entity eold; string l; float n; - eold = self; e = world; + int inentity; + int inworld; + /* while ((e=nextent(e))) { if (edict_num(1) != e) @@ -680,6 +673,7 @@ SV_PerformLoad(float fh) */ #if 1 + /* read line per line of our file handle */ while ((l=fgets(fh))) { float braced = FALSE; float args = tokenize(l); @@ -687,10 +681,6 @@ SV_PerformLoad(float fh) if (!args) break; - if (args != 3) { - continue; - } - if (argv(0) == "ENTITY") { string cname; n = stof(argv(1)); @@ -702,17 +692,16 @@ SV_PerformLoad(float fh) print(sprintf("Try spawning %s\n", cname)); /* call the constructor if one is present, init the default fields */ if (isfunction(strcat("spawnfunc_", cname))) { + NSEntity willload; e.classname = cname; print(sprintf("I'm actually spawning %s\n", cname)); + eold = self; self = e; callfunction(strcat("spawnfunc_", cname)); e.classname = cname; self = eold; - - setmodel(e, e.model); - setsize(e, e.mins, e.maxs); - setorigin(e, e.origin); + inentity = TRUE; } else { print(sprintf("Could not spawn %s\n", cname)); remove(e); @@ -720,6 +709,13 @@ SV_PerformLoad(float fh) } } else if (argv(1) == "GLOBAL") { // TODO + } else if (argv(0) == "{") { + if (inentity) + + willload = (NSEntity)e; + willload.Restore(fh); + } else if (argv(0) == "}") { + } } #endif @@ -732,6 +728,7 @@ SV_PerformSave(float fh, float numents) entity e; for (i = 0; i < numents; i++) { + NSEntity willsave; e = edict_num(i); if (e==world && i) @@ -740,15 +737,14 @@ SV_PerformSave(float fh, float numents) if (wasfreed(e)) continue; - if (e.Save) { - entity oself = self; - self = e; - fputs(fh, sprintf("ENTITY \"%d\" %S\n", i, e.classname)); - fputs(fh, "{ "); - e.Save(fh); - fputs(fh, "}\n"); - self = oself; - } + if (e.identity == 0) + continue; + + willsave = (NSEntity)e; + fputs(fh, sprintf("ENTITY \"%d\" %S\n", i, willsave.classname)); + fputs(fh, "{ "); + willsave.Save(fh); + fputs(fh, "}\n"); } fclose(fh); }