aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2005-12-06 14:37:43 +0000
committerCarsten Weisse <[email protected]>2005-12-06 14:37:43 +0000
commitccd446308b54825e68717fe5394d4e30f8079ac9 (patch)
tree3fa63a50f5b26ad829af4346929a693ed04eaa09 /src/jake2
parent8c12a9547e61079872828768117192b775663f02 (diff)
stop cinematics while disconnect;
code cleanup; javadoc comments;
Diffstat (limited to 'src/jake2')
-rw-r--r--src/jake2/client/CL.java187
1 files changed, 85 insertions, 102 deletions
diff --git a/src/jake2/client/CL.java b/src/jake2/client/CL.java
index 8c8ee09..3aa7f1c 100644
--- a/src/jake2/client/CL.java
+++ b/src/jake2/client/CL.java
@@ -2,7 +2,7 @@
* CL.java
* Copyright (C) 2004
*
- * $Id: CL.java,v 1.25 2005-12-03 19:41:20 salomo Exp $
+ * $Id: CL.java,v 1.26 2005-12-06 14:37:43 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -32,7 +32,9 @@ import jake2.qcommon.*;
import jake2.server.SV_MAIN;
import jake2.sound.S;
import jake2.sys.*;
-import jake2.util.*;
+import jake2.util.Lib;
+import jake2.util.Math3D;
+import jake2.util.Vargs;
import java.io.IOException;
import java.io.RandomAccessFile;
@@ -56,11 +58,6 @@ public final class CL {
public static final int PLAYER_MULT = 5;
- /*
- * ================== CL_FixCvarCheats
- *
- * ==================
- */
public static class cheatvar_t {
String name;
@@ -89,10 +86,10 @@ public final class CL {
static int numcheatvars;
- /*
- * ==================== CL_Stop_f
+ /**
+ * Stop_f
*
- * stop recording a demo ====================
+ * Stop recording a demo.
*/
static xcommand_t Stop_f = new xcommand_t() {
public void execute() {
@@ -117,15 +114,14 @@ public final class CL {
}
};
- /*
- * ==================== CL_Record_f
- *
- * record <demoname>
- *
- * Begins recording a demo from the current position ====================
- */
static entity_state_t nullstate = new entity_state_t(null);
+ /**
+ * Record_f
+ *
+ * record &lt;demoname&gt;
+ * Begins recording a demo from the current position.
+ */
static xcommand_t Record_f = new xcommand_t() {
public void execute() {
try {
@@ -233,8 +229,8 @@ public final class CL {
}
};
- /*
- * ================== CL_ForwardToServer_f ==================
+ /**
+ * ForwardToServer_f
*/
static xcommand_t ForwardToServer_f = new xcommand_t() {
public void execute() {
@@ -253,8 +249,8 @@ public final class CL {
}
};
- /*
- * ================== CL_Pause_f ==================
+ /**
+ * Pause_f
*/
static xcommand_t Pause_f = new xcommand_t() {
public void execute() {
@@ -270,8 +266,8 @@ public final class CL {
}
};
- /*
- * ================== CL_Quit_f ==================
+ /**
+ * Quit_f
*/
static xcommand_t Quit_f = new xcommand_t() {
public void execute() {
@@ -280,10 +276,8 @@ public final class CL {
}
};
- /*
- * ================ CL_Connect_f
- *
- * ================
+ /**
+ * Connect_f
*/
static xcommand_t Connect_f = new xcommand_t() {
public void execute() {
@@ -315,11 +309,10 @@ public final class CL {
}
};
- /*
- * ===================== CL_Rcon_f
+ /**
+ * Rcon_f
*
* Send the rest of the command line over as an unconnected command.
- * =====================
*/
static xcommand_t Rcon_f = new xcommand_t() {
public void execute() {
@@ -381,11 +374,10 @@ public final class CL {
}
};
- /*
- * ================= CL_Changing_f
+ /**
+ * Changing_f
*
- * Just sent as a hint to the client that they should drop to full console
- * =================
+ * Just sent as a hint to the client that they should drop to full console.
*/
static xcommand_t Changing_f = new xcommand_t() {
public void execute() {
@@ -403,10 +395,10 @@ public final class CL {
}
};
- /*
- * ================= CL_Reconnect_f
+ /**
+ * Reconnect_f
*
- * The server is changing levels =================
+ * The server is changing levels.
*/
static xcommand_t Reconnect_f = new xcommand_t() {
public void execute() {
@@ -439,8 +431,8 @@ public final class CL {
}
};
- /*
- * ================= CL_PingServers_f =================
+ /**
+ * PingServers_f
*/
static xcommand_t PingServers_f = new xcommand_t() {
public void execute() {
@@ -498,10 +490,10 @@ public final class CL {
}
};
- /*
- * ================= CL_Skins_f
+ /**
+ * Skins_f
*
- * Load or download any custom player skins and models =================
+ * Load or download any custom player skins and models.
*/
static xcommand_t Skins_f = new xcommand_t() {
public void execute() {
@@ -520,8 +512,8 @@ public final class CL {
}
};
- /*
- * ============== CL_Userinfo_f ==============
+ /**
+ * Userinfo_f
*/
static xcommand_t Userinfo_f = new xcommand_t() {
public void execute() {
@@ -530,11 +522,11 @@ public final class CL {
}
};
- /*
- * ================= CL_Snd_Restart_f
+ /**
+ * Snd_Restart_f
*
* Restart the sound subsystem so it can pick up new parameters and flush
- * all sounds =================
+ * all sounds.
*/
static xcommand_t Snd_Restart_f = new xcommand_t() {
public void execute() {
@@ -580,29 +572,22 @@ public final class CL {
}
};
- /*
- * ================== CL_Frame
- *
- * ==================
- */
private static int extratime;
// ============================================================================
- /*
- * =============== CL_Shutdown
+ /**
+ * Shutdown
*
* FIXME: this is a callback from Sys_Quit and Com_Error. It would be better
* to run quit through here before the final handoff to the sys code.
- * ===============
*/
static boolean isdown = false;
- /*
- * ==================== CL_WriteDemoMessage
+ /**
+ * WriteDemoMessage
*
* Dumps the current net message, prefixed by the length
- * ====================
*/
static void WriteDemoMessage() {
int swlen;
@@ -618,11 +603,10 @@ public final class CL {
}
- /*
- * ======================= CL_SendConnectPacket
+ /**
+ * SendConnectPacket
*
* We have gotten a challenge from the server, so try and connect.
- * ======================
*/
static void SendConnectPacket() {
netadr_t adr = new netadr_t();
@@ -645,10 +629,10 @@ public final class CL {
+ Globals.cls.challenge + " \"" + Cvar.Userinfo() + "\"\n");
}
- /*
- * ================= CL_CheckForResend
+ /**
+ * CheckForResend
*
- * Resend a connect message if the last one has timed out =================
+ * Resend a connect message if the last one has timed out.
*/
static void CheckForResend() {
netadr_t adr = new netadr_t();
@@ -677,23 +661,20 @@ public final class CL {
return;
}
if (adr.port == 0)
- // adr.port = BigShort(PORT_SERVER);
adr.port = Defines.PORT_SERVER;
- Globals.cls.connect_time = Globals.cls.realtime; // for retransmit
- // requests
+ // for retransmit requests
+ Globals.cls.connect_time = Globals.cls.realtime;
Com.Printf("Connecting to " + Globals.cls.servername + "...\n");
Netchan.OutOfBandPrint(Defines.NS_CLIENT, adr, "getchallenge\n");
}
- /*
- * ===================== CL_ClearState
+ /**
+ * ClearState
*
- * =====================
*/
-
static void ClearState() {
S.StopAllSounds();
CL_fx.ClearEffects();
@@ -709,14 +690,13 @@ public final class CL {
SZ.Clear(Globals.cls.netchan.message);
}
- /*
- * ===================== CL_Disconnect
+ /**
+ * Disconnect
*
* Goes from a connected state to full screen console state Sends a
* disconnect message to the server This is also called on Com_Error, so it
- * shouldn't cause any errors =====================
+ * shouldn't cause any errors.
*/
-
static void Disconnect() {
String fin;
@@ -737,15 +717,13 @@ public final class CL {
Math3D.VectorClear(Globals.cl.refdef.blend);
- // TODO: Carsten, check re.CinematicSetPalette
- //re.CinematicSetPalette(null);
+ Globals.re.CinematicSetPalette(null);
Menu.ForceMenuOff();
Globals.cls.connect_time = 0;
- // TODO: Carsten, check SCR.StopCinematic();
- // SCR.StopCinematic();
+ SCR.StopCinematic();
if (Globals.cls.demorecording)
Stop_f.execute();
@@ -762,17 +740,15 @@ public final class CL {
if (Globals.cls.download != null) {
Lib.fclose(Globals.cls.download);
Globals.cls.download = null;
- // fclose(cls.download);
- // cls.download = NULL;
}
Globals.cls.state = Defines.ca_disconnected;
}
- /*
- * ================= CL_ParseStatusMessage
+ /**
+ * ParseStatusMessage
*
- * Handle a reply from a ping =================
+ * Handle a reply from a ping.
*/
static void ParseStatusMessage() {
String s;
@@ -783,10 +759,10 @@ public final class CL {
Menu.AddToServerList(Globals.net_from, s);
}
- /*
- * ================= CL_ConnectionlessPacket
+ /**
+ * ConnectionlessPacket
*
- * Responses to broadcasts, etc =================
+ * Responses to broadcasts, etc
*/
static void ConnectionlessPacket() {
String s;
@@ -865,8 +841,8 @@ public final class CL {
}
- /*
- * ================= CL_ReadPackets =================
+ /**
+ * ReadPackets
*/
static void ReadPackets() {
while (NET.GetPacket(Defines.NS_CLIENT, Globals.net_from,
@@ -925,8 +901,8 @@ public final class CL {
// =============================================================================
- /*
- * ============== CL_FixUpGender_f ==============
+ /**
+ * FixUpGender_f
*/
static void FixUpGender() {
@@ -1269,8 +1245,8 @@ public final class CL {
+ CL.precache_spawncount + "\n");
}
- /*
- * ================= CL_InitLocal =================
+ /**
+ * InitLocal
*/
public static void InitLocal() {
Globals.cls.state = Defines.ca_disconnected;
@@ -1419,10 +1395,10 @@ public final class CL {
}
- /*
- * =============== CL_WriteConfiguration
+ /**
+ * WriteConfiguration
*
- * Writes key bindings and archived cvars to config.cfg ===============
+ * Writes key bindings and archived cvars to config.cfg.
*/
public static void WriteConfiguration() {
RandomAccessFile f;
@@ -1452,6 +1428,9 @@ public final class CL {
Cvar.WriteVariables(path);
}
+ /**
+ * FixCvarCheats
+ */
public static void FixCvarCheats() {
int i;
CL.cheatvar_t var;
@@ -1480,12 +1459,10 @@ public final class CL {
}
}
- // ============================================================================
+ // =============================================================
- /*
- * ================== CL_SendCommand
- *
- * ==================
+ /**
+ * SendCommand
*/
public static void SendCommand() {
// get new key events
@@ -1509,6 +1486,9 @@ public final class CL {
// private static int lasttimecalled;
+ /**
+ * Frame
+ */
public static void Frame(int msec) {
if (Globals.dedicated.value != 0)
@@ -1583,6 +1563,9 @@ public final class CL {
}
}
+ /**
+ * Shutdown
+ */
public static void Shutdown() {
if (isdown) {
@@ -1599,7 +1582,7 @@ public final class CL {
}
/**
- * initialize client subsystem
+ * Initialize client subsystem.
*/
public static void Init() {
if (Globals.dedicated.value != 0.0f)