Merge branch 'dev' into dev-baseq2
# Conflicts: # src/lwjake2/client/CL.java # src/lwjake2/client/Console.java # src/lwjake2/client/V.java # src/lwjake2/game/Cmd.java
This commit is contained in:
@@ -37,7 +37,6 @@ import lwjake2.qcommon.SZ;
|
||||
import lwjake2.qcommon.netadr_t;
|
||||
import lwjake2.qcommon.qfiles;
|
||||
import lwjake2.qcommon.sizebuf_t;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.server.SV_MAIN;
|
||||
import lwjake2.sound.S;
|
||||
import lwjake2.sys.IN;
|
||||
@@ -107,8 +106,8 @@ public final class CL {
|
||||
*
|
||||
* Stop recording a demo.
|
||||
*/
|
||||
static xcommand_t Stop_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Stop_f = new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
int len;
|
||||
@@ -138,8 +137,8 @@ public final class CL {
|
||||
* record <demoname>
|
||||
* Begins recording a demo from the current position.
|
||||
*/
|
||||
static xcommand_t Record_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Record_f = new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
String name;
|
||||
byte buf_data[] = new byte[Defines.MAX_MSGLEN];
|
||||
@@ -248,8 +247,8 @@ public final class CL {
|
||||
/**
|
||||
* ForwardToServer_f
|
||||
*/
|
||||
static xcommand_t ForwardToServer_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable ForwardToServer_f = new Runnable() {
|
||||
public void run() {
|
||||
if (Globals.cls.state != Defines.ca_connected
|
||||
&& Globals.cls.state != Defines.ca_active) {
|
||||
logger.warn("Can't \"{}\", not connected", Cmd.Argv(0));
|
||||
@@ -268,8 +267,8 @@ public final class CL {
|
||||
/**
|
||||
* Pause_f
|
||||
*/
|
||||
static xcommand_t Pause_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Pause_f = new Runnable() {
|
||||
public void run() {
|
||||
// never pause in multiplayer
|
||||
|
||||
if (Cvar.VariableValue("maxclients") > 1
|
||||
@@ -285,8 +284,8 @@ public final class CL {
|
||||
/**
|
||||
* Quit_f
|
||||
*/
|
||||
static xcommand_t Quit_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Quit_f = new Runnable() {
|
||||
public void run() {
|
||||
Disconnect();
|
||||
Com.Quit();
|
||||
}
|
||||
@@ -295,8 +294,8 @@ public final class CL {
|
||||
/**
|
||||
* Connect_f
|
||||
*/
|
||||
static xcommand_t Connect_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Connect_f = new Runnable() {
|
||||
public void run() {
|
||||
String server;
|
||||
|
||||
if (Cmd.Argc() != 2) {
|
||||
@@ -330,8 +329,8 @@ public final class CL {
|
||||
*
|
||||
* Send the rest of the command line over as an unconnected command.
|
||||
*/
|
||||
static xcommand_t Rcon_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Rcon_f = new Runnable() {
|
||||
public void run() {
|
||||
|
||||
if (Globals.rcon_client_password.string.length() == 0) {
|
||||
logger.warn("You must set 'rcon_password' before\nissuing an rcon command.");
|
||||
@@ -376,8 +375,8 @@ public final class CL {
|
||||
}
|
||||
};
|
||||
|
||||
static xcommand_t Disconnect_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Disconnect_f = new Runnable() {
|
||||
public void run() {
|
||||
Com.Error(Defines.ERR_DROP, "Disconnected from server");
|
||||
}
|
||||
};
|
||||
@@ -387,8 +386,8 @@ public final class CL {
|
||||
*
|
||||
* 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() {
|
||||
static Runnable Changing_f = new Runnable() {
|
||||
public void run() {
|
||||
//ZOID
|
||||
//if we are downloading, we don't change!
|
||||
// This so we don't suddenly stop downloading a map
|
||||
@@ -408,8 +407,8 @@ public final class CL {
|
||||
*
|
||||
* The server is changing levels.
|
||||
*/
|
||||
static xcommand_t Reconnect_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Reconnect_f = new Runnable() {
|
||||
public void run() {
|
||||
//ZOID
|
||||
//if we are downloading, we don't change! This so we don't suddenly
|
||||
// stop downloading a map
|
||||
@@ -442,8 +441,8 @@ public final class CL {
|
||||
/**
|
||||
* PingServers_f
|
||||
*/
|
||||
static xcommand_t PingServers_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable PingServers_f = new Runnable() {
|
||||
public void run() {
|
||||
int i;
|
||||
netadr_t adr = new netadr_t();
|
||||
//char name[32];
|
||||
@@ -503,8 +502,8 @@ public final class CL {
|
||||
*
|
||||
* Load or download any custom player skins and models.
|
||||
*/
|
||||
static xcommand_t Skins_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Skins_f = new Runnable() {
|
||||
public void run() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < Defines.MAX_CLIENTS; i++) {
|
||||
@@ -521,8 +520,8 @@ public final class CL {
|
||||
/**
|
||||
* Userinfo_f
|
||||
*/
|
||||
static xcommand_t Userinfo_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Userinfo_f = new Runnable() {
|
||||
public void run() {
|
||||
logger.info("User info settings:");
|
||||
Info.Print(Cvar.Userinfo());
|
||||
}
|
||||
@@ -534,8 +533,8 @@ public final class CL {
|
||||
* Restart the sound subsystem so it can pick up new parameters and flush
|
||||
* all sounds.
|
||||
*/
|
||||
static xcommand_t Snd_Restart_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Snd_Restart_f = new Runnable() {
|
||||
public void run() {
|
||||
S.Shutdown();
|
||||
S.Init();
|
||||
CL_parse.RegisterSounds();
|
||||
@@ -554,8 +553,8 @@ public final class CL {
|
||||
* The server will send this command right before allowing the client into
|
||||
* the server.
|
||||
*/
|
||||
static xcommand_t Precache_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Precache_f = new Runnable() {
|
||||
public void run() {
|
||||
// Yet another hack to let old demos work the old precache sequence.
|
||||
if (Cmd.Argc() < 2) {
|
||||
|
||||
@@ -733,7 +732,7 @@ public final class CL {
|
||||
SCR.StopCinematic();
|
||||
|
||||
if (Globals.cls.demorecording)
|
||||
Stop_f.execute();
|
||||
Stop_f.run();
|
||||
|
||||
// send a disconnect message to the server
|
||||
fin = (char) Defines.clc_stringcmd + "disconnect";
|
||||
|
||||
@@ -29,7 +29,6 @@ import lwjake2.qcommon.MSG;
|
||||
import lwjake2.qcommon.Netchan;
|
||||
import lwjake2.qcommon.SZ;
|
||||
import lwjake2.qcommon.sizebuf_t;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.sys.IN;
|
||||
import lwjake2.util.Lib;
|
||||
import lwjake2.util.Math3D;
|
||||
@@ -487,164 +486,164 @@ public class CL_input {
|
||||
* ============ CL_InitInput ============
|
||||
*/
|
||||
static void InitInput() {
|
||||
Cmd.AddCommand("centerview", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("centerview", new Runnable() {
|
||||
public void run() {
|
||||
IN.CenterView();
|
||||
}
|
||||
});
|
||||
|
||||
Cmd.AddCommand("+moveup", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+moveup", new Runnable() {
|
||||
public void run() {
|
||||
IN_UpDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-moveup", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-moveup", new Runnable() {
|
||||
public void run() {
|
||||
IN_UpUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+movedown", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+movedown", new Runnable() {
|
||||
public void run() {
|
||||
IN_DownDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-movedown", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-movedown", new Runnable() {
|
||||
public void run() {
|
||||
IN_DownUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+left", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+left", new Runnable() {
|
||||
public void run() {
|
||||
IN_LeftDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-left", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-left", new Runnable() {
|
||||
public void run() {
|
||||
IN_LeftUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+right", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+right", new Runnable() {
|
||||
public void run() {
|
||||
IN_RightDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-right", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-right", new Runnable() {
|
||||
public void run() {
|
||||
IN_RightUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+forward", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+forward", new Runnable() {
|
||||
public void run() {
|
||||
IN_ForwardDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-forward", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-forward", new Runnable() {
|
||||
public void run() {
|
||||
IN_ForwardUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+back", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+back", new Runnable() {
|
||||
public void run() {
|
||||
IN_BackDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-back", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-back", new Runnable() {
|
||||
public void run() {
|
||||
IN_BackUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+lookup", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+lookup", new Runnable() {
|
||||
public void run() {
|
||||
IN_LookupDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-lookup", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-lookup", new Runnable() {
|
||||
public void run() {
|
||||
IN_LookupUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+lookdown", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+lookdown", new Runnable() {
|
||||
public void run() {
|
||||
IN_LookdownDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-lookdown", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-lookdown", new Runnable() {
|
||||
public void run() {
|
||||
IN_LookdownUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+strafe", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+strafe", new Runnable() {
|
||||
public void run() {
|
||||
IN_StrafeDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-strafe", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-strafe", new Runnable() {
|
||||
public void run() {
|
||||
IN_StrafeUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+moveleft", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+moveleft", new Runnable() {
|
||||
public void run() {
|
||||
IN_MoveleftDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-moveleft", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-moveleft", new Runnable() {
|
||||
public void run() {
|
||||
IN_MoveleftUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+moveright", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+moveright", new Runnable() {
|
||||
public void run() {
|
||||
IN_MoverightDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-moveright", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-moveright", new Runnable() {
|
||||
public void run() {
|
||||
IN_MoverightUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+speed", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+speed", new Runnable() {
|
||||
public void run() {
|
||||
IN_SpeedDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-speed", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-speed", new Runnable() {
|
||||
public void run() {
|
||||
IN_SpeedUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+attack", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+attack", new Runnable() {
|
||||
public void run() {
|
||||
IN_AttackDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-attack", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-attack", new Runnable() {
|
||||
public void run() {
|
||||
IN_AttackUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+use", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+use", new Runnable() {
|
||||
public void run() {
|
||||
IN_UseDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-use", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-use", new Runnable() {
|
||||
public void run() {
|
||||
IN_UseUp();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("impulse", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("impulse", new Runnable() {
|
||||
public void run() {
|
||||
IN_Impulse();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("+klook", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+klook", new Runnable() {
|
||||
public void run() {
|
||||
IN_KLookDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-klook", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-klook", new Runnable() {
|
||||
public void run() {
|
||||
IN_KLookUp();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -30,7 +30,6 @@ import lwjake2.qcommon.FileSystem;
|
||||
import lwjake2.qcommon.BaseQ2FileSystem;
|
||||
import lwjake2.qcommon.MSG;
|
||||
import lwjake2.qcommon.SZ;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.render.model_t;
|
||||
import lwjake2.sound.S;
|
||||
import lwjake2.sys.Sys;
|
||||
@@ -136,8 +135,8 @@ public class CL_parse {
|
||||
*
|
||||
* Request a download from the server ===============
|
||||
*/
|
||||
public static xcommand_t Download_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
public static Runnable Download_f = new Runnable() {
|
||||
public void run() {
|
||||
String filename;
|
||||
|
||||
if (Cmd.Argc() != 2) {
|
||||
|
||||
@@ -26,7 +26,6 @@ import lwjake2.qcommon.Com;
|
||||
import lwjake2.qcommon.Cvar;
|
||||
import lwjake2.qcommon.FileSystem;
|
||||
import lwjake2.qcommon.BaseQ2FileSystem;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.util.Lib;
|
||||
import lwjake2.util.Vargs;
|
||||
import org.slf4j.Logger;
|
||||
@@ -42,8 +41,8 @@ import java.util.Arrays;
|
||||
public final class Console extends Globals {
|
||||
private static final Logger logger = LoggerFactory.getLogger(Console.class);
|
||||
private static final FileSystem fileSystem = BaseQ2FileSystem.getInstance();
|
||||
public static xcommand_t ToggleConsole_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
public static Runnable ToggleConsole_f = new Runnable() {
|
||||
public void run() {
|
||||
SCR.EndLoadingPlaque(); // get rid of loading plaque
|
||||
|
||||
if (Globals.cl.attractloop) {
|
||||
@@ -74,14 +73,14 @@ public final class Console extends Globals {
|
||||
}
|
||||
};
|
||||
|
||||
public static xcommand_t Clear_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
public static Runnable Clear_f = new Runnable() {
|
||||
public void run() {
|
||||
Arrays.fill(Globals.con.text, (byte) ' ');
|
||||
}
|
||||
};
|
||||
|
||||
public static xcommand_t Dump_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
public static Runnable Dump_f = new Runnable() {
|
||||
public void run() {
|
||||
|
||||
int l, x;
|
||||
int line;
|
||||
@@ -247,8 +246,8 @@ public final class Console extends Globals {
|
||||
/*
|
||||
* ================ Con_ToggleChat_f ================
|
||||
*/
|
||||
static xcommand_t ToggleChat_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable ToggleChat_f = new Runnable() {
|
||||
public void run() {
|
||||
Key.ClearTyping();
|
||||
|
||||
if (cls.key_dest == key_console) {
|
||||
@@ -266,8 +265,8 @@ public final class Console extends Globals {
|
||||
/*
|
||||
* ================ Con_MessageMode_f ================
|
||||
*/
|
||||
static xcommand_t MessageMode_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable MessageMode_f = new Runnable() {
|
||||
public void run() {
|
||||
chat_team = false;
|
||||
cls.key_dest = key_message;
|
||||
}
|
||||
@@ -276,8 +275,8 @@ public final class Console extends Globals {
|
||||
/*
|
||||
* ================ Con_MessageMode2_f ================
|
||||
*/
|
||||
static xcommand_t MessageMode2_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable MessageMode2_f = new Runnable() {
|
||||
public void run() {
|
||||
chat_team = true;
|
||||
cls.key_dest = key_message;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import lwjake2.game.Cmd;
|
||||
import lwjake2.qcommon.Cbuf;
|
||||
import lwjake2.qcommon.Com;
|
||||
import lwjake2.qcommon.Cvar;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.util.Lib;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -320,7 +319,7 @@ public class Key extends Globals {
|
||||
if (!down)
|
||||
return;
|
||||
|
||||
Console.ToggleConsole_f.execute();
|
||||
Console.ToggleConsole_f.run();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -717,8 +716,8 @@ public class Key extends Globals {
|
||||
return;
|
||||
}
|
||||
|
||||
public static xcommand_t Bind_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
public static Runnable Bind_f = new Runnable() {
|
||||
public void run() {
|
||||
Key_Bind_f();
|
||||
}
|
||||
};
|
||||
@@ -765,8 +764,8 @@ public class Key extends Globals {
|
||||
Globals.keybindings[keynum] = binding;
|
||||
}
|
||||
|
||||
static xcommand_t Unbind_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Unbind_f = new Runnable() {
|
||||
public void run() {
|
||||
Key_Unbind_f();
|
||||
}
|
||||
};
|
||||
@@ -787,8 +786,8 @@ public class Key extends Globals {
|
||||
Key.SetBinding(b, null);
|
||||
}
|
||||
|
||||
static xcommand_t Unbindall_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Unbindall_f = new Runnable() {
|
||||
public void run() {
|
||||
Key_Unbindall_f();
|
||||
}
|
||||
};
|
||||
@@ -798,8 +797,8 @@ public class Key extends Globals {
|
||||
Key.SetBinding(i, null);
|
||||
}
|
||||
|
||||
static xcommand_t Bindlist_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Bindlist_f = new Runnable() {
|
||||
public void run() {
|
||||
Key_Bindlist_f();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -26,7 +26,6 @@ import lwjake2.qcommon.Com;
|
||||
import lwjake2.qcommon.Cvar;
|
||||
import lwjake2.qcommon.FS;
|
||||
import lwjake2.qcommon.netadr_t;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.sound.S;
|
||||
import lwjake2.sys.NET;
|
||||
import lwjake2.sys.Sys;
|
||||
@@ -66,7 +65,7 @@ public final class Menu extends Key {
|
||||
|
||||
// won't disrupt the sound
|
||||
|
||||
static xcommand_t m_drawfunc;
|
||||
static Runnable m_drawfunc;
|
||||
|
||||
static keyfunc_t m_keyfunc;
|
||||
|
||||
@@ -76,7 +75,7 @@ public final class Menu extends Key {
|
||||
public final static int MAX_MENU_DEPTH = 8;
|
||||
|
||||
public static class menulayer_t {
|
||||
xcommand_t draw;
|
||||
Runnable draw;
|
||||
|
||||
keyfunc_t key;
|
||||
}
|
||||
@@ -181,7 +180,7 @@ public final class Menu extends Key {
|
||||
viddef.height / 2 - 110, name);
|
||||
}
|
||||
|
||||
static void PushMenu(xcommand_t draw, keyfunc_t key) { //, String(*key)
|
||||
static void PushMenu(Runnable draw, keyfunc_t key) { //, String(*key)
|
||||
// (int k) ) {
|
||||
int i;
|
||||
|
||||
@@ -435,8 +434,8 @@ public final class Menu extends Key {
|
||||
*/
|
||||
static final int MAIN_ITEMS = 5;
|
||||
|
||||
static xcommand_t Main_Draw = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Main_Draw = new Runnable() {
|
||||
public void run() {
|
||||
Main_Draw();
|
||||
}
|
||||
};
|
||||
@@ -540,15 +539,15 @@ public final class Menu extends Key {
|
||||
return null;
|
||||
}
|
||||
|
||||
static xcommand_t Menu_Main = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_Main = new Runnable() {
|
||||
public void run() {
|
||||
Menu_Main_f();
|
||||
}
|
||||
};
|
||||
|
||||
static void Menu_Main_f() {
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
Main_Draw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -642,16 +641,16 @@ public final class Menu extends Key {
|
||||
return Default_MenuKey(s_multiplayer_menu, key);
|
||||
}
|
||||
|
||||
static xcommand_t Menu_Multiplayer = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_Multiplayer = new Runnable() {
|
||||
public void run() {
|
||||
Menu_Multiplayer_f();
|
||||
}
|
||||
};
|
||||
|
||||
static void Menu_Multiplayer_f() {
|
||||
Multiplayer_MenuInit();
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
Multiplayer_MenuDraw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -1154,8 +1153,8 @@ public final class Menu extends Key {
|
||||
Menu_Center(s_keys_menu);
|
||||
}
|
||||
|
||||
static xcommand_t Keys_MenuDraw = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Keys_MenuDraw = new Runnable() {
|
||||
public void run() {
|
||||
Keys_MenuDraw_f();
|
||||
}
|
||||
};
|
||||
@@ -1207,16 +1206,16 @@ public final class Menu extends Key {
|
||||
}
|
||||
}
|
||||
|
||||
static xcommand_t Menu_Keys = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_Keys = new Runnable() {
|
||||
public void run() {
|
||||
Menu_Keys_f();
|
||||
}
|
||||
};
|
||||
|
||||
static void Menu_Keys_f() {
|
||||
Keys_MenuInit();
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
Keys_MenuDraw_f();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -1420,7 +1419,7 @@ public final class Menu extends Key {
|
||||
// the text box won't show up unless we do a buffer swap
|
||||
re.EndFrame();
|
||||
|
||||
CL.Snd_Restart_f.execute();
|
||||
CL.Snd_Restart_f.run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1650,16 +1649,16 @@ public final class Menu extends Key {
|
||||
return Default_MenuKey(s_options_menu, key);
|
||||
}
|
||||
|
||||
static xcommand_t Menu_Options = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_Options = new Runnable() {
|
||||
public void run() {
|
||||
Menu_Options_f();
|
||||
}
|
||||
};
|
||||
|
||||
static void Menu_Options_f() {
|
||||
Options_MenuInit();
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
Options_MenuDraw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -1677,16 +1676,16 @@ public final class Menu extends Key {
|
||||
* =======================================================================
|
||||
*/
|
||||
|
||||
static xcommand_t Menu_Video = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_Video = new Runnable() {
|
||||
public void run() {
|
||||
Menu_Video_f();
|
||||
}
|
||||
};
|
||||
|
||||
static void Menu_Video_f() {
|
||||
VID.MenuInit();
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
VID.MenuDraw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -1897,8 +1896,8 @@ public final class Menu extends Key {
|
||||
|
||||
}
|
||||
|
||||
static xcommand_t Menu_Credits = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_Credits = new Runnable() {
|
||||
public void run() {
|
||||
Menu_Credits_f();
|
||||
}
|
||||
};
|
||||
@@ -1933,8 +1932,8 @@ public final class Menu extends Key {
|
||||
}
|
||||
|
||||
credits_start_time = cls.realtime;
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
Credits_MenuDraw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -2108,16 +2107,16 @@ public final class Menu extends Key {
|
||||
return Default_MenuKey(s_game_menu, key);
|
||||
}
|
||||
|
||||
static xcommand_t Menu_Game = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_Game = new Runnable() {
|
||||
public void run() {
|
||||
Menu_Game_f();
|
||||
}
|
||||
};
|
||||
|
||||
static void Menu_Game_f() {
|
||||
Game_MenuInit();
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
Game_MenuDraw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -2238,16 +2237,16 @@ public final class Menu extends Key {
|
||||
return Default_MenuKey(s_loadgame_menu, key);
|
||||
}
|
||||
|
||||
static xcommand_t Menu_LoadGame = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_LoadGame = new Runnable() {
|
||||
public void run() {
|
||||
Menu_LoadGame_f();
|
||||
}
|
||||
};
|
||||
|
||||
static void Menu_LoadGame_f() {
|
||||
LoadGame_MenuInit();
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
LoadGame_MenuDraw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -2324,8 +2323,8 @@ public final class Menu extends Key {
|
||||
return Default_MenuKey(s_savegame_menu, key);
|
||||
}
|
||||
|
||||
static xcommand_t Menu_SaveGame = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_SaveGame = new Runnable() {
|
||||
public void run() {
|
||||
Menu_SaveGame_f();
|
||||
}
|
||||
};
|
||||
@@ -2335,8 +2334,8 @@ public final class Menu extends Key {
|
||||
return; // not playing a game
|
||||
|
||||
SaveGame_MenuInit();
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
SaveGame_MenuDraw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -2443,7 +2442,7 @@ public final class Menu extends Key {
|
||||
re.EndFrame();
|
||||
|
||||
// send out info packets
|
||||
CL.PingServers_f.execute();
|
||||
CL.PingServers_f.run();
|
||||
}
|
||||
|
||||
static void SearchLocalGamesFunc(Object self) {
|
||||
@@ -2520,16 +2519,16 @@ public final class Menu extends Key {
|
||||
return Default_MenuKey(s_joinserver_menu, key);
|
||||
}
|
||||
|
||||
static xcommand_t Menu_JoinServer = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_JoinServer = new Runnable() {
|
||||
public void run() {
|
||||
Menu_JoinServer_f();
|
||||
}
|
||||
};
|
||||
|
||||
static void Menu_JoinServer_f() {
|
||||
JoinServer_MenuInit();
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
JoinServer_MenuDraw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -2905,14 +2904,14 @@ public final class Menu extends Key {
|
||||
return Default_MenuKey(s_startserver_menu, key);
|
||||
}
|
||||
|
||||
static xcommand_t Menu_StartServer = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_StartServer = new Runnable() {
|
||||
public void run() {
|
||||
Menu_StartServer_f();
|
||||
}
|
||||
};
|
||||
|
||||
static xcommand_t startServer_MenuDraw = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable startServer_MenuDraw = new Runnable() {
|
||||
public void run() {
|
||||
StartServer_MenuDraw();
|
||||
}
|
||||
};
|
||||
@@ -3379,16 +3378,16 @@ public final class Menu extends Key {
|
||||
return Default_MenuKey(s_dmoptions_menu, key);
|
||||
}
|
||||
|
||||
static xcommand_t Menu_DMOptions = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_DMOptions = new Runnable() {
|
||||
public void run() {
|
||||
Menu_DMOptions_f();
|
||||
}
|
||||
};
|
||||
|
||||
static void Menu_DMOptions_f() {
|
||||
DMOptions_MenuInit();
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
DMOptions_MenuDraw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -3544,16 +3543,16 @@ public final class Menu extends Key {
|
||||
return Default_MenuKey(s_downloadoptions_menu, key);
|
||||
}
|
||||
|
||||
static xcommand_t Menu_DownloadOptions = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_DownloadOptions = new Runnable() {
|
||||
public void run() {
|
||||
Menu_DownloadOptions_f();
|
||||
}
|
||||
};
|
||||
|
||||
static void Menu_DownloadOptions_f() {
|
||||
DownloadOptions_MenuInit();
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
DownloadOptions_MenuDraw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -3619,8 +3618,8 @@ public final class Menu extends Key {
|
||||
return Default_MenuKey(s_addressbook_menu, key);
|
||||
}
|
||||
|
||||
static xcommand_t AddressBook_MenuDraw = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable AddressBook_MenuDraw = new Runnable() {
|
||||
public void run() {
|
||||
AddressBook_MenuDraw_f();
|
||||
}
|
||||
};
|
||||
@@ -3630,16 +3629,16 @@ public final class Menu extends Key {
|
||||
Menu_Draw(s_addressbook_menu);
|
||||
}
|
||||
|
||||
static xcommand_t Menu_AddressBook = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_AddressBook = new Runnable() {
|
||||
public void run() {
|
||||
Menu_AddressBook_f();
|
||||
}
|
||||
};
|
||||
|
||||
static void Menu_AddressBook_f() {
|
||||
AddressBook_MenuInit();
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
AddressBook_MenuDraw_f();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -4180,8 +4179,8 @@ public final class Menu extends Key {
|
||||
return Default_MenuKey(s_player_config_menu, key);
|
||||
}
|
||||
|
||||
static xcommand_t Menu_PlayerConfig = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_PlayerConfig = new Runnable() {
|
||||
public void run() {
|
||||
Menu_PlayerConfig_f();
|
||||
}
|
||||
};
|
||||
@@ -4193,8 +4192,8 @@ public final class Menu extends Key {
|
||||
return;
|
||||
}
|
||||
Menu_SetStatusBar(s_multiplayer_menu, null);
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
PlayerConfig_MenuDraw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -4223,7 +4222,7 @@ public final class Menu extends Key {
|
||||
case 'Y':
|
||||
case 'y':
|
||||
cls.key_dest = key_console;
|
||||
CL.Quit_f.execute();
|
||||
CL.Quit_f.run();
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -4243,15 +4242,15 @@ public final class Menu extends Key {
|
||||
re.DrawPic((viddef.width - w) / 2, (viddef.height - h) / 2, "quit");
|
||||
}
|
||||
|
||||
static xcommand_t Menu_Quit = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Menu_Quit = new Runnable() {
|
||||
public void run() {
|
||||
Menu_Quit_f();
|
||||
}
|
||||
};
|
||||
|
||||
static void Menu_Quit_f() {
|
||||
PushMenu(new xcommand_t() {
|
||||
public void execute() {
|
||||
PushMenu(new Runnable() {
|
||||
public void run() {
|
||||
Quit_Draw();
|
||||
}
|
||||
}, new keyfunc_t() {
|
||||
@@ -4306,7 +4305,7 @@ public final class Menu extends Key {
|
||||
else
|
||||
re.DrawFadeScreen();
|
||||
|
||||
m_drawfunc.execute();
|
||||
m_drawfunc.run();
|
||||
|
||||
// delay playing the enter sound until after the
|
||||
// menu has been drawn, to avoid delay while
|
||||
|
||||
@@ -28,7 +28,6 @@ import lwjake2.qcommon.FS;
|
||||
import lwjake2.qcommon.MSG;
|
||||
import lwjake2.qcommon.SZ;
|
||||
import lwjake2.qcommon.qfiles;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.sound.S;
|
||||
import lwjake2.sys.Timer;
|
||||
import lwjake2.util.Lib;
|
||||
@@ -439,28 +438,28 @@ public final class SCR extends Globals {
|
||||
//
|
||||
// register our commands
|
||||
//
|
||||
Cmd.AddCommand("timerefresh", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("timerefresh", new Runnable() {
|
||||
public void run() {
|
||||
TimeRefresh_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("loading", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("loading", new Runnable() {
|
||||
public void run() {
|
||||
Loading_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("sizeup", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("sizeup", new Runnable() {
|
||||
public void run() {
|
||||
SizeUp_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("sizedown", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("sizedown", new Runnable() {
|
||||
public void run() {
|
||||
SizeDown_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("sky", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("sky", new Runnable() {
|
||||
public void run() {
|
||||
Sky_f();
|
||||
}
|
||||
});
|
||||
@@ -1302,8 +1301,8 @@ public final class SCR extends Globals {
|
||||
crosshair_pic);
|
||||
}
|
||||
|
||||
private static xcommand_t updateScreenCallback = new xcommand_t() {
|
||||
public void execute() {
|
||||
private static Runnable updateScreenCallback = new Runnable() {
|
||||
public void run() {
|
||||
UpdateScreen2();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,7 +23,6 @@ import lwjake2.game.Cmd;
|
||||
import lwjake2.game.cvar_t;
|
||||
import lwjake2.qcommon.Com;
|
||||
import lwjake2.qcommon.Cvar;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.sys.Timer;
|
||||
import lwjake2.util.Math3D;
|
||||
import lwjake2.util.Vargs;
|
||||
@@ -238,15 +237,15 @@ public final class V extends Globals {
|
||||
}
|
||||
}
|
||||
|
||||
static xcommand_t Gun_Next_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Gun_Next_f = new Runnable() {
|
||||
public void run() {
|
||||
gun_frame++;
|
||||
Com.Printf("frame " + gun_frame + "\n");
|
||||
}
|
||||
};
|
||||
|
||||
static xcommand_t Gun_Prev_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Gun_Prev_f = new Runnable() {
|
||||
public void run() {
|
||||
gun_frame--;
|
||||
if (gun_frame < 0)
|
||||
gun_frame = 0;
|
||||
@@ -254,8 +253,8 @@ public final class V extends Globals {
|
||||
}
|
||||
};
|
||||
|
||||
static xcommand_t Gun_Model_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Gun_Model_f = new Runnable() {
|
||||
public void run() {
|
||||
if (Cmd.Argc() != 2) {
|
||||
gun_model = null;
|
||||
return;
|
||||
@@ -381,8 +380,8 @@ public final class V extends Globals {
|
||||
/*
|
||||
* ============= V_Viewpos_f =============
|
||||
*/
|
||||
static xcommand_t Viewpos_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Viewpos_f = new Runnable() {
|
||||
public void run() {
|
||||
logger.info("({} {} {}) : {}",
|
||||
(int) cl.refdef.vieworg[0],
|
||||
(int) cl.refdef.vieworg[1],
|
||||
|
||||
@@ -24,7 +24,6 @@ import lwjake2.game.Cmd;
|
||||
import lwjake2.game.cvar_t;
|
||||
import lwjake2.qcommon.Com;
|
||||
import lwjake2.qcommon.Cvar;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.render.Renderer;
|
||||
import lwjake2.sound.S;
|
||||
import lwjake2.sys.IN;
|
||||
@@ -290,7 +289,7 @@ public class VID extends Globals {
|
||||
if ( Globals.cls.key_dest != Defines.key_console )
|
||||
{
|
||||
try {
|
||||
Console.ToggleConsole_f.execute();
|
||||
Console.ToggleConsole_f.run();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
@@ -319,8 +318,8 @@ public class VID extends Globals {
|
||||
vid_modes[11].height = (int)vid_height.value;
|
||||
|
||||
/* Add some console commands that we want to handle */
|
||||
Cmd.AddCommand ("vid_restart", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand ("vid_restart", new Runnable() {
|
||||
public void run() {
|
||||
Restart_f();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package lwjake2.client;
|
||||
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.render.image_t;
|
||||
import lwjake2.render.model_t;
|
||||
import lwjake2.sys.KBD;
|
||||
@@ -95,7 +94,7 @@ public interface refexport_t {
|
||||
*
|
||||
*
|
||||
*/
|
||||
void updateScreen(xcommand_t callback);
|
||||
void updateScreen(Runnable callback);
|
||||
|
||||
int apiVersion();
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import lwjake2.qcommon.FS;
|
||||
import lwjake2.qcommon.MSG;
|
||||
import lwjake2.qcommon.SZ;
|
||||
import lwjake2.qcommon.cmd_function_t;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.server.SV_GAME;
|
||||
import lwjake2.util.Lib;
|
||||
import org.slf4j.Logger;
|
||||
@@ -43,8 +42,8 @@ import java.util.Vector;
|
||||
*/
|
||||
public final class Cmd {
|
||||
private static final Logger logger = LoggerFactory.getLogger(Cmd.class);
|
||||
static xcommand_t List_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable List_f = new Runnable() {
|
||||
public void run() {
|
||||
cmd_function_t cmd = Cmd.cmd_functions;
|
||||
int i = 0;
|
||||
|
||||
@@ -57,8 +56,8 @@ public final class Cmd {
|
||||
}
|
||||
};
|
||||
|
||||
static xcommand_t Exec_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Exec_f = new Runnable() {
|
||||
public void run() {
|
||||
if (Cmd.Argc() != 2) {
|
||||
logger.info("exec <filename> : execute a script file");
|
||||
return;
|
||||
@@ -78,8 +77,8 @@ public final class Cmd {
|
||||
}
|
||||
};
|
||||
|
||||
static xcommand_t Echo_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Echo_f = new Runnable() {
|
||||
public void run() {
|
||||
StringBuilder sb = new StringBuilder(Cmd.Argc());
|
||||
for (int i = 1; i < Cmd.Argc(); i++) {
|
||||
sb.append(Cmd.Argv(i)).append(' ');
|
||||
@@ -88,8 +87,8 @@ public final class Cmd {
|
||||
}
|
||||
};
|
||||
|
||||
static xcommand_t Alias_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Alias_f = new Runnable() {
|
||||
public void run() {
|
||||
cmdalias_t a = null;
|
||||
if (Cmd.Argc() == 1) {
|
||||
logger.info("Current alias commands:");
|
||||
@@ -134,8 +133,8 @@ public final class Cmd {
|
||||
}
|
||||
};
|
||||
|
||||
public static xcommand_t Wait_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
public static Runnable Wait_f = new Runnable() {
|
||||
public void run() {
|
||||
Globals.cmd_wait = true;
|
||||
}
|
||||
};
|
||||
@@ -306,7 +305,7 @@ public final class Cmd {
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddCommand(String cmd_name, xcommand_t function) {
|
||||
public static void AddCommand(String cmd_name, Runnable function) {
|
||||
cmd_function_t cmd;
|
||||
//Com.DPrintf("Cmd_AddCommand: " + cmd_name + "\n");
|
||||
// fail if the command is a variable name
|
||||
@@ -408,7 +407,7 @@ public final class Cmd {
|
||||
if (null == cmd.function) { // forward to server command
|
||||
Cmd.ExecuteString("cmd " + text);
|
||||
} else {
|
||||
cmd.function.execute();
|
||||
cmd.function.run();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -241,9 +241,9 @@ public final class Com
|
||||
return new String(com_token, 0, len);
|
||||
}
|
||||
|
||||
public static xcommand_t Error_f= new xcommand_t()
|
||||
public static Runnable Error_f= new Runnable()
|
||||
{
|
||||
public void execute() throws longjmpException
|
||||
public void run() throws longjmpException
|
||||
{
|
||||
Error(Defines.ERR_FATAL, Cmd.Argv(1));
|
||||
}
|
||||
|
||||
@@ -229,8 +229,8 @@ public class Cvar extends Globals {
|
||||
* Set command, sets variables.
|
||||
*/
|
||||
|
||||
static xcommand_t Set_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable Set_f = new Runnable() {
|
||||
public void run() {
|
||||
int c;
|
||||
int flags;
|
||||
|
||||
@@ -260,8 +260,8 @@ public class Cvar extends Globals {
|
||||
/**
|
||||
* List command, lists all available commands.
|
||||
*/
|
||||
static xcommand_t List_f = new xcommand_t() {
|
||||
public void execute() {
|
||||
static Runnable List_f = new Runnable() {
|
||||
public void run() {
|
||||
cvar_t var;
|
||||
int i;
|
||||
|
||||
|
||||
@@ -880,18 +880,18 @@ public final class FS extends Globals {
|
||||
* InitFilesystem
|
||||
*/
|
||||
public static void InitFilesystem() {
|
||||
Cmd.AddCommand("path", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("path", new Runnable() {
|
||||
public void run() {
|
||||
Path_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("link", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("link", new Runnable() {
|
||||
public void run() {
|
||||
Link_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("dir", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("dir", new Runnable() {
|
||||
public void run() {
|
||||
Dir_f();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -24,5 +24,5 @@ package lwjake2.qcommon;
|
||||
public final class cmd_function_t {
|
||||
public cmd_function_t next = null;
|
||||
public String name = null;
|
||||
public xcommand_t function;
|
||||
public Runnable function;
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* See the GNU General Public License for more details.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
package lwjake2.qcommon;
|
||||
|
||||
/**
|
||||
* xcommand_t
|
||||
*/
|
||||
public abstract class xcommand_t {
|
||||
|
||||
abstract public void execute();
|
||||
}
|
||||
@@ -20,7 +20,6 @@ package lwjake2.render;
|
||||
|
||||
import lwjake2.client.refdef_t;
|
||||
import lwjake2.client.refexport_t;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.sys.KBD;
|
||||
|
||||
import java.awt.Dimension;
|
||||
@@ -164,10 +163,10 @@ public class DummyRenderer implements refexport_t {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see jake2.client.refexport_t#updateScreen(jake2.qcommon.xcommand_t)
|
||||
* @see jake2.client.refexport_t#updateScreen(java.lang.Runnable)
|
||||
*/
|
||||
public void updateScreen(xcommand_t callback) {
|
||||
callback.execute();
|
||||
public void updateScreen(Runnable callback) {
|
||||
callback.run();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
||||
@@ -22,7 +22,6 @@ import lwjake2.Defines;
|
||||
import lwjake2.client.VID;
|
||||
import lwjake2.client.viddef_t;
|
||||
import lwjake2.game.cvar_t;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.util.ArrayList;
|
||||
@@ -346,7 +345,7 @@ public abstract class LWJGLBase {
|
||||
* this is a hack for jogl renderers.
|
||||
* @param callback
|
||||
*/
|
||||
public final void updateScreen(xcommand_t callback) {
|
||||
callback.execute();
|
||||
public final void updateScreen(Runnable callback) {
|
||||
callback.run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ import lwjake2.game.cvar_t;
|
||||
import lwjake2.qcommon.Com;
|
||||
import lwjake2.qcommon.Cvar;
|
||||
import lwjake2.qcommon.qfiles;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.render.glconfig_t;
|
||||
import lwjake2.render.glstate_t;
|
||||
import lwjake2.render.image_t;
|
||||
@@ -997,24 +996,24 @@ public abstract class Main extends Base {
|
||||
vid_gamma = Cvar.Get("vid_gamma", "1.0", Globals.CVAR_ARCHIVE);
|
||||
vid_ref = Cvar.Get("vid_ref", "lwjgl", Globals.CVAR_ARCHIVE);
|
||||
|
||||
Cmd.AddCommand("imagelist", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("imagelist", new Runnable() {
|
||||
public void run() {
|
||||
GL_ImageList_f();
|
||||
}
|
||||
});
|
||||
|
||||
Cmd.AddCommand("screenshot", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("screenshot", new Runnable() {
|
||||
public void run() {
|
||||
GL_ScreenShot_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("modellist", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("modellist", new Runnable() {
|
||||
public void run() {
|
||||
Mod_Modellist_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("gl_strings", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("gl_strings", new Runnable() {
|
||||
public void run() {
|
||||
GL_Strings_f();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -35,7 +35,6 @@ import lwjake2.qcommon.Netchan;
|
||||
import lwjake2.qcommon.SZ;
|
||||
import lwjake2.qcommon.netadr_t;
|
||||
import lwjake2.qcommon.sizebuf_t;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.sys.NET;
|
||||
import lwjake2.sys.Sys;
|
||||
import lwjake2.util.Lib;
|
||||
@@ -1027,90 +1026,90 @@ public class SV_CCMDS {
|
||||
==================
|
||||
*/
|
||||
public static void SV_InitOperatorCommands() {
|
||||
Cmd.AddCommand("heartbeat", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("heartbeat", new Runnable() {
|
||||
public void run() {
|
||||
SV_Heartbeat_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("kick", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("kick", new Runnable() {
|
||||
public void run() {
|
||||
SV_Kick_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("status", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("status", new Runnable() {
|
||||
public void run() {
|
||||
SV_Status_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("serverinfo", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("serverinfo", new Runnable() {
|
||||
public void run() {
|
||||
SV_Serverinfo_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("dumpuser", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("dumpuser", new Runnable() {
|
||||
public void run() {
|
||||
SV_DumpUser_f();
|
||||
}
|
||||
});
|
||||
|
||||
Cmd.AddCommand("map", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("map", new Runnable() {
|
||||
public void run() {
|
||||
SV_Map_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("demomap", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("demomap", new Runnable() {
|
||||
public void run() {
|
||||
SV_DemoMap_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("gamemap", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("gamemap", new Runnable() {
|
||||
public void run() {
|
||||
SV_GameMap_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("setmaster", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("setmaster", new Runnable() {
|
||||
public void run() {
|
||||
SV_SetMaster_f();
|
||||
}
|
||||
});
|
||||
|
||||
if (Globals.dedicated.value != 0)
|
||||
Cmd.AddCommand("say", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("say", new Runnable() {
|
||||
public void run() {
|
||||
SV_ConSay_f();
|
||||
}
|
||||
});
|
||||
|
||||
Cmd.AddCommand("serverrecord", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("serverrecord", new Runnable() {
|
||||
public void run() {
|
||||
SV_ServerRecord_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("serverstop", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("serverstop", new Runnable() {
|
||||
public void run() {
|
||||
SV_ServerStop_f();
|
||||
}
|
||||
});
|
||||
|
||||
Cmd.AddCommand("save", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("save", new Runnable() {
|
||||
public void run() {
|
||||
SV_Savegame_f();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("load", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("load", new Runnable() {
|
||||
public void run() {
|
||||
SV_Loadgame_f();
|
||||
}
|
||||
});
|
||||
|
||||
Cmd.AddCommand("killserver", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("killserver", new Runnable() {
|
||||
public void run() {
|
||||
SV_KillServer_f();
|
||||
}
|
||||
});
|
||||
|
||||
Cmd.AddCommand("sv", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("sv", new Runnable() {
|
||||
public void run() {
|
||||
SV_ServerCommand_f();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -27,7 +27,6 @@ import lwjake2.game.entity_state_t;
|
||||
import lwjake2.qcommon.Com;
|
||||
import lwjake2.qcommon.Cvar;
|
||||
import lwjake2.qcommon.FS;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.sound.S;
|
||||
import lwjake2.sound.Sound;
|
||||
import lwjake2.sound.WaveLoader;
|
||||
@@ -101,23 +100,23 @@ public final class LWJGLSoundImpl implements Sound {
|
||||
int count = Channel.init(buffers);
|
||||
logger.info("... using {} channels", count);
|
||||
AL10.alDistanceModel(AL10.AL_INVERSE_DISTANCE_CLAMPED);
|
||||
Cmd.AddCommand("play", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("play", new Runnable() {
|
||||
public void run() {
|
||||
Play();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("stopsound", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("stopsound", new Runnable() {
|
||||
public void run() {
|
||||
StopAllSounds();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("soundlist", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("soundlist", new Runnable() {
|
||||
public void run() {
|
||||
SoundList();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("soundinfo", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("soundinfo", new Runnable() {
|
||||
public void run() {
|
||||
SoundInfo_f();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -24,7 +24,6 @@ import lwjake2.client.Key;
|
||||
import lwjake2.game.Cmd;
|
||||
import lwjake2.game.usercmd_t;
|
||||
import lwjake2.qcommon.Cvar;
|
||||
import lwjake2.qcommon.xcommand_t;
|
||||
import lwjake2.util.Math3D;
|
||||
|
||||
/**
|
||||
@@ -106,25 +105,25 @@ public final class IN extends Globals {
|
||||
Globals.m_forward = Cvar.Get("m_forward", "1", 0);
|
||||
Globals.m_side = Cvar.Get("m_side", "0.8", 0);
|
||||
|
||||
Cmd.AddCommand("+mlook", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("+mlook", new Runnable() {
|
||||
public void run() {
|
||||
MLookDown();
|
||||
}
|
||||
});
|
||||
Cmd.AddCommand("-mlook", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("-mlook", new Runnable() {
|
||||
public void run() {
|
||||
MLookUp();
|
||||
}
|
||||
});
|
||||
|
||||
Cmd.AddCommand("force_centerview", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("force_centerview", new Runnable() {
|
||||
public void run() {
|
||||
Force_CenterView_f();
|
||||
}
|
||||
});
|
||||
|
||||
Cmd.AddCommand("togglemouse", new xcommand_t() {
|
||||
public void execute() {
|
||||
Cmd.AddCommand("togglemouse", new Runnable() {
|
||||
public void run() {
|
||||
toggleMouse();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user