0

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:
2018-03-06 01:45:45 +03:00
22 changed files with 305 additions and 349 deletions

View File

@@ -37,7 +37,6 @@ import lwjake2.qcommon.SZ;
import lwjake2.qcommon.netadr_t; import lwjake2.qcommon.netadr_t;
import lwjake2.qcommon.qfiles; import lwjake2.qcommon.qfiles;
import lwjake2.qcommon.sizebuf_t; import lwjake2.qcommon.sizebuf_t;
import lwjake2.qcommon.xcommand_t;
import lwjake2.server.SV_MAIN; import lwjake2.server.SV_MAIN;
import lwjake2.sound.S; import lwjake2.sound.S;
import lwjake2.sys.IN; import lwjake2.sys.IN;
@@ -107,8 +106,8 @@ public final class CL {
* *
* Stop recording a demo. * Stop recording a demo.
*/ */
static xcommand_t Stop_f = new xcommand_t() { static Runnable Stop_f = new Runnable() {
public void execute() { public void run() {
try { try {
int len; int len;
@@ -138,8 +137,8 @@ public final class CL {
* record <demoname> * record <demoname>
* Begins recording a demo from the current position. * Begins recording a demo from the current position.
*/ */
static xcommand_t Record_f = new xcommand_t() { static Runnable Record_f = new Runnable() {
public void execute() { public void run() {
try { try {
String name; String name;
byte buf_data[] = new byte[Defines.MAX_MSGLEN]; byte buf_data[] = new byte[Defines.MAX_MSGLEN];
@@ -248,8 +247,8 @@ public final class CL {
/** /**
* ForwardToServer_f * ForwardToServer_f
*/ */
static xcommand_t ForwardToServer_f = new xcommand_t() { static Runnable ForwardToServer_f = new Runnable() {
public void execute() { public void run() {
if (Globals.cls.state != Defines.ca_connected if (Globals.cls.state != Defines.ca_connected
&& Globals.cls.state != Defines.ca_active) { && Globals.cls.state != Defines.ca_active) {
logger.warn("Can't \"{}\", not connected", Cmd.Argv(0)); logger.warn("Can't \"{}\", not connected", Cmd.Argv(0));
@@ -268,8 +267,8 @@ public final class CL {
/** /**
* Pause_f * Pause_f
*/ */
static xcommand_t Pause_f = new xcommand_t() { static Runnable Pause_f = new Runnable() {
public void execute() { public void run() {
// never pause in multiplayer // never pause in multiplayer
if (Cvar.VariableValue("maxclients") > 1 if (Cvar.VariableValue("maxclients") > 1
@@ -285,8 +284,8 @@ public final class CL {
/** /**
* Quit_f * Quit_f
*/ */
static xcommand_t Quit_f = new xcommand_t() { static Runnable Quit_f = new Runnable() {
public void execute() { public void run() {
Disconnect(); Disconnect();
Com.Quit(); Com.Quit();
} }
@@ -295,8 +294,8 @@ public final class CL {
/** /**
* Connect_f * Connect_f
*/ */
static xcommand_t Connect_f = new xcommand_t() { static Runnable Connect_f = new Runnable() {
public void execute() { public void run() {
String server; String server;
if (Cmd.Argc() != 2) { if (Cmd.Argc() != 2) {
@@ -330,8 +329,8 @@ public final class CL {
* *
* Send the rest of the command line over as an unconnected command. * Send the rest of the command line over as an unconnected command.
*/ */
static xcommand_t Rcon_f = new xcommand_t() { static Runnable Rcon_f = new Runnable() {
public void execute() { public void run() {
if (Globals.rcon_client_password.string.length() == 0) { if (Globals.rcon_client_password.string.length() == 0) {
logger.warn("You must set 'rcon_password' before\nissuing an rcon command."); 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() { static Runnable Disconnect_f = new Runnable() {
public void execute() { public void run() {
Com.Error(Defines.ERR_DROP, "Disconnected from server"); 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. * Just sent as a hint to the client that they should drop to full console.
*/ */
static xcommand_t Changing_f = new xcommand_t() { static Runnable Changing_f = new Runnable() {
public void execute() { public void run() {
//ZOID //ZOID
//if we are downloading, we don't change! //if we are downloading, we don't change!
// This so we don't suddenly stop downloading a map // This so we don't suddenly stop downloading a map
@@ -408,8 +407,8 @@ public final class CL {
* *
* The server is changing levels. * The server is changing levels.
*/ */
static xcommand_t Reconnect_f = new xcommand_t() { static Runnable Reconnect_f = new Runnable() {
public void execute() { public void run() {
//ZOID //ZOID
//if we are downloading, we don't change! This so we don't suddenly //if we are downloading, we don't change! This so we don't suddenly
// stop downloading a map // stop downloading a map
@@ -442,8 +441,8 @@ public final class CL {
/** /**
* PingServers_f * PingServers_f
*/ */
static xcommand_t PingServers_f = new xcommand_t() { static Runnable PingServers_f = new Runnable() {
public void execute() { public void run() {
int i; int i;
netadr_t adr = new netadr_t(); netadr_t adr = new netadr_t();
//char name[32]; //char name[32];
@@ -503,8 +502,8 @@ public final class CL {
* *
* 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() { static Runnable Skins_f = new Runnable() {
public void execute() { public void run() {
int i; int i;
for (i = 0; i < Defines.MAX_CLIENTS; i++) { for (i = 0; i < Defines.MAX_CLIENTS; i++) {
@@ -521,8 +520,8 @@ public final class CL {
/** /**
* Userinfo_f * Userinfo_f
*/ */
static xcommand_t Userinfo_f = new xcommand_t() { static Runnable Userinfo_f = new Runnable() {
public void execute() { public void run() {
logger.info("User info settings:"); logger.info("User info settings:");
Info.Print(Cvar.Userinfo()); 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 * 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() { static Runnable Snd_Restart_f = new Runnable() {
public void execute() { public void run() {
S.Shutdown(); S.Shutdown();
S.Init(); S.Init();
CL_parse.RegisterSounds(); 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 will send this command right before allowing the client into
* the server. * the server.
*/ */
static xcommand_t Precache_f = new xcommand_t() { static Runnable Precache_f = new Runnable() {
public void execute() { public void run() {
// Yet another hack to let old demos work the old precache sequence. // Yet another hack to let old demos work the old precache sequence.
if (Cmd.Argc() < 2) { if (Cmd.Argc() < 2) {
@@ -733,7 +732,7 @@ public final class CL {
SCR.StopCinematic(); SCR.StopCinematic();
if (Globals.cls.demorecording) if (Globals.cls.demorecording)
Stop_f.execute(); Stop_f.run();
// send a disconnect message to the server // send a disconnect message to the server
fin = (char) Defines.clc_stringcmd + "disconnect"; fin = (char) Defines.clc_stringcmd + "disconnect";

View File

@@ -29,7 +29,6 @@ import lwjake2.qcommon.MSG;
import lwjake2.qcommon.Netchan; import lwjake2.qcommon.Netchan;
import lwjake2.qcommon.SZ; import lwjake2.qcommon.SZ;
import lwjake2.qcommon.sizebuf_t; import lwjake2.qcommon.sizebuf_t;
import lwjake2.qcommon.xcommand_t;
import lwjake2.sys.IN; import lwjake2.sys.IN;
import lwjake2.util.Lib; import lwjake2.util.Lib;
import lwjake2.util.Math3D; import lwjake2.util.Math3D;
@@ -487,164 +486,164 @@ public class CL_input {
* ============ CL_InitInput ============ * ============ CL_InitInput ============
*/ */
static void InitInput() { static void InitInput() {
Cmd.AddCommand("centerview", new xcommand_t() { Cmd.AddCommand("centerview", new Runnable() {
public void execute() { public void run() {
IN.CenterView(); IN.CenterView();
} }
}); });
Cmd.AddCommand("+moveup", new xcommand_t() { Cmd.AddCommand("+moveup", new Runnable() {
public void execute() { public void run() {
IN_UpDown(); IN_UpDown();
} }
}); });
Cmd.AddCommand("-moveup", new xcommand_t() { Cmd.AddCommand("-moveup", new Runnable() {
public void execute() { public void run() {
IN_UpUp(); IN_UpUp();
} }
}); });
Cmd.AddCommand("+movedown", new xcommand_t() { Cmd.AddCommand("+movedown", new Runnable() {
public void execute() { public void run() {
IN_DownDown(); IN_DownDown();
} }
}); });
Cmd.AddCommand("-movedown", new xcommand_t() { Cmd.AddCommand("-movedown", new Runnable() {
public void execute() { public void run() {
IN_DownUp(); IN_DownUp();
} }
}); });
Cmd.AddCommand("+left", new xcommand_t() { Cmd.AddCommand("+left", new Runnable() {
public void execute() { public void run() {
IN_LeftDown(); IN_LeftDown();
} }
}); });
Cmd.AddCommand("-left", new xcommand_t() { Cmd.AddCommand("-left", new Runnable() {
public void execute() { public void run() {
IN_LeftUp(); IN_LeftUp();
} }
}); });
Cmd.AddCommand("+right", new xcommand_t() { Cmd.AddCommand("+right", new Runnable() {
public void execute() { public void run() {
IN_RightDown(); IN_RightDown();
} }
}); });
Cmd.AddCommand("-right", new xcommand_t() { Cmd.AddCommand("-right", new Runnable() {
public void execute() { public void run() {
IN_RightUp(); IN_RightUp();
} }
}); });
Cmd.AddCommand("+forward", new xcommand_t() { Cmd.AddCommand("+forward", new Runnable() {
public void execute() { public void run() {
IN_ForwardDown(); IN_ForwardDown();
} }
}); });
Cmd.AddCommand("-forward", new xcommand_t() { Cmd.AddCommand("-forward", new Runnable() {
public void execute() { public void run() {
IN_ForwardUp(); IN_ForwardUp();
} }
}); });
Cmd.AddCommand("+back", new xcommand_t() { Cmd.AddCommand("+back", new Runnable() {
public void execute() { public void run() {
IN_BackDown(); IN_BackDown();
} }
}); });
Cmd.AddCommand("-back", new xcommand_t() { Cmd.AddCommand("-back", new Runnable() {
public void execute() { public void run() {
IN_BackUp(); IN_BackUp();
} }
}); });
Cmd.AddCommand("+lookup", new xcommand_t() { Cmd.AddCommand("+lookup", new Runnable() {
public void execute() { public void run() {
IN_LookupDown(); IN_LookupDown();
} }
}); });
Cmd.AddCommand("-lookup", new xcommand_t() { Cmd.AddCommand("-lookup", new Runnable() {
public void execute() { public void run() {
IN_LookupUp(); IN_LookupUp();
} }
}); });
Cmd.AddCommand("+lookdown", new xcommand_t() { Cmd.AddCommand("+lookdown", new Runnable() {
public void execute() { public void run() {
IN_LookdownDown(); IN_LookdownDown();
} }
}); });
Cmd.AddCommand("-lookdown", new xcommand_t() { Cmd.AddCommand("-lookdown", new Runnable() {
public void execute() { public void run() {
IN_LookdownUp(); IN_LookdownUp();
} }
}); });
Cmd.AddCommand("+strafe", new xcommand_t() { Cmd.AddCommand("+strafe", new Runnable() {
public void execute() { public void run() {
IN_StrafeDown(); IN_StrafeDown();
} }
}); });
Cmd.AddCommand("-strafe", new xcommand_t() { Cmd.AddCommand("-strafe", new Runnable() {
public void execute() { public void run() {
IN_StrafeUp(); IN_StrafeUp();
} }
}); });
Cmd.AddCommand("+moveleft", new xcommand_t() { Cmd.AddCommand("+moveleft", new Runnable() {
public void execute() { public void run() {
IN_MoveleftDown(); IN_MoveleftDown();
} }
}); });
Cmd.AddCommand("-moveleft", new xcommand_t() { Cmd.AddCommand("-moveleft", new Runnable() {
public void execute() { public void run() {
IN_MoveleftUp(); IN_MoveleftUp();
} }
}); });
Cmd.AddCommand("+moveright", new xcommand_t() { Cmd.AddCommand("+moveright", new Runnable() {
public void execute() { public void run() {
IN_MoverightDown(); IN_MoverightDown();
} }
}); });
Cmd.AddCommand("-moveright", new xcommand_t() { Cmd.AddCommand("-moveright", new Runnable() {
public void execute() { public void run() {
IN_MoverightUp(); IN_MoverightUp();
} }
}); });
Cmd.AddCommand("+speed", new xcommand_t() { Cmd.AddCommand("+speed", new Runnable() {
public void execute() { public void run() {
IN_SpeedDown(); IN_SpeedDown();
} }
}); });
Cmd.AddCommand("-speed", new xcommand_t() { Cmd.AddCommand("-speed", new Runnable() {
public void execute() { public void run() {
IN_SpeedUp(); IN_SpeedUp();
} }
}); });
Cmd.AddCommand("+attack", new xcommand_t() { Cmd.AddCommand("+attack", new Runnable() {
public void execute() { public void run() {
IN_AttackDown(); IN_AttackDown();
} }
}); });
Cmd.AddCommand("-attack", new xcommand_t() { Cmd.AddCommand("-attack", new Runnable() {
public void execute() { public void run() {
IN_AttackUp(); IN_AttackUp();
} }
}); });
Cmd.AddCommand("+use", new xcommand_t() { Cmd.AddCommand("+use", new Runnable() {
public void execute() { public void run() {
IN_UseDown(); IN_UseDown();
} }
}); });
Cmd.AddCommand("-use", new xcommand_t() { Cmd.AddCommand("-use", new Runnable() {
public void execute() { public void run() {
IN_UseUp(); IN_UseUp();
} }
}); });
Cmd.AddCommand("impulse", new xcommand_t() { Cmd.AddCommand("impulse", new Runnable() {
public void execute() { public void run() {
IN_Impulse(); IN_Impulse();
} }
}); });
Cmd.AddCommand("+klook", new xcommand_t() { Cmd.AddCommand("+klook", new Runnable() {
public void execute() { public void run() {
IN_KLookDown(); IN_KLookDown();
} }
}); });
Cmd.AddCommand("-klook", new xcommand_t() { Cmd.AddCommand("-klook", new Runnable() {
public void execute() { public void run() {
IN_KLookUp(); IN_KLookUp();
} }
}); });

View File

@@ -30,7 +30,6 @@ import lwjake2.qcommon.FileSystem;
import lwjake2.qcommon.BaseQ2FileSystem; import lwjake2.qcommon.BaseQ2FileSystem;
import lwjake2.qcommon.MSG; import lwjake2.qcommon.MSG;
import lwjake2.qcommon.SZ; import lwjake2.qcommon.SZ;
import lwjake2.qcommon.xcommand_t;
import lwjake2.render.model_t; import lwjake2.render.model_t;
import lwjake2.sound.S; import lwjake2.sound.S;
import lwjake2.sys.Sys; import lwjake2.sys.Sys;
@@ -136,8 +135,8 @@ public class CL_parse {
* *
* Request a download from the server =============== * Request a download from the server ===============
*/ */
public static xcommand_t Download_f = new xcommand_t() { public static Runnable Download_f = new Runnable() {
public void execute() { public void run() {
String filename; String filename;
if (Cmd.Argc() != 2) { if (Cmd.Argc() != 2) {

View File

@@ -26,7 +26,6 @@ import lwjake2.qcommon.Com;
import lwjake2.qcommon.Cvar; import lwjake2.qcommon.Cvar;
import lwjake2.qcommon.FileSystem; import lwjake2.qcommon.FileSystem;
import lwjake2.qcommon.BaseQ2FileSystem; import lwjake2.qcommon.BaseQ2FileSystem;
import lwjake2.qcommon.xcommand_t;
import lwjake2.util.Lib; import lwjake2.util.Lib;
import lwjake2.util.Vargs; import lwjake2.util.Vargs;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -42,8 +41,8 @@ import java.util.Arrays;
public final class Console extends Globals { public final class Console extends Globals {
private static final Logger logger = LoggerFactory.getLogger(Console.class); private static final Logger logger = LoggerFactory.getLogger(Console.class);
private static final FileSystem fileSystem = BaseQ2FileSystem.getInstance(); private static final FileSystem fileSystem = BaseQ2FileSystem.getInstance();
public static xcommand_t ToggleConsole_f = new xcommand_t() { public static Runnable ToggleConsole_f = new Runnable() {
public void execute() { public void run() {
SCR.EndLoadingPlaque(); // get rid of loading plaque SCR.EndLoadingPlaque(); // get rid of loading plaque
if (Globals.cl.attractloop) { if (Globals.cl.attractloop) {
@@ -74,14 +73,14 @@ public final class Console extends Globals {
} }
}; };
public static xcommand_t Clear_f = new xcommand_t() { public static Runnable Clear_f = new Runnable() {
public void execute() { public void run() {
Arrays.fill(Globals.con.text, (byte) ' '); Arrays.fill(Globals.con.text, (byte) ' ');
} }
}; };
public static xcommand_t Dump_f = new xcommand_t() { public static Runnable Dump_f = new Runnable() {
public void execute() { public void run() {
int l, x; int l, x;
int line; int line;
@@ -247,8 +246,8 @@ public final class Console extends Globals {
/* /*
* ================ Con_ToggleChat_f ================ * ================ Con_ToggleChat_f ================
*/ */
static xcommand_t ToggleChat_f = new xcommand_t() { static Runnable ToggleChat_f = new Runnable() {
public void execute() { public void run() {
Key.ClearTyping(); Key.ClearTyping();
if (cls.key_dest == key_console) { if (cls.key_dest == key_console) {
@@ -266,8 +265,8 @@ public final class Console extends Globals {
/* /*
* ================ Con_MessageMode_f ================ * ================ Con_MessageMode_f ================
*/ */
static xcommand_t MessageMode_f = new xcommand_t() { static Runnable MessageMode_f = new Runnable() {
public void execute() { public void run() {
chat_team = false; chat_team = false;
cls.key_dest = key_message; cls.key_dest = key_message;
} }
@@ -276,8 +275,8 @@ public final class Console extends Globals {
/* /*
* ================ Con_MessageMode2_f ================ * ================ Con_MessageMode2_f ================
*/ */
static xcommand_t MessageMode2_f = new xcommand_t() { static Runnable MessageMode2_f = new Runnable() {
public void execute() { public void run() {
chat_team = true; chat_team = true;
cls.key_dest = key_message; cls.key_dest = key_message;
} }

View File

@@ -24,7 +24,6 @@ import lwjake2.game.Cmd;
import lwjake2.qcommon.Cbuf; import lwjake2.qcommon.Cbuf;
import lwjake2.qcommon.Com; import lwjake2.qcommon.Com;
import lwjake2.qcommon.Cvar; import lwjake2.qcommon.Cvar;
import lwjake2.qcommon.xcommand_t;
import lwjake2.util.Lib; import lwjake2.util.Lib;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -320,7 +319,7 @@ public class Key extends Globals {
if (!down) if (!down)
return; return;
Console.ToggleConsole_f.execute(); Console.ToggleConsole_f.run();
return; return;
} }
@@ -717,8 +716,8 @@ public class Key extends Globals {
return; return;
} }
public static xcommand_t Bind_f = new xcommand_t() { public static Runnable Bind_f = new Runnable() {
public void execute() { public void run() {
Key_Bind_f(); Key_Bind_f();
} }
}; };
@@ -765,8 +764,8 @@ public class Key extends Globals {
Globals.keybindings[keynum] = binding; Globals.keybindings[keynum] = binding;
} }
static xcommand_t Unbind_f = new xcommand_t() { static Runnable Unbind_f = new Runnable() {
public void execute() { public void run() {
Key_Unbind_f(); Key_Unbind_f();
} }
}; };
@@ -787,8 +786,8 @@ public class Key extends Globals {
Key.SetBinding(b, null); Key.SetBinding(b, null);
} }
static xcommand_t Unbindall_f = new xcommand_t() { static Runnable Unbindall_f = new Runnable() {
public void execute() { public void run() {
Key_Unbindall_f(); Key_Unbindall_f();
} }
}; };
@@ -798,8 +797,8 @@ public class Key extends Globals {
Key.SetBinding(i, null); Key.SetBinding(i, null);
} }
static xcommand_t Bindlist_f = new xcommand_t() { static Runnable Bindlist_f = new Runnable() {
public void execute() { public void run() {
Key_Bindlist_f(); Key_Bindlist_f();
} }
}; };

View File

@@ -26,7 +26,6 @@ import lwjake2.qcommon.Com;
import lwjake2.qcommon.Cvar; import lwjake2.qcommon.Cvar;
import lwjake2.qcommon.FS; import lwjake2.qcommon.FS;
import lwjake2.qcommon.netadr_t; import lwjake2.qcommon.netadr_t;
import lwjake2.qcommon.xcommand_t;
import lwjake2.sound.S; import lwjake2.sound.S;
import lwjake2.sys.NET; import lwjake2.sys.NET;
import lwjake2.sys.Sys; import lwjake2.sys.Sys;
@@ -66,7 +65,7 @@ public final class Menu extends Key {
// won't disrupt the sound // won't disrupt the sound
static xcommand_t m_drawfunc; static Runnable m_drawfunc;
static keyfunc_t m_keyfunc; static keyfunc_t m_keyfunc;
@@ -76,7 +75,7 @@ public final class Menu extends Key {
public final static int MAX_MENU_DEPTH = 8; public final static int MAX_MENU_DEPTH = 8;
public static class menulayer_t { public static class menulayer_t {
xcommand_t draw; Runnable draw;
keyfunc_t key; keyfunc_t key;
} }
@@ -181,7 +180,7 @@ public final class Menu extends Key {
viddef.height / 2 - 110, name); 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 k) ) {
int i; int i;
@@ -435,8 +434,8 @@ public final class Menu extends Key {
*/ */
static final int MAIN_ITEMS = 5; static final int MAIN_ITEMS = 5;
static xcommand_t Main_Draw = new xcommand_t() { static Runnable Main_Draw = new Runnable() {
public void execute() { public void run() {
Main_Draw(); Main_Draw();
} }
}; };
@@ -540,15 +539,15 @@ public final class Menu extends Key {
return null; return null;
} }
static xcommand_t Menu_Main = new xcommand_t() { static Runnable Menu_Main = new Runnable() {
public void execute() { public void run() {
Menu_Main_f(); Menu_Main_f();
} }
}; };
static void Menu_Main_f() { static void Menu_Main_f() {
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
Main_Draw(); Main_Draw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -642,16 +641,16 @@ public final class Menu extends Key {
return Default_MenuKey(s_multiplayer_menu, key); return Default_MenuKey(s_multiplayer_menu, key);
} }
static xcommand_t Menu_Multiplayer = new xcommand_t() { static Runnable Menu_Multiplayer = new Runnable() {
public void execute() { public void run() {
Menu_Multiplayer_f(); Menu_Multiplayer_f();
} }
}; };
static void Menu_Multiplayer_f() { static void Menu_Multiplayer_f() {
Multiplayer_MenuInit(); Multiplayer_MenuInit();
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
Multiplayer_MenuDraw(); Multiplayer_MenuDraw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -1154,8 +1153,8 @@ public final class Menu extends Key {
Menu_Center(s_keys_menu); Menu_Center(s_keys_menu);
} }
static xcommand_t Keys_MenuDraw = new xcommand_t() { static Runnable Keys_MenuDraw = new Runnable() {
public void execute() { public void run() {
Keys_MenuDraw_f(); Keys_MenuDraw_f();
} }
}; };
@@ -1207,16 +1206,16 @@ public final class Menu extends Key {
} }
} }
static xcommand_t Menu_Keys = new xcommand_t() { static Runnable Menu_Keys = new Runnable() {
public void execute() { public void run() {
Menu_Keys_f(); Menu_Keys_f();
} }
}; };
static void Menu_Keys_f() { static void Menu_Keys_f() {
Keys_MenuInit(); Keys_MenuInit();
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
Keys_MenuDraw_f(); Keys_MenuDraw_f();
} }
}, new keyfunc_t() { }, 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 // the text box won't show up unless we do a buffer swap
re.EndFrame(); 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); return Default_MenuKey(s_options_menu, key);
} }
static xcommand_t Menu_Options = new xcommand_t() { static Runnable Menu_Options = new Runnable() {
public void execute() { public void run() {
Menu_Options_f(); Menu_Options_f();
} }
}; };
static void Menu_Options_f() { static void Menu_Options_f() {
Options_MenuInit(); Options_MenuInit();
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
Options_MenuDraw(); Options_MenuDraw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -1677,16 +1676,16 @@ public final class Menu extends Key {
* ======================================================================= * =======================================================================
*/ */
static xcommand_t Menu_Video = new xcommand_t() { static Runnable Menu_Video = new Runnable() {
public void execute() { public void run() {
Menu_Video_f(); Menu_Video_f();
} }
}; };
static void Menu_Video_f() { static void Menu_Video_f() {
VID.MenuInit(); VID.MenuInit();
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
VID.MenuDraw(); VID.MenuDraw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -1897,8 +1896,8 @@ public final class Menu extends Key {
} }
static xcommand_t Menu_Credits = new xcommand_t() { static Runnable Menu_Credits = new Runnable() {
public void execute() { public void run() {
Menu_Credits_f(); Menu_Credits_f();
} }
}; };
@@ -1933,8 +1932,8 @@ public final class Menu extends Key {
} }
credits_start_time = cls.realtime; credits_start_time = cls.realtime;
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
Credits_MenuDraw(); Credits_MenuDraw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -2108,16 +2107,16 @@ public final class Menu extends Key {
return Default_MenuKey(s_game_menu, key); return Default_MenuKey(s_game_menu, key);
} }
static xcommand_t Menu_Game = new xcommand_t() { static Runnable Menu_Game = new Runnable() {
public void execute() { public void run() {
Menu_Game_f(); Menu_Game_f();
} }
}; };
static void Menu_Game_f() { static void Menu_Game_f() {
Game_MenuInit(); Game_MenuInit();
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
Game_MenuDraw(); Game_MenuDraw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -2238,16 +2237,16 @@ public final class Menu extends Key {
return Default_MenuKey(s_loadgame_menu, key); return Default_MenuKey(s_loadgame_menu, key);
} }
static xcommand_t Menu_LoadGame = new xcommand_t() { static Runnable Menu_LoadGame = new Runnable() {
public void execute() { public void run() {
Menu_LoadGame_f(); Menu_LoadGame_f();
} }
}; };
static void Menu_LoadGame_f() { static void Menu_LoadGame_f() {
LoadGame_MenuInit(); LoadGame_MenuInit();
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
LoadGame_MenuDraw(); LoadGame_MenuDraw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -2324,8 +2323,8 @@ public final class Menu extends Key {
return Default_MenuKey(s_savegame_menu, key); return Default_MenuKey(s_savegame_menu, key);
} }
static xcommand_t Menu_SaveGame = new xcommand_t() { static Runnable Menu_SaveGame = new Runnable() {
public void execute() { public void run() {
Menu_SaveGame_f(); Menu_SaveGame_f();
} }
}; };
@@ -2335,8 +2334,8 @@ public final class Menu extends Key {
return; // not playing a game return; // not playing a game
SaveGame_MenuInit(); SaveGame_MenuInit();
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
SaveGame_MenuDraw(); SaveGame_MenuDraw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -2443,7 +2442,7 @@ public final class Menu extends Key {
re.EndFrame(); re.EndFrame();
// send out info packets // send out info packets
CL.PingServers_f.execute(); CL.PingServers_f.run();
} }
static void SearchLocalGamesFunc(Object self) { static void SearchLocalGamesFunc(Object self) {
@@ -2520,16 +2519,16 @@ public final class Menu extends Key {
return Default_MenuKey(s_joinserver_menu, key); return Default_MenuKey(s_joinserver_menu, key);
} }
static xcommand_t Menu_JoinServer = new xcommand_t() { static Runnable Menu_JoinServer = new Runnable() {
public void execute() { public void run() {
Menu_JoinServer_f(); Menu_JoinServer_f();
} }
}; };
static void Menu_JoinServer_f() { static void Menu_JoinServer_f() {
JoinServer_MenuInit(); JoinServer_MenuInit();
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
JoinServer_MenuDraw(); JoinServer_MenuDraw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -2905,14 +2904,14 @@ public final class Menu extends Key {
return Default_MenuKey(s_startserver_menu, key); return Default_MenuKey(s_startserver_menu, key);
} }
static xcommand_t Menu_StartServer = new xcommand_t() { static Runnable Menu_StartServer = new Runnable() {
public void execute() { public void run() {
Menu_StartServer_f(); Menu_StartServer_f();
} }
}; };
static xcommand_t startServer_MenuDraw = new xcommand_t() { static Runnable startServer_MenuDraw = new Runnable() {
public void execute() { public void run() {
StartServer_MenuDraw(); StartServer_MenuDraw();
} }
}; };
@@ -3379,16 +3378,16 @@ public final class Menu extends Key {
return Default_MenuKey(s_dmoptions_menu, key); return Default_MenuKey(s_dmoptions_menu, key);
} }
static xcommand_t Menu_DMOptions = new xcommand_t() { static Runnable Menu_DMOptions = new Runnable() {
public void execute() { public void run() {
Menu_DMOptions_f(); Menu_DMOptions_f();
} }
}; };
static void Menu_DMOptions_f() { static void Menu_DMOptions_f() {
DMOptions_MenuInit(); DMOptions_MenuInit();
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
DMOptions_MenuDraw(); DMOptions_MenuDraw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -3544,16 +3543,16 @@ public final class Menu extends Key {
return Default_MenuKey(s_downloadoptions_menu, key); return Default_MenuKey(s_downloadoptions_menu, key);
} }
static xcommand_t Menu_DownloadOptions = new xcommand_t() { static Runnable Menu_DownloadOptions = new Runnable() {
public void execute() { public void run() {
Menu_DownloadOptions_f(); Menu_DownloadOptions_f();
} }
}; };
static void Menu_DownloadOptions_f() { static void Menu_DownloadOptions_f() {
DownloadOptions_MenuInit(); DownloadOptions_MenuInit();
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
DownloadOptions_MenuDraw(); DownloadOptions_MenuDraw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -3619,8 +3618,8 @@ public final class Menu extends Key {
return Default_MenuKey(s_addressbook_menu, key); return Default_MenuKey(s_addressbook_menu, key);
} }
static xcommand_t AddressBook_MenuDraw = new xcommand_t() { static Runnable AddressBook_MenuDraw = new Runnable() {
public void execute() { public void run() {
AddressBook_MenuDraw_f(); AddressBook_MenuDraw_f();
} }
}; };
@@ -3630,16 +3629,16 @@ public final class Menu extends Key {
Menu_Draw(s_addressbook_menu); Menu_Draw(s_addressbook_menu);
} }
static xcommand_t Menu_AddressBook = new xcommand_t() { static Runnable Menu_AddressBook = new Runnable() {
public void execute() { public void run() {
Menu_AddressBook_f(); Menu_AddressBook_f();
} }
}; };
static void Menu_AddressBook_f() { static void Menu_AddressBook_f() {
AddressBook_MenuInit(); AddressBook_MenuInit();
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
AddressBook_MenuDraw_f(); AddressBook_MenuDraw_f();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -4180,8 +4179,8 @@ public final class Menu extends Key {
return Default_MenuKey(s_player_config_menu, key); return Default_MenuKey(s_player_config_menu, key);
} }
static xcommand_t Menu_PlayerConfig = new xcommand_t() { static Runnable Menu_PlayerConfig = new Runnable() {
public void execute() { public void run() {
Menu_PlayerConfig_f(); Menu_PlayerConfig_f();
} }
}; };
@@ -4193,8 +4192,8 @@ public final class Menu extends Key {
return; return;
} }
Menu_SetStatusBar(s_multiplayer_menu, null); Menu_SetStatusBar(s_multiplayer_menu, null);
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
PlayerConfig_MenuDraw(); PlayerConfig_MenuDraw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -4223,7 +4222,7 @@ public final class Menu extends Key {
case 'Y': case 'Y':
case 'y': case 'y':
cls.key_dest = key_console; cls.key_dest = key_console;
CL.Quit_f.execute(); CL.Quit_f.run();
break; break;
default: default:
@@ -4243,15 +4242,15 @@ public final class Menu extends Key {
re.DrawPic((viddef.width - w) / 2, (viddef.height - h) / 2, "quit"); re.DrawPic((viddef.width - w) / 2, (viddef.height - h) / 2, "quit");
} }
static xcommand_t Menu_Quit = new xcommand_t() { static Runnable Menu_Quit = new Runnable() {
public void execute() { public void run() {
Menu_Quit_f(); Menu_Quit_f();
} }
}; };
static void Menu_Quit_f() { static void Menu_Quit_f() {
PushMenu(new xcommand_t() { PushMenu(new Runnable() {
public void execute() { public void run() {
Quit_Draw(); Quit_Draw();
} }
}, new keyfunc_t() { }, new keyfunc_t() {
@@ -4306,7 +4305,7 @@ public final class Menu extends Key {
else else
re.DrawFadeScreen(); re.DrawFadeScreen();
m_drawfunc.execute(); m_drawfunc.run();
// delay playing the enter sound until after the // delay playing the enter sound until after the
// menu has been drawn, to avoid delay while // menu has been drawn, to avoid delay while

View File

@@ -28,7 +28,6 @@ import lwjake2.qcommon.FS;
import lwjake2.qcommon.MSG; import lwjake2.qcommon.MSG;
import lwjake2.qcommon.SZ; import lwjake2.qcommon.SZ;
import lwjake2.qcommon.qfiles; import lwjake2.qcommon.qfiles;
import lwjake2.qcommon.xcommand_t;
import lwjake2.sound.S; import lwjake2.sound.S;
import lwjake2.sys.Timer; import lwjake2.sys.Timer;
import lwjake2.util.Lib; import lwjake2.util.Lib;
@@ -439,28 +438,28 @@ public final class SCR extends Globals {
// //
// register our commands // register our commands
// //
Cmd.AddCommand("timerefresh", new xcommand_t() { Cmd.AddCommand("timerefresh", new Runnable() {
public void execute() { public void run() {
TimeRefresh_f(); TimeRefresh_f();
} }
}); });
Cmd.AddCommand("loading", new xcommand_t() { Cmd.AddCommand("loading", new Runnable() {
public void execute() { public void run() {
Loading_f(); Loading_f();
} }
}); });
Cmd.AddCommand("sizeup", new xcommand_t() { Cmd.AddCommand("sizeup", new Runnable() {
public void execute() { public void run() {
SizeUp_f(); SizeUp_f();
} }
}); });
Cmd.AddCommand("sizedown", new xcommand_t() { Cmd.AddCommand("sizedown", new Runnable() {
public void execute() { public void run() {
SizeDown_f(); SizeDown_f();
} }
}); });
Cmd.AddCommand("sky", new xcommand_t() { Cmd.AddCommand("sky", new Runnable() {
public void execute() { public void run() {
Sky_f(); Sky_f();
} }
}); });
@@ -1302,8 +1301,8 @@ public final class SCR extends Globals {
crosshair_pic); crosshair_pic);
} }
private static xcommand_t updateScreenCallback = new xcommand_t() { private static Runnable updateScreenCallback = new Runnable() {
public void execute() { public void run() {
UpdateScreen2(); UpdateScreen2();
} }
}; };

View File

@@ -23,7 +23,6 @@ import lwjake2.game.Cmd;
import lwjake2.game.cvar_t; import lwjake2.game.cvar_t;
import lwjake2.qcommon.Com; import lwjake2.qcommon.Com;
import lwjake2.qcommon.Cvar; import lwjake2.qcommon.Cvar;
import lwjake2.qcommon.xcommand_t;
import lwjake2.sys.Timer; import lwjake2.sys.Timer;
import lwjake2.util.Math3D; import lwjake2.util.Math3D;
import lwjake2.util.Vargs; import lwjake2.util.Vargs;
@@ -238,15 +237,15 @@ public final class V extends Globals {
} }
} }
static xcommand_t Gun_Next_f = new xcommand_t() { static Runnable Gun_Next_f = new Runnable() {
public void execute() { public void run() {
gun_frame++; gun_frame++;
Com.Printf("frame " + gun_frame + "\n"); Com.Printf("frame " + gun_frame + "\n");
} }
}; };
static xcommand_t Gun_Prev_f = new xcommand_t() { static Runnable Gun_Prev_f = new Runnable() {
public void execute() { public void run() {
gun_frame--; gun_frame--;
if (gun_frame < 0) if (gun_frame < 0)
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() { static Runnable Gun_Model_f = new Runnable() {
public void execute() { public void run() {
if (Cmd.Argc() != 2) { if (Cmd.Argc() != 2) {
gun_model = null; gun_model = null;
return; return;
@@ -381,8 +380,8 @@ public final class V extends Globals {
/* /*
* ============= V_Viewpos_f ============= * ============= V_Viewpos_f =============
*/ */
static xcommand_t Viewpos_f = new xcommand_t() { static Runnable Viewpos_f = new Runnable() {
public void execute() { public void run() {
logger.info("({} {} {}) : {}", logger.info("({} {} {}) : {}",
(int) cl.refdef.vieworg[0], (int) cl.refdef.vieworg[0],
(int) cl.refdef.vieworg[1], (int) cl.refdef.vieworg[1],

View File

@@ -24,7 +24,6 @@ import lwjake2.game.Cmd;
import lwjake2.game.cvar_t; import lwjake2.game.cvar_t;
import lwjake2.qcommon.Com; import lwjake2.qcommon.Com;
import lwjake2.qcommon.Cvar; import lwjake2.qcommon.Cvar;
import lwjake2.qcommon.xcommand_t;
import lwjake2.render.Renderer; import lwjake2.render.Renderer;
import lwjake2.sound.S; import lwjake2.sound.S;
import lwjake2.sys.IN; import lwjake2.sys.IN;
@@ -290,7 +289,7 @@ public class VID extends Globals {
if ( Globals.cls.key_dest != Defines.key_console ) if ( Globals.cls.key_dest != Defines.key_console )
{ {
try { try {
Console.ToggleConsole_f.execute(); Console.ToggleConsole_f.run();
} catch (Exception e) { } catch (Exception e) {
} }
} }
@@ -319,8 +318,8 @@ public class VID extends Globals {
vid_modes[11].height = (int)vid_height.value; vid_modes[11].height = (int)vid_height.value;
/* Add some console commands that we want to handle */ /* Add some console commands that we want to handle */
Cmd.AddCommand ("vid_restart", new xcommand_t() { Cmd.AddCommand ("vid_restart", new Runnable() {
public void execute() { public void run() {
Restart_f(); Restart_f();
} }
}); });

View File

@@ -18,7 +18,6 @@
package lwjake2.client; package lwjake2.client;
import lwjake2.qcommon.xcommand_t;
import lwjake2.render.image_t; import lwjake2.render.image_t;
import lwjake2.render.model_t; import lwjake2.render.model_t;
import lwjake2.sys.KBD; import lwjake2.sys.KBD;
@@ -95,7 +94,7 @@ public interface refexport_t {
* *
* *
*/ */
void updateScreen(xcommand_t callback); void updateScreen(Runnable callback);
int apiVersion(); int apiVersion();

View File

@@ -28,7 +28,6 @@ import lwjake2.qcommon.FS;
import lwjake2.qcommon.MSG; import lwjake2.qcommon.MSG;
import lwjake2.qcommon.SZ; import lwjake2.qcommon.SZ;
import lwjake2.qcommon.cmd_function_t; import lwjake2.qcommon.cmd_function_t;
import lwjake2.qcommon.xcommand_t;
import lwjake2.server.SV_GAME; import lwjake2.server.SV_GAME;
import lwjake2.util.Lib; import lwjake2.util.Lib;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -43,8 +42,8 @@ import java.util.Vector;
*/ */
public final class Cmd { public final class Cmd {
private static final Logger logger = LoggerFactory.getLogger(Cmd.class); private static final Logger logger = LoggerFactory.getLogger(Cmd.class);
static xcommand_t List_f = new xcommand_t() { static Runnable List_f = new Runnable() {
public void execute() { public void run() {
cmd_function_t cmd = Cmd.cmd_functions; cmd_function_t cmd = Cmd.cmd_functions;
int i = 0; int i = 0;
@@ -57,8 +56,8 @@ public final class Cmd {
} }
}; };
static xcommand_t Exec_f = new xcommand_t() { static Runnable Exec_f = new Runnable() {
public void execute() { public void run() {
if (Cmd.Argc() != 2) { if (Cmd.Argc() != 2) {
logger.info("exec <filename> : execute a script file"); logger.info("exec <filename> : execute a script file");
return; return;
@@ -78,8 +77,8 @@ public final class Cmd {
} }
}; };
static xcommand_t Echo_f = new xcommand_t() { static Runnable Echo_f = new Runnable() {
public void execute() { public void run() {
StringBuilder sb = new StringBuilder(Cmd.Argc()); StringBuilder sb = new StringBuilder(Cmd.Argc());
for (int i = 1; i < Cmd.Argc(); i++) { for (int i = 1; i < Cmd.Argc(); i++) {
sb.append(Cmd.Argv(i)).append(' '); sb.append(Cmd.Argv(i)).append(' ');
@@ -88,8 +87,8 @@ public final class Cmd {
} }
}; };
static xcommand_t Alias_f = new xcommand_t() { static Runnable Alias_f = new Runnable() {
public void execute() { public void run() {
cmdalias_t a = null; cmdalias_t a = null;
if (Cmd.Argc() == 1) { if (Cmd.Argc() == 1) {
logger.info("Current alias commands:"); logger.info("Current alias commands:");
@@ -134,8 +133,8 @@ public final class Cmd {
} }
}; };
public static xcommand_t Wait_f = new xcommand_t() { public static Runnable Wait_f = new Runnable() {
public void execute() { public void run() {
Globals.cmd_wait = true; 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; cmd_function_t cmd;
//Com.DPrintf("Cmd_AddCommand: " + cmd_name + "\n"); //Com.DPrintf("Cmd_AddCommand: " + cmd_name + "\n");
// fail if the command is a variable name // fail if the command is a variable name
@@ -408,7 +407,7 @@ public final class Cmd {
if (null == cmd.function) { // forward to server command if (null == cmd.function) { // forward to server command
Cmd.ExecuteString("cmd " + text); Cmd.ExecuteString("cmd " + text);
} else { } else {
cmd.function.execute(); cmd.function.run();
} }
return; return;
} }

View File

@@ -241,9 +241,9 @@ public final class Com
return new String(com_token, 0, len); 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)); Error(Defines.ERR_FATAL, Cmd.Argv(1));
} }

View File

@@ -229,8 +229,8 @@ public class Cvar extends Globals {
* Set command, sets variables. * Set command, sets variables.
*/ */
static xcommand_t Set_f = new xcommand_t() { static Runnable Set_f = new Runnable() {
public void execute() { public void run() {
int c; int c;
int flags; int flags;
@@ -260,8 +260,8 @@ public class Cvar extends Globals {
/** /**
* List command, lists all available commands. * List command, lists all available commands.
*/ */
static xcommand_t List_f = new xcommand_t() { static Runnable List_f = new Runnable() {
public void execute() { public void run() {
cvar_t var; cvar_t var;
int i; int i;

View File

@@ -880,18 +880,18 @@ public final class FS extends Globals {
* InitFilesystem * InitFilesystem
*/ */
public static void InitFilesystem() { public static void InitFilesystem() {
Cmd.AddCommand("path", new xcommand_t() { Cmd.AddCommand("path", new Runnable() {
public void execute() { public void run() {
Path_f(); Path_f();
} }
}); });
Cmd.AddCommand("link", new xcommand_t() { Cmd.AddCommand("link", new Runnable() {
public void execute() { public void run() {
Link_f(); Link_f();
} }
}); });
Cmd.AddCommand("dir", new xcommand_t() { Cmd.AddCommand("dir", new Runnable() {
public void execute() { public void run() {
Dir_f(); Dir_f();
} }
}); });

View File

@@ -24,5 +24,5 @@ package lwjake2.qcommon;
public final class cmd_function_t { public final class cmd_function_t {
public cmd_function_t next = null; public cmd_function_t next = null;
public String name = null; public String name = null;
public xcommand_t function; public Runnable function;
} }

View File

@@ -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();
}

View File

@@ -20,7 +20,6 @@ package lwjake2.render;
import lwjake2.client.refdef_t; import lwjake2.client.refdef_t;
import lwjake2.client.refexport_t; import lwjake2.client.refexport_t;
import lwjake2.qcommon.xcommand_t;
import lwjake2.sys.KBD; import lwjake2.sys.KBD;
import java.awt.Dimension; import java.awt.Dimension;
@@ -164,10 +163,10 @@ public class DummyRenderer implements refexport_t {
} }
/* (non-Javadoc) /* (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) { public void updateScreen(Runnable callback) {
callback.execute(); callback.run();
} }
/* (non-Javadoc) /* (non-Javadoc)

View File

@@ -22,7 +22,6 @@ import lwjake2.Defines;
import lwjake2.client.VID; import lwjake2.client.VID;
import lwjake2.client.viddef_t; import lwjake2.client.viddef_t;
import lwjake2.game.cvar_t; import lwjake2.game.cvar_t;
import lwjake2.qcommon.xcommand_t;
import java.awt.Dimension; import java.awt.Dimension;
import java.util.ArrayList; import java.util.ArrayList;
@@ -346,7 +345,7 @@ public abstract class LWJGLBase {
* this is a hack for jogl renderers. * this is a hack for jogl renderers.
* @param callback * @param callback
*/ */
public final void updateScreen(xcommand_t callback) { public final void updateScreen(Runnable callback) {
callback.execute(); callback.run();
} }
} }

View File

@@ -30,7 +30,6 @@ import lwjake2.game.cvar_t;
import lwjake2.qcommon.Com; import lwjake2.qcommon.Com;
import lwjake2.qcommon.Cvar; import lwjake2.qcommon.Cvar;
import lwjake2.qcommon.qfiles; import lwjake2.qcommon.qfiles;
import lwjake2.qcommon.xcommand_t;
import lwjake2.render.glconfig_t; import lwjake2.render.glconfig_t;
import lwjake2.render.glstate_t; import lwjake2.render.glstate_t;
import lwjake2.render.image_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_gamma = Cvar.Get("vid_gamma", "1.0", Globals.CVAR_ARCHIVE);
vid_ref = Cvar.Get("vid_ref", "lwjgl", Globals.CVAR_ARCHIVE); vid_ref = Cvar.Get("vid_ref", "lwjgl", Globals.CVAR_ARCHIVE);
Cmd.AddCommand("imagelist", new xcommand_t() { Cmd.AddCommand("imagelist", new Runnable() {
public void execute() { public void run() {
GL_ImageList_f(); GL_ImageList_f();
} }
}); });
Cmd.AddCommand("screenshot", new xcommand_t() { Cmd.AddCommand("screenshot", new Runnable() {
public void execute() { public void run() {
GL_ScreenShot_f(); GL_ScreenShot_f();
} }
}); });
Cmd.AddCommand("modellist", new xcommand_t() { Cmd.AddCommand("modellist", new Runnable() {
public void execute() { public void run() {
Mod_Modellist_f(); Mod_Modellist_f();
} }
}); });
Cmd.AddCommand("gl_strings", new xcommand_t() { Cmd.AddCommand("gl_strings", new Runnable() {
public void execute() { public void run() {
GL_Strings_f(); GL_Strings_f();
} }
}); });

View File

@@ -35,7 +35,6 @@ import lwjake2.qcommon.Netchan;
import lwjake2.qcommon.SZ; import lwjake2.qcommon.SZ;
import lwjake2.qcommon.netadr_t; import lwjake2.qcommon.netadr_t;
import lwjake2.qcommon.sizebuf_t; import lwjake2.qcommon.sizebuf_t;
import lwjake2.qcommon.xcommand_t;
import lwjake2.sys.NET; import lwjake2.sys.NET;
import lwjake2.sys.Sys; import lwjake2.sys.Sys;
import lwjake2.util.Lib; import lwjake2.util.Lib;
@@ -1027,90 +1026,90 @@ public class SV_CCMDS {
================== ==================
*/ */
public static void SV_InitOperatorCommands() { public static void SV_InitOperatorCommands() {
Cmd.AddCommand("heartbeat", new xcommand_t() { Cmd.AddCommand("heartbeat", new Runnable() {
public void execute() { public void run() {
SV_Heartbeat_f(); SV_Heartbeat_f();
} }
}); });
Cmd.AddCommand("kick", new xcommand_t() { Cmd.AddCommand("kick", new Runnable() {
public void execute() { public void run() {
SV_Kick_f(); SV_Kick_f();
} }
}); });
Cmd.AddCommand("status", new xcommand_t() { Cmd.AddCommand("status", new Runnable() {
public void execute() { public void run() {
SV_Status_f(); SV_Status_f();
} }
}); });
Cmd.AddCommand("serverinfo", new xcommand_t() { Cmd.AddCommand("serverinfo", new Runnable() {
public void execute() { public void run() {
SV_Serverinfo_f(); SV_Serverinfo_f();
} }
}); });
Cmd.AddCommand("dumpuser", new xcommand_t() { Cmd.AddCommand("dumpuser", new Runnable() {
public void execute() { public void run() {
SV_DumpUser_f(); SV_DumpUser_f();
} }
}); });
Cmd.AddCommand("map", new xcommand_t() { Cmd.AddCommand("map", new Runnable() {
public void execute() { public void run() {
SV_Map_f(); SV_Map_f();
} }
}); });
Cmd.AddCommand("demomap", new xcommand_t() { Cmd.AddCommand("demomap", new Runnable() {
public void execute() { public void run() {
SV_DemoMap_f(); SV_DemoMap_f();
} }
}); });
Cmd.AddCommand("gamemap", new xcommand_t() { Cmd.AddCommand("gamemap", new Runnable() {
public void execute() { public void run() {
SV_GameMap_f(); SV_GameMap_f();
} }
}); });
Cmd.AddCommand("setmaster", new xcommand_t() { Cmd.AddCommand("setmaster", new Runnable() {
public void execute() { public void run() {
SV_SetMaster_f(); SV_SetMaster_f();
} }
}); });
if (Globals.dedicated.value != 0) if (Globals.dedicated.value != 0)
Cmd.AddCommand("say", new xcommand_t() { Cmd.AddCommand("say", new Runnable() {
public void execute() { public void run() {
SV_ConSay_f(); SV_ConSay_f();
} }
}); });
Cmd.AddCommand("serverrecord", new xcommand_t() { Cmd.AddCommand("serverrecord", new Runnable() {
public void execute() { public void run() {
SV_ServerRecord_f(); SV_ServerRecord_f();
} }
}); });
Cmd.AddCommand("serverstop", new xcommand_t() { Cmd.AddCommand("serverstop", new Runnable() {
public void execute() { public void run() {
SV_ServerStop_f(); SV_ServerStop_f();
} }
}); });
Cmd.AddCommand("save", new xcommand_t() { Cmd.AddCommand("save", new Runnable() {
public void execute() { public void run() {
SV_Savegame_f(); SV_Savegame_f();
} }
}); });
Cmd.AddCommand("load", new xcommand_t() { Cmd.AddCommand("load", new Runnable() {
public void execute() { public void run() {
SV_Loadgame_f(); SV_Loadgame_f();
} }
}); });
Cmd.AddCommand("killserver", new xcommand_t() { Cmd.AddCommand("killserver", new Runnable() {
public void execute() { public void run() {
SV_KillServer_f(); SV_KillServer_f();
} }
}); });
Cmd.AddCommand("sv", new xcommand_t() { Cmd.AddCommand("sv", new Runnable() {
public void execute() { public void run() {
SV_ServerCommand_f(); SV_ServerCommand_f();
} }
}); });

View File

@@ -27,7 +27,6 @@ import lwjake2.game.entity_state_t;
import lwjake2.qcommon.Com; import lwjake2.qcommon.Com;
import lwjake2.qcommon.Cvar; import lwjake2.qcommon.Cvar;
import lwjake2.qcommon.FS; import lwjake2.qcommon.FS;
import lwjake2.qcommon.xcommand_t;
import lwjake2.sound.S; import lwjake2.sound.S;
import lwjake2.sound.Sound; import lwjake2.sound.Sound;
import lwjake2.sound.WaveLoader; import lwjake2.sound.WaveLoader;
@@ -101,23 +100,23 @@ public final class LWJGLSoundImpl implements Sound {
int count = Channel.init(buffers); int count = Channel.init(buffers);
logger.info("... using {} channels", count); logger.info("... using {} channels", count);
AL10.alDistanceModel(AL10.AL_INVERSE_DISTANCE_CLAMPED); AL10.alDistanceModel(AL10.AL_INVERSE_DISTANCE_CLAMPED);
Cmd.AddCommand("play", new xcommand_t() { Cmd.AddCommand("play", new Runnable() {
public void execute() { public void run() {
Play(); Play();
} }
}); });
Cmd.AddCommand("stopsound", new xcommand_t() { Cmd.AddCommand("stopsound", new Runnable() {
public void execute() { public void run() {
StopAllSounds(); StopAllSounds();
} }
}); });
Cmd.AddCommand("soundlist", new xcommand_t() { Cmd.AddCommand("soundlist", new Runnable() {
public void execute() { public void run() {
SoundList(); SoundList();
} }
}); });
Cmd.AddCommand("soundinfo", new xcommand_t() { Cmd.AddCommand("soundinfo", new Runnable() {
public void execute() { public void run() {
SoundInfo_f(); SoundInfo_f();
} }
}); });

View File

@@ -24,7 +24,6 @@ import lwjake2.client.Key;
import lwjake2.game.Cmd; import lwjake2.game.Cmd;
import lwjake2.game.usercmd_t; import lwjake2.game.usercmd_t;
import lwjake2.qcommon.Cvar; import lwjake2.qcommon.Cvar;
import lwjake2.qcommon.xcommand_t;
import lwjake2.util.Math3D; 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_forward = Cvar.Get("m_forward", "1", 0);
Globals.m_side = Cvar.Get("m_side", "0.8", 0); Globals.m_side = Cvar.Get("m_side", "0.8", 0);
Cmd.AddCommand("+mlook", new xcommand_t() { Cmd.AddCommand("+mlook", new Runnable() {
public void execute() { public void run() {
MLookDown(); MLookDown();
} }
}); });
Cmd.AddCommand("-mlook", new xcommand_t() { Cmd.AddCommand("-mlook", new Runnable() {
public void execute() { public void run() {
MLookUp(); MLookUp();
} }
}); });
Cmd.AddCommand("force_centerview", new xcommand_t() { Cmd.AddCommand("force_centerview", new Runnable() {
public void execute() { public void run() {
Force_CenterView_f(); Force_CenterView_f();
} }
}); });
Cmd.AddCommand("togglemouse", new xcommand_t() { Cmd.AddCommand("togglemouse", new Runnable() {
public void execute() { public void run() {
toggleMouse(); toggleMouse();
} }
}); });