aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/game/GameSave.java
diff options
context:
space:
mode:
authorRene Stoeckel <[email protected]>2005-11-20 22:18:34 +0000
committerRene Stoeckel <[email protected]>2005-11-20 22:18:34 +0000
commit57f4ee905c2805bdb07076c04a41ab54111e8a71 (patch)
tree1e745d77d6f0b7b4e86c1978917525c43961b3ac /src/jake2/game/GameSave.java
parent07964a7dee884f99eb25e069406ef349c6af43ac (diff)
savegames are now independend from different jake2 builds and releases
Diffstat (limited to 'src/jake2/game/GameSave.java')
-rw-r--r--src/jake2/game/GameSave.java96
1 files changed, 91 insertions, 5 deletions
diff --git a/src/jake2/game/GameSave.java b/src/jake2/game/GameSave.java
index 7bc7634..a1415e2 100644
--- a/src/jake2/game/GameSave.java
+++ b/src/jake2/game/GameSave.java
@@ -19,11 +19,12 @@
*/
// Created on 29.12.2003 by RST.
-// $Id: GameSave.java,v 1.9 2005-11-16 22:24:52 salomo Exp $
+// $Id: GameSave.java,v 1.10 2005-11-20 22:18:33 salomo Exp $
package jake2.game;
import jake2.Defines;
import jake2.Globals;
+import jake2.qcommon.Com;
import jake2.util.Lib;
import jake2.util.QuakeFile;
@@ -43,20 +44,104 @@ public class GameSave {
}
+ private static String preloadclasslist [] =
+ {
+ "jake2.game.PlayerWeapon",
+ "jake2.game.AIAdapter",
+ "jake2.game.Cmd",
+ "jake2.game.EdictFindFilter",
+ "jake2.game.EdictIterator",
+ "jake2.game.EndianHandler",
+ "jake2.game.EntBlockedAdapter",
+ "jake2.game.EntDieAdapter",
+ "jake2.game.EntDodgeAdapter",
+ "jake2.game.EntInteractAdapter",
+ "jake2.game.EntPainAdapter",
+ "jake2.game.EntThinkAdapter",
+ "jake2.game.EntTouchAdapter",
+ "jake2.game.EntUseAdapter",
+ "jake2.game.GameAI",
+ "jake2.game.GameBase",
+ "jake2.game.GameChase",
+ "jake2.game.GameCombat",
+ "jake2.game.GameFunc",
+ "jake2.game.GameMisc",
+ "jake2.game.GameSVCmds",
+ "jake2.game.GameSave",
+ "jake2.game.GameSpawn",
+ "jake2.game.GameTarget",
+ "jake2.game.GameTrigger",
+ "jake2.game.GameTurret",
+ "jake2.game.GameUtil",
+ "jake2.game.GameWeapon",
+ "jake2.game.Info",
+ "jake2.game.ItemDropAdapter",
+ "jake2.game.ItemUseAdapter",
+ "jake2.game.Monster",
+ "jake2.game.PlayerClient",
+ "jake2.game.PlayerHud",
+ "jake2.game.PlayerTrail",
+ "jake2.game.PlayerView",
+ "jake2.game.SuperAdapter",
+ "jake2.game.monsters.M_Actor",
+ "jake2.game.monsters.M_Berserk",
+ "jake2.game.monsters.M_Boss2",
+ "jake2.game.monsters.M_Boss3",
+ "jake2.game.monsters.M_Boss31",
+ "jake2.game.monsters.M_Boss32",
+ "jake2.game.monsters.M_Brain",
+ "jake2.game.monsters.M_Chick",
+ "jake2.game.monsters.M_Flash",
+ "jake2.game.monsters.M_Flipper",
+ "jake2.game.monsters.M_Float",
+ "jake2.game.monsters.M_Flyer",
+ "jake2.game.monsters.M_Gladiator",
+ "jake2.game.monsters.M_Gunner",
+ "jake2.game.monsters.M_Hover",
+ "jake2.game.monsters.M_Infantry",
+ "jake2.game.monsters.M_Insane",
+ "jake2.game.monsters.M_Medic",
+ "jake2.game.monsters.M_Mutant",
+ "jake2.game.monsters.M_Parasite",
+ "jake2.game.monsters.M_Player",
+ "jake2.game.monsters.M_Soldier",
+ "jake2.game.monsters.M_Supertank",
+ "jake2.game.monsters.M_Tank",
+ "jake2.game.GameItems",
+ // DANGER! init as last, when all adatpers are != null
+ "jake2.game.GameItemList"
+ };
+
/*
- * ============ InitGame
+ * ============
+ * InitGame
*
* This will be called when the dll is first loaded, which only happens when
- * a new game is started or a save game is loaded. ============
+ * a new game is started or a save game is loaded.
+ * ============
*/
public static void InitGame() {
GameBase.gi.dprintf("==== InitGame ====\n");
+ // preload all classes to register the adapters
+ for ( int n=0; n < preloadclasslist.length; n++)
+ {
+ try
+ {
+ Class.forName(preloadclasslist[n]);
+ }
+ catch(Exception e)
+ {
+ Com.DPrintf("error loading class: " + e.getMessage());
+ }
+ }
+
+
GameBase.gun_x = GameBase.gi.cvar("gun_x", "0", 0);
GameBase.gun_y = GameBase.gi.cvar("gun_y", "0", 0);
GameBase.gun_z = GameBase.gi.cvar("gun_z", "0", 0);
- //FIXME: sv_ prefix is wrong for these
+ //FIXME: sv_ prefix are wrong names for these variables
GameBase.sv_rollspeed = GameBase.gi.cvar("sv_rollspeed", "200", 0);
GameBase.sv_rollangle = GameBase.gi.cvar("sv_rollangle", "2", 0);
GameBase.sv_maxvelocity = GameBase.gi.cvar("sv_maxvelocity", "2000", 0);
@@ -244,7 +329,8 @@ public class GameSave {
* The server will have cleared all of the world links before calling
* ReadLevel.
*
- * No clients are connected yet. =================
+ * No clients are connected yet.
+ * =================
*/
public static void ReadLevel(String filename) {
try {