diff options
author | Carsten Weisse <[email protected]> | 2007-05-14 23:37:00 +0000 |
---|---|---|
committer | Carsten Weisse <[email protected]> | 2007-05-14 23:37:00 +0000 |
commit | 0ad449642b82c648801fac924081b33c0194bef8 (patch) | |
tree | e2eea47862f1793d3fb418e636bba0c373086740 /src/jake2/server/SV_ENTS.java | |
parent | 516da598492d8823ddb401167061e2ef63db08b3 (diff) |
this was the biggest garbage producer (32KB each frame), now fixed
Diffstat (limited to 'src/jake2/server/SV_ENTS.java')
-rw-r--r-- | src/jake2/server/SV_ENTS.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/jake2/server/SV_ENTS.java b/src/jake2/server/SV_ENTS.java index 0f32322..50159de 100644 --- a/src/jake2/server/SV_ENTS.java +++ b/src/jake2/server/SV_ENTS.java @@ -20,7 +20,7 @@ // Created on 17.01.2004 by RST. -// $Id: SV_ENTS.java,v 1.7 2005-12-27 21:02:30 salomo Exp $ +// $Id: SV_ENTS.java,v 1.8 2007-05-14 23:37:00 cawe Exp $ package jake2.server; @@ -534,22 +534,21 @@ public class SV_ENTS { } } + + // stack variable + private static byte buf_data[] = new byte[32768]; + /** * Save everything in the world out without deltas. Used for recording * footage for merged or assembled demos. */ public static void SV_RecordDemoMessage() { - int e; - edict_t ent; - entity_state_t nostate = new entity_state_t(null); - sizebuf_t buf = new sizebuf_t(); - byte buf_data[] = new byte[32768]; - int len; - if (SV_INIT.svs.demofile == null) return; //memset (nostate, 0, sizeof(nostate)); + entity_state_t nostate = new entity_state_t(null); + sizebuf_t buf = new sizebuf_t(); SZ.Init(buf, buf_data, buf_data.length); // write a frame message that doesn't contain a player_state_t @@ -558,8 +557,8 @@ public class SV_ENTS { MSG.WriteByte(buf, Defines.svc_packetentities); - e = 1; - ent = GameBase.g_edicts[e]; + int e = 1; + edict_t ent = GameBase.g_edicts[e]; while (e < GameBase.num_edicts) { // ignore ents without visible models unless they have an effect @@ -582,7 +581,7 @@ public class SV_ENTS { SZ.Clear(SV_INIT.svs.demo_multicast); // now write the entire message to the file, prefixed by the length - len = EndianHandler.swapInt(buf.cursize); + int len = EndianHandler.swapInt(buf.cursize); try { //fwrite (len, 4, 1, svs.demofile); |