0

Долой наследование от статических классов с константами!

This commit is contained in:
2018-12-18 21:33:58 +03:00
parent f8087b30a7
commit 385aa0d8ca
17 changed files with 132 additions and 114 deletions

View File

@@ -512,10 +512,10 @@ public class Defines {
public final static int DF_FIXED_FOV = 0x00008000; // 32768 public final static int DF_FIXED_FOV = 0x00008000; // 32768
// ROGUE // ROGUE
protected final static int DF_NO_MINES = 0x00020000; public final static int DF_NO_MINES = 0x00020000;
protected final static int DF_NO_STACK_DOUBLE = 0x00040000; public final static int DF_NO_STACK_DOUBLE = 0x00040000;
protected final static int DF_NO_NUKES = 0x00080000; public final static int DF_NO_NUKES = 0x00080000;
protected final static int DF_NO_SPHERES = 0x00100000; public final static int DF_NO_SPHERES = 0x00100000;
// ROGUE // ROGUE
// //
@@ -865,7 +865,7 @@ public class Defines {
// R E N D E R E R // R E N D E R E R
//////////////////// ////////////////////
public static final int MAX_DLIGHTS = 32; public static final int MAX_DLIGHTS = 32;
protected static final int MAX_ENTITIES = 128; public static final int MAX_ENTITIES = 128;
public static final int MAX_PARTICLES = 4096; public static final int MAX_PARTICLES = 4096;
// gl_model.h // gl_model.h
@@ -930,14 +930,14 @@ public class Defines {
public final static int PS_WEAPONFRAME = (1 << 13); public final static int PS_WEAPONFRAME = (1 << 13);
public final static int PS_RDFLAGS = (1 << 14); public final static int PS_RDFLAGS = (1 << 14);
protected static final int CM_ANGLE1 = (1); public static final int CM_ANGLE1 = (1);
protected static final int CM_ANGLE2 = (1 << 1); public static final int CM_ANGLE2 = (1 << 1);
protected static final int CM_ANGLE3 = (1 << 2); public static final int CM_ANGLE3 = (1 << 2);
protected static final int CM_FORWARD = (1 << 3); public static final int CM_FORWARD = (1 << 3);
protected static final int CM_SIDE = (1 << 4); public static final int CM_SIDE = (1 << 4);
protected static final int CM_UP = (1 << 5); public static final int CM_UP = (1 << 5);
protected static final int CM_BUTTONS = (1 << 6); public static final int CM_BUTTONS = (1 << 6);
protected static final int CM_IMPULSE = (1 << 7); public static final int CM_IMPULSE = (1 << 7);
// try to pack the common update flags into the first byte // try to pack the common update flags into the first byte
public final static int U_ORIGIN1 = (1); public final static int U_ORIGIN1 = (1);

View File

@@ -18,13 +18,7 @@
package lwjake2; package lwjake2;
import lwjake2.client.centity_t; import lwjake2.client.*;
import lwjake2.client.client_state_t;
import lwjake2.client.client_static_t;
import lwjake2.client.console_t;
import lwjake2.client.refexport_t;
import lwjake2.client.viddef_t;
import lwjake2.client.vrect_t;
import lwjake2.game.cmdalias_t; import lwjake2.game.cmdalias_t;
import lwjake2.game.cvar_t; import lwjake2.game.cvar_t;
import lwjake2.game.entity_state_t; import lwjake2.game.entity_state_t;
@@ -37,6 +31,8 @@ import java.io.FileWriter;
import java.io.RandomAccessFile; import java.io.RandomAccessFile;
import java.util.Random; import java.util.Random;
import static lwjake2.Defines.*;
/** /**
* Globals ist the collection of global variables and constants. * Globals ist the collection of global variables and constants.
* It is more elegant to use these vars by inheritance to separate * It is more elegant to use these vars by inheritance to separate
@@ -44,7 +40,7 @@ import java.util.Random;
* *
* As consequence you dont have to touch that much code this time. * As consequence you dont have to touch that much code this time.
*/ */
public class Globals extends Defines { public class Globals {
public static final String __DATE__ = "2003"; public static final String __DATE__ = "2003";

View File

@@ -63,7 +63,7 @@ public final class LWJake2 {
// TODO: check if dedicated is set in config file // TODO: check if dedicated is set in config file
Globals.dedicated= Cvar.Get("dedicated", "0", Qcommon.CVAR_NOSET); Globals.dedicated= Cvar.Get("dedicated", "0", Defines.CVAR_NOSET);
if (dedicated) if (dedicated)
Globals.dedicated.value = 1.0f; Globals.dedicated.value = 1.0f;

View File

@@ -22,11 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import lwjake2.Defines; import lwjake2.Defines;
import lwjake2.Globals; import lwjake2.Globals;
import lwjake2.game.Cmd; import lwjake2.game.Cmd;
import lwjake2.qcommon.Cbuf; import lwjake2.qcommon.*;
import lwjake2.qcommon.Com;
import lwjake2.qcommon.Cvar;
import lwjake2.qcommon.FileSystem;
import lwjake2.qcommon.BaseQ2FileSystem;
import lwjake2.util.Lib; import lwjake2.util.Lib;
import lwjake2.util.Vargs; import lwjake2.util.Vargs;
@@ -34,11 +30,19 @@ import java.io.IOException;
import java.io.RandomAccessFile; import java.io.RandomAccessFile;
import java.util.Arrays; import java.util.Arrays;
import static lwjake2.Defines.NUM_CON_TIMES;
import static lwjake2.Defines.ca_active;
import static lwjake2.Defines.key_console;
import static lwjake2.Defines.key_game;
import static lwjake2.Defines.key_menu;
import static lwjake2.Defines.key_message;
import static lwjake2.Globals.*;
/** /**
* Console * Console
*/ */
@Slf4j @Slf4j
public final class Console extends Globals { public final class Console {
private static final FileSystem fileSystem = BaseQ2FileSystem.getInstance(); private static final FileSystem fileSystem = BaseQ2FileSystem.getInstance();
public static Runnable ToggleConsole_f = () -> { public static Runnable ToggleConsole_f = () -> {
SCR.EndLoadingPlaque(); // get rid of loading plaque SCR.EndLoadingPlaque(); // get rid of loading plaque
@@ -48,7 +52,7 @@ public final class Console extends Globals {
return; return;
} }
if (Globals.cls.state == Defines.ca_disconnected) { if (cls.state == Defines.ca_disconnected) {
// start the demo loop again // start the demo loop again
Cbuf.AddText("d1\n"); Cbuf.AddText("d1\n");
return; return;
@@ -57,12 +61,12 @@ public final class Console extends Globals {
Key.ClearTyping(); Key.ClearTyping();
Console.ClearNotify(); Console.ClearNotify();
if (Globals.cls.key_dest == Defines.key_console) { if (cls.key_dest == key_console) {
Menu.ForceMenuOff(); Menu.ForceMenuOff();
Cvar.Set("paused", "0"); Cvar.Set("paused", "0");
} else { } else {
Menu.ForceMenuOff(); Menu.ForceMenuOff();
Globals.cls.key_dest = Defines.key_console; cls.key_dest = key_console;
if (Cvar.VariableValue("maxclients") == 1 if (Cvar.VariableValue("maxclients") == 1
&& Globals.server_state != 0) && Globals.server_state != 0)
@@ -70,7 +74,7 @@ public final class Console extends Globals {
} }
}; };
public static Runnable Clear_f = () -> Arrays.fill(Globals.con.text, (byte) ' '); public static Runnable Clear_f = () -> Arrays.fill(con.text, (byte) ' ');
public static Runnable Dump_f = () -> { public static Runnable Dump_f = () -> {
@@ -139,7 +143,7 @@ public final class Console extends Globals {
* *
*/ */
public static void Init() { public static void Init() {
Globals.con.linewidth = -1; con.linewidth = -1;
CheckResize(); CheckResize();
@@ -156,7 +160,7 @@ public final class Console extends Globals {
Cmd.AddCommand("messagemode2", MessageMode2_f); Cmd.AddCommand("messagemode2", MessageMode2_f);
Cmd.AddCommand("clear", Clear_f); Cmd.AddCommand("clear", Clear_f);
Cmd.AddCommand("condump", Dump_f); Cmd.AddCommand("condump", Dump_f);
Globals.con.initialized = true; con.initialized = true;
} }
/** /**
@@ -167,41 +171,41 @@ public final class Console extends Globals {
int width = (Globals.viddef.width >> 3) - 2; int width = (Globals.viddef.width >> 3) - 2;
if (width > Defines.MAXCMDLINE) width = Defines.MAXCMDLINE; if (width > Defines.MAXCMDLINE) width = Defines.MAXCMDLINE;
if (width == Globals.con.linewidth) if (width == con.linewidth)
return; return;
if (width < 1) { // video hasn't been initialized yet if (width < 1) { // video hasn't been initialized yet
width = 38; width = 38;
Globals.con.linewidth = width; con.linewidth = width;
Globals.con.totallines = Defines.CON_TEXTSIZE con.totallines = Defines.CON_TEXTSIZE
/ Globals.con.linewidth; / con.linewidth;
Arrays.fill(Globals.con.text, (byte) ' '); Arrays.fill(con.text, (byte) ' ');
} else { } else {
int oldwidth = Globals.con.linewidth; int oldwidth = con.linewidth;
Globals.con.linewidth = width; con.linewidth = width;
int oldtotallines = Globals.con.totallines; int oldtotallines = con.totallines;
Globals.con.totallines = Defines.CON_TEXTSIZE con.totallines = Defines.CON_TEXTSIZE
/ Globals.con.linewidth; / con.linewidth;
int numlines = oldtotallines; int numlines = oldtotallines;
if (Globals.con.totallines < numlines) if (con.totallines < numlines)
numlines = Globals.con.totallines; numlines = con.totallines;
int numchars = oldwidth; int numchars = oldwidth;
if (Globals.con.linewidth < numchars) if (con.linewidth < numchars)
numchars = Globals.con.linewidth; numchars = con.linewidth;
byte[] tbuf = new byte[Defines.CON_TEXTSIZE]; byte[] tbuf = new byte[Defines.CON_TEXTSIZE];
System System
.arraycopy(Globals.con.text, 0, tbuf, 0, .arraycopy(con.text, 0, tbuf, 0,
Defines.CON_TEXTSIZE); Defines.CON_TEXTSIZE);
Arrays.fill(Globals.con.text, (byte) ' '); Arrays.fill(con.text, (byte) ' ');
for (int i = 0; i < numlines; i++) { for (int i = 0; i < numlines; i++) {
for (int j = 0; j < numchars; j++) { for (int j = 0; j < numchars; j++) {
Globals.con.text[(Globals.con.totallines - 1 - i) con.text[(con.totallines - 1 - i)
* Globals.con.linewidth + j] = tbuf[((Globals.con.current * con.linewidth + j] = tbuf[((con.current
- i + oldtotallines) % oldtotallines) - i + oldtotallines) % oldtotallines)
* oldwidth + j]; * oldwidth + j];
} }
@@ -210,14 +214,14 @@ public final class Console extends Globals {
Console.ClearNotify(); Console.ClearNotify();
} }
Globals.con.current = Globals.con.totallines - 1; con.current = con.totallines - 1;
Globals.con.display = Globals.con.current; con.display = con.current;
} }
public static void ClearNotify() { public static void ClearNotify() {
int i; int i;
for (i = 0; i < Defines.NUM_CON_TIMES; i++) for (i = 0; i < Defines.NUM_CON_TIMES; i++)
Globals.con.times[i] = 0; con.times[i] = 0;
} }
static void DrawString(int x, int y, String s) { static void DrawString(int x, int y, String s) {
@@ -271,15 +275,15 @@ public final class Console extends Globals {
* =============== Con_Linefeed =============== * =============== Con_Linefeed ===============
*/ */
static void Linefeed() { static void Linefeed() {
Globals.con.x = 0; con.x = 0;
if (Globals.con.display == Globals.con.current) if (con.display == con.current)
Globals.con.display++; con.display++;
Globals.con.current++; con.current++;
int i = (Globals.con.current % Globals.con.totallines) int i = (con.current % con.totallines)
* Globals.con.linewidth; * con.linewidth;
int e = i + Globals.con.linewidth; int e = i + con.linewidth;
while (i++ < e) while (i++ < e)
Globals.con.text[i] = ' '; con.text[i] = ' ';
} }
/* /*

View File

@@ -32,11 +32,13 @@ import java.io.IOException;
import java.io.RandomAccessFile; import java.io.RandomAccessFile;
import java.util.Vector; import java.util.Vector;
import static lwjake2.Globals.*;
/** /**
* Key * Key
*/ */
@Slf4j @Slf4j
public class Key extends Globals { public class Key {
// //
// these are the key numbers that should be passed to Key_Event // these are the key numbers that should be passed to Key_Event
// //

View File

@@ -30,13 +30,15 @@ import lwjake2.util.Lib;
import lwjake2.util.Math3D; import lwjake2.util.Math3D;
import lwjake2.util.QuakeFile; import lwjake2.util.QuakeFile;
import java.awt.Dimension; import java.awt.*;
import java.io.RandomAccessFile; import java.io.RandomAccessFile;
import java.util.Arrays; import java.util.Arrays;
import java.util.Objects; import java.util.Objects;
import static lwjake2.Defines.*;
import static lwjake2.ErrorCode.ERR_DROP; import static lwjake2.ErrorCode.ERR_DROP;
import static lwjake2.ErrorCode.ERR_FATAL; import static lwjake2.ErrorCode.ERR_FATAL;
import static lwjake2.Globals.*;
/** /**
* Menu * Menu

View File

@@ -29,18 +29,20 @@ import lwjake2.sys.Timer;
import lwjake2.util.Lib; import lwjake2.util.Lib;
import lwjake2.util.Vargs; import lwjake2.util.Vargs;
import java.awt.Dimension; import java.awt.*;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.util.Arrays; import java.util.Arrays;
import static lwjake2.Defines.*;
import static lwjake2.ErrorCode.ERR_DROP; import static lwjake2.ErrorCode.ERR_DROP;
import static lwjake2.Globals.*;
/** /**
* SCR * SCR
*/ */
@Slf4j @Slf4j
public final class SCR extends Globals { public final class SCR {
private static final FileSystem fileSystem = BaseQ2FileSystem.getInstance(); private static final FileSystem fileSystem = BaseQ2FileSystem.getInstance();
// cl_scrn.c -- master for refresh, status bar, console, chat, notify, etc // cl_scrn.c -- master for refresh, status bar, console, chat, notify, etc

View File

@@ -19,7 +19,6 @@
package lwjake2.client; package lwjake2.client;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import lwjake2.Globals;
import lwjake2.game.Cmd; import lwjake2.game.Cmd;
import lwjake2.game.cvar_t; import lwjake2.game.cvar_t;
import lwjake2.qcommon.Com; import lwjake2.qcommon.Com;
@@ -30,13 +29,15 @@ import lwjake2.util.Math3D;
import java.io.IOException; import java.io.IOException;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import static lwjake2.Defines.*;
import static lwjake2.ErrorCode.ERR_DROP; import static lwjake2.ErrorCode.ERR_DROP;
import static lwjake2.Globals.*;
/** /**
* V * V
*/ */
@Slf4j @Slf4j
public final class V extends Globals { public final class V {
static cvar_t cl_testblend; static cvar_t cl_testblend;
static cvar_t cl_testparticles; static cvar_t cl_testparticles;

View File

@@ -24,7 +24,6 @@ import lwjake2.ErrorCode;
import lwjake2.Globals; import lwjake2.Globals;
import lwjake2.game.Cmd; import lwjake2.game.Cmd;
import lwjake2.game.cvar_t; import lwjake2.game.cvar_t;
import lwjake2.qcommon.Callback;
import lwjake2.qcommon.Com; import lwjake2.qcommon.Com;
import lwjake2.qcommon.Cvar; import lwjake2.qcommon.Cvar;
import lwjake2.render.Renderer; import lwjake2.render.Renderer;
@@ -32,8 +31,11 @@ import lwjake2.sound.S;
import lwjake2.sys.IN; import lwjake2.sys.IN;
import lwjake2.util.Vargs; import lwjake2.util.Vargs;
import java.awt.Dimension; import java.awt.*;
import java.awt.DisplayMode;
import static lwjake2.Defines.*;
import static lwjake2.Globals.re;
import static lwjake2.Globals.viddef;
/** /**
* VID is a video driver. * VID is a video driver.
@@ -43,7 +45,7 @@ import java.awt.DisplayMode;
* @author cwei * @author cwei
*/ */
@Slf4j @Slf4j
public class VID extends Globals { public class VID {
// Main windowed and fullscreen graphics interface module. This module // Main windowed and fullscreen graphics interface module. This module
// is used for both the software and OpenGL rendering versions of the // is used for both the software and OpenGL rendering versions of the
// Quake refresh engine. // Quake refresh engine.

View File

@@ -29,10 +29,13 @@ import java.io.IOException;
import java.io.RandomAccessFile; import java.io.RandomAccessFile;
import java.util.Vector; import java.util.Vector;
import static lwjake2.Defines.*;
import static lwjake2.Globals.cvar_vars;
/** /**
* Cvar implements console variables. The original code is located in cvar.c * Cvar implements console variables. The original code is located in cvar.c
*/ */
public class Cvar extends Globals { public class Cvar {
private static final FileSystem fileSystem = BaseQ2FileSystem.getInstance(); private static final FileSystem fileSystem = BaseQ2FileSystem.getInstance();
/** /**
@@ -77,8 +80,8 @@ public class Cvar extends Globals {
var.value = 0.0f; var.value = 0.0f;
} }
// link the variable in // link the variable in
var.next = Globals.cvar_vars; var.next = cvar_vars;
Globals.cvar_vars = var; cvar_vars = var;
var.flags = flags; var.flags = flags;
@@ -99,7 +102,7 @@ public class Cvar extends Globals {
static cvar_t FindVar(String var_name) { static cvar_t FindVar(String var_name) {
cvar_t var; cvar_t var;
for (var = Globals.cvar_vars; var != null; var = var.next) { for (var = cvar_vars; var != null; var = var.next) {
if (var_name.equals(var.name)) if (var_name.equals(var.name))
return var; return var;
} }
@@ -262,7 +265,7 @@ public class Cvar extends Globals {
int i; int i;
i = 0; i = 0;
for (var = Globals.cvar_vars; var != null; var = var.next, i++) { for (var = cvar_vars; var != null; var = var.next, i++) {
if ((var.flags & CVAR_ARCHIVE) != 0) if ((var.flags & CVAR_ARCHIVE) != 0)
Com.Printf("*"); Com.Printf("*");
else else
@@ -348,7 +351,7 @@ public class Cvar extends Globals {
info = ""; info = "";
for (var = Globals.cvar_vars; var != null; var = var.next) { for (var = cvar_vars; var != null; var = var.next) {
if ((var.flags & bit) != 0) if ((var.flags & bit) != 0)
info = Info.Info_SetValueForKey(info, var.name, var.string); info = Info.Info_SetValueForKey(info, var.name, var.string);
} }
@@ -369,7 +372,7 @@ public class Cvar extends Globals {
public static void GetLatchedVars() { public static void GetLatchedVars() {
cvar_t var; cvar_t var;
for (var = Globals.cvar_vars; var != null; var = var.next) { for (var = cvar_vars; var != null; var = var.next) {
if (var.latched_string == null || var.latched_string.length() == 0) if (var.latched_string == null || var.latched_string.length() == 0)
continue; continue;
var.string = var.latched_string; var.string = var.latched_string;
@@ -433,7 +436,7 @@ public class Cvar extends Globals {
Vector<String> vars = new Vector<String>(); Vector<String> vars = new Vector<String>();
// check match // check match
for (cvar_t cvar = Globals.cvar_vars; cvar != null; cvar = cvar.next) for (cvar_t cvar = cvar_vars; cvar != null; cvar = cvar.next)
if (cvar.name.startsWith(partial)) if (cvar.name.startsWith(partial))
vars.add(cvar.name); vars.add(cvar.name);

View File

@@ -18,16 +18,17 @@
package lwjake2.qcommon; package lwjake2.qcommon;
import lwjake2.Globals;
import lwjake2.game.entity_state_t; import lwjake2.game.entity_state_t;
import lwjake2.game.usercmd_t; import lwjake2.game.usercmd_t;
import lwjake2.util.Lib; import lwjake2.util.Lib;
import lwjake2.util.Math3D; import lwjake2.util.Math3D;
import static lwjake2.Defines.*;
import static lwjake2.ErrorCode.ERR_DROP; import static lwjake2.ErrorCode.ERR_DROP;
import static lwjake2.ErrorCode.ERR_FATAL; import static lwjake2.ErrorCode.ERR_FATAL;
import static lwjake2.Globals.bytedirs;
public class MSG extends Globals { public class MSG {
// //
// writing functions // writing functions

View File

@@ -33,12 +33,14 @@ import lwjake2.util.Vargs;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import static lwjake2.Defines.*;
/** /**
* Qcommon contains some basic routines for the game engine * Qcommon contains some basic routines for the game engine
* namely initialization, shutdown and frame generation. * namely initialization, shutdown and frame generation.
*/ */
@Slf4j @Slf4j
public final class Qcommon extends Globals { public final class Qcommon {
private static final FileSystem fileSystem = BaseQ2FileSystem.getInstance(); private static final FileSystem fileSystem = BaseQ2FileSystem.getInstance();
public static final String BUILDSTRING = "Java " + System.getProperty("java.version");; public static final String BUILDSTRING = "Java " + System.getProperty("java.version");;
public static final String CPUSTRING = System.getProperty("os.arch"); public static final String CPUSTRING = System.getProperty("os.arch");

View File

@@ -929,7 +929,7 @@ public abstract class Main extends Base {
* R_Register * R_Register
*/ */
protected void R_Register() { protected void R_Register() {
r_lefthand = Cvar.Get("hand", "0", Globals.CVAR_USERINFO | Globals.CVAR_ARCHIVE); r_lefthand = Cvar.Get("hand", "0", Defines.CVAR_USERINFO | Defines.CVAR_ARCHIVE);
r_norefresh = Cvar.Get("r_norefresh", "0", 0); r_norefresh = Cvar.Get("r_norefresh", "0", 0);
r_fullbright = Cvar.Get("r_fullbright", "0", 0); r_fullbright = Cvar.Get("r_fullbright", "0", 0);
r_drawentities = Cvar.Get("r_drawentities", "1", 0); r_drawentities = Cvar.Get("r_drawentities", "1", 0);
@@ -944,19 +944,19 @@ public abstract class Main extends Base {
gl_nosubimage = Cvar.Get("gl_nosubimage", "0", 0); gl_nosubimage = Cvar.Get("gl_nosubimage", "0", 0);
gl_allow_software = Cvar.Get("gl_allow_software", "0", 0); gl_allow_software = Cvar.Get("gl_allow_software", "0", 0);
gl_particle_min_size = Cvar.Get("gl_particle_min_size", "2", Globals.CVAR_ARCHIVE); gl_particle_min_size = Cvar.Get("gl_particle_min_size", "2", Defines.CVAR_ARCHIVE);
gl_particle_max_size = Cvar.Get("gl_particle_max_size", "40", Globals.CVAR_ARCHIVE); gl_particle_max_size = Cvar.Get("gl_particle_max_size", "40", Defines.CVAR_ARCHIVE);
gl_particle_size = Cvar.Get("gl_particle_size", "40", Globals.CVAR_ARCHIVE); gl_particle_size = Cvar.Get("gl_particle_size", "40", Defines.CVAR_ARCHIVE);
gl_particle_att_a = Cvar.Get("gl_particle_att_a", "0.01", Globals.CVAR_ARCHIVE); gl_particle_att_a = Cvar.Get("gl_particle_att_a", "0.01", Defines.CVAR_ARCHIVE);
gl_particle_att_b = Cvar.Get("gl_particle_att_b", "0.0", Globals.CVAR_ARCHIVE); gl_particle_att_b = Cvar.Get("gl_particle_att_b", "0.0", Defines.CVAR_ARCHIVE);
gl_particle_att_c = Cvar.Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); gl_particle_att_c = Cvar.Get("gl_particle_att_c", "0.01", Defines.CVAR_ARCHIVE);
gl_modulate = Cvar.Get("gl_modulate", "1.5", Globals.CVAR_ARCHIVE); gl_modulate = Cvar.Get("gl_modulate", "1.5", Defines.CVAR_ARCHIVE);
gl_log = Cvar.Get("gl_log", "0", 0); gl_log = Cvar.Get("gl_log", "0", 0);
gl_bitdepth = Cvar.Get("gl_bitdepth", "0", 0); gl_bitdepth = Cvar.Get("gl_bitdepth", "0", 0);
gl_mode = Cvar.Get("gl_mode", "3", Globals.CVAR_ARCHIVE); // 640x480 gl_mode = Cvar.Get("gl_mode", "3", Defines.CVAR_ARCHIVE); // 640x480
gl_lightmap = Cvar.Get("gl_lightmap", "0", 0); gl_lightmap = Cvar.Get("gl_lightmap", "0", 0);
gl_shadows = Cvar.Get("gl_shadows", "0", Globals.CVAR_ARCHIVE); gl_shadows = Cvar.Get("gl_shadows", "0", Defines.CVAR_ARCHIVE);
gl_dynamic = Cvar.Get("gl_dynamic", "1", 0); gl_dynamic = Cvar.Get("gl_dynamic", "1", 0);
gl_nobind = Cvar.Get("gl_nobind", "0", 0); gl_nobind = Cvar.Get("gl_nobind", "0", 0);
gl_round_down = Cvar.Get("gl_round_down", "1", 0); gl_round_down = Cvar.Get("gl_round_down", "1", 0);
@@ -964,37 +964,37 @@ public abstract class Main extends Base {
gl_skymip = Cvar.Get("gl_skymip", "0", 0); gl_skymip = Cvar.Get("gl_skymip", "0", 0);
gl_showtris = Cvar.Get("gl_showtris", "0", 0); gl_showtris = Cvar.Get("gl_showtris", "0", 0);
gl_ztrick = Cvar.Get("gl_ztrick", "0", 0); gl_ztrick = Cvar.Get("gl_ztrick", "0", 0);
gl_finish = Cvar.Get("gl_finish", "0", Globals.CVAR_ARCHIVE); gl_finish = Cvar.Get("gl_finish", "0", Defines.CVAR_ARCHIVE);
gl_clear = Cvar.Get("gl_clear", "0", 0); gl_clear = Cvar.Get("gl_clear", "0", 0);
gl_cull = Cvar.Get("gl_cull", "1", 0); gl_cull = Cvar.Get("gl_cull", "1", 0);
gl_polyblend = Cvar.Get("gl_polyblend", "1", 0); gl_polyblend = Cvar.Get("gl_polyblend", "1", 0);
gl_flashblend = Cvar.Get("gl_flashblend", "0", 0); gl_flashblend = Cvar.Get("gl_flashblend", "0", 0);
gl_playermip = Cvar.Get("gl_playermip", "0", 0); gl_playermip = Cvar.Get("gl_playermip", "0", 0);
gl_monolightmap = Cvar.Get("gl_monolightmap", "0", 0); gl_monolightmap = Cvar.Get("gl_monolightmap", "0", 0);
gl_driver = Cvar.Get("gl_driver", "opengl32", Globals.CVAR_ARCHIVE); gl_driver = Cvar.Get("gl_driver", "opengl32", Defines.CVAR_ARCHIVE);
gl_texturemode = Cvar.Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", Globals.CVAR_ARCHIVE); gl_texturemode = Cvar.Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", Defines.CVAR_ARCHIVE);
gl_texturealphamode = Cvar.Get("gl_texturealphamode", "default", Globals.CVAR_ARCHIVE); gl_texturealphamode = Cvar.Get("gl_texturealphamode", "default", Defines.CVAR_ARCHIVE);
gl_texturesolidmode = Cvar.Get("gl_texturesolidmode", "default", Globals.CVAR_ARCHIVE); gl_texturesolidmode = Cvar.Get("gl_texturesolidmode", "default", Defines.CVAR_ARCHIVE);
gl_lockpvs = Cvar.Get("gl_lockpvs", "0", 0); gl_lockpvs = Cvar.Get("gl_lockpvs", "0", 0);
gl_vertex_arrays = Cvar.Get("gl_vertex_arrays", "1", Globals.CVAR_ARCHIVE); gl_vertex_arrays = Cvar.Get("gl_vertex_arrays", "1", Defines.CVAR_ARCHIVE);
gl_ext_swapinterval = Cvar.Get("gl_ext_swapinterval", "1", Globals.CVAR_ARCHIVE); gl_ext_swapinterval = Cvar.Get("gl_ext_swapinterval", "1", Defines.CVAR_ARCHIVE);
gl_ext_palettedtexture = Cvar.Get("gl_ext_palettedtexture", "0", Globals.CVAR_ARCHIVE); gl_ext_palettedtexture = Cvar.Get("gl_ext_palettedtexture", "0", Defines.CVAR_ARCHIVE);
gl_ext_multitexture = Cvar.Get("gl_ext_multitexture", "1", Globals.CVAR_ARCHIVE); gl_ext_multitexture = Cvar.Get("gl_ext_multitexture", "1", Defines.CVAR_ARCHIVE);
gl_ext_pointparameters = Cvar.Get("gl_ext_pointparameters", "1", Globals.CVAR_ARCHIVE); gl_ext_pointparameters = Cvar.Get("gl_ext_pointparameters", "1", Defines.CVAR_ARCHIVE);
gl_ext_compiled_vertex_array = Cvar.Get("gl_ext_compiled_vertex_array", "1", Globals.CVAR_ARCHIVE); gl_ext_compiled_vertex_array = Cvar.Get("gl_ext_compiled_vertex_array", "1", Defines.CVAR_ARCHIVE);
gl_drawbuffer = Cvar.Get("gl_drawbuffer", "GL_BACK", 0); gl_drawbuffer = Cvar.Get("gl_drawbuffer", "GL_BACK", 0);
gl_swapinterval = Cvar.Get("gl_swapinterval", "0", Globals.CVAR_ARCHIVE); gl_swapinterval = Cvar.Get("gl_swapinterval", "0", Defines.CVAR_ARCHIVE);
gl_saturatelighting = Cvar.Get("gl_saturatelighting", "0", 0); gl_saturatelighting = Cvar.Get("gl_saturatelighting", "0", 0);
gl_3dlabs_broken = Cvar.Get("gl_3dlabs_broken", "1", Globals.CVAR_ARCHIVE); gl_3dlabs_broken = Cvar.Get("gl_3dlabs_broken", "1", Defines.CVAR_ARCHIVE);
vid_fullscreen = Cvar.Get("vid_fullscreen", "0", Globals.CVAR_ARCHIVE); vid_fullscreen = Cvar.Get("vid_fullscreen", "0", Defines.CVAR_ARCHIVE);
vid_gamma = Cvar.Get("vid_gamma", "1.0", Globals.CVAR_ARCHIVE); vid_gamma = Cvar.Get("vid_gamma", "1.0", Defines.CVAR_ARCHIVE);
vid_ref = Cvar.Get("vid_ref", "lwjgl", Globals.CVAR_ARCHIVE); vid_ref = Cvar.Get("vid_ref", "lwjgl", Defines.CVAR_ARCHIVE);
Cmd.AddCommand("imagelist", this::GL_ImageList_f); Cmd.AddCommand("imagelist", this::GL_ImageList_f);

View File

@@ -352,7 +352,7 @@ public class Channel {
*/ */
static void addLoopSounds() { static void addLoopSounds() {
if ((Globals.cl_paused.value != 0.0f) || (Globals.cls.state != Globals.ca_active) || !Globals.cl.sound_prepped) { if ((Globals.cl_paused.value != 0.0f) || (Globals.cls.state != Defines.ca_active) || !Globals.cl.sound_prepped) {
removeUnusedLoopSounds(); removeUnusedLoopSounds();
return; return;
} }

View File

@@ -336,7 +336,7 @@ public final class LWJGLSoundImpl implements Sound {
// determine what model the client is using // determine what model the client is using
String model = null; String model = null;
int n = Globals.CS_PLAYERSKINS + ent.number - 1; int n = Defines.CS_PLAYERSKINS + ent.number - 1;
if (Globals.cl.configstrings[n] != null) { if (Globals.cl.configstrings[n] != null) {
int p = Globals.cl.configstrings[n].indexOf('\\'); int p = Globals.cl.configstrings[n].indexOf('\\');
if (p >= 0) { if (p >= 0) {

View File

@@ -26,10 +26,13 @@ import lwjake2.game.usercmd_t;
import lwjake2.qcommon.Cvar; import lwjake2.qcommon.Cvar;
import lwjake2.util.Math3D; import lwjake2.util.Math3D;
import static lwjake2.Defines.*;
import static lwjake2.Globals.*;
/** /**
* IN * IN
*/ */
public final class IN extends Globals { public final class IN {
static boolean mouse_avail = true; static boolean mouse_avail = true;

View File

@@ -33,7 +33,7 @@ import java.util.regex.PatternSyntaxException;
* Sys * Sys
*/ */
@Slf4j @Slf4j
public final class Sys extends Defines { public final class Sys {
public static void Error(String error) { public static void Error(String error) {
CL.Shutdown(); CL.Shutdown();