0

tabs -> spaces

This commit is contained in:
2018-12-18 12:52:10 +03:00
parent 662170dcd6
commit a367c7f04d
209 changed files with 27345 additions and 27345 deletions

View File

@@ -25,47 +25,47 @@ import org.lwjgl.openal.EFX10;
*/ */
public abstract class EFXEffect { public abstract class EFXEffect {
private int slotIndex; private int slotIndex;
private int effectIndex; private int effectIndex;
/** Constructor creates an EFX effect slot containing an effect. /** Constructor creates an EFX effect slot containing an effect.
* @param efxEffect The EFX10 effect type (i.e. EFX10.AL_EFFECT_REVERB) * @param efxEffect The EFX10 effect type (i.e. EFX10.AL_EFFECT_REVERB)
*/ */
public EFXEffect(int efxEffect) { public EFXEffect(int efxEffect) {
slotIndex = EFX10.alGenAuxiliaryEffectSlots(); slotIndex = EFX10.alGenAuxiliaryEffectSlots();
effectIndex = EFX10.alGenEffects(); effectIndex = EFX10.alGenEffects();
// TODO: Check to see if efxEffect is a valid AL_EFFECT_TYPE. // TODO: Check to see if efxEffect is a valid AL_EFFECT_TYPE.
EFX10.alEffecti(effectIndex, EFX10.AL_EFFECT_TYPE, efxEffect); EFX10.alEffecti(effectIndex, EFX10.AL_EFFECT_TYPE, efxEffect);
EFX10.alAuxiliaryEffectSloti(slotIndex, EFX10.AL_EFFECTSLOT_EFFECT, effectIndex); EFX10.alAuxiliaryEffectSloti(slotIndex, EFX10.AL_EFFECTSLOT_EFFECT, effectIndex);
} }
/** Unloads the EFX effect and effect slot. */ /** Unloads the EFX effect and effect slot. */
public void killEffect() { public void killEffect() {
EFX10.alDeleteEffects(effectIndex); EFX10.alDeleteEffects(effectIndex);
EFX10.alDeleteAuxiliaryEffectSlots(slotIndex); EFX10.alDeleteAuxiliaryEffectSlots(slotIndex);
} }
/** Returns the index of the EFX effect slot. /** Returns the index of the EFX effect slot.
* @return The index of the EFX effect slot * @return The index of the EFX effect slot
*/ */
public int getIndex() { public int getIndex() {
return slotIndex; return slotIndex;
} }
/** Applies an effect property to this EFX effect. /** Applies an effect property to this EFX effect.
* @param passedProperty The EFX10 effect property * @param passedProperty The EFX10 effect property
* @param passedValue The EFX10 effect value * @param passedValue The EFX10 effect value
*/ */
protected void addEffectf(int passedProperty, float passedValue) { protected void addEffectf(int passedProperty, float passedValue) {
EFX10.alEffectf(effectIndex, passedProperty, passedValue); EFX10.alEffectf(effectIndex, passedProperty, passedValue);
} }
/** Applies an effect property to this EFX effect. /** Applies an effect property to this EFX effect.
* @param passedProperty The EFX10 effect property * @param passedProperty The EFX10 effect property
* @param passedValue The EFX10 effect value * @param passedValue The EFX10 effect value
*/ */
protected void addEffecti(int passedProperty, int passedValue) { protected void addEffecti(int passedProperty, int passedValue) {
EFX10.alEffecti(effectIndex, passedProperty, passedValue); EFX10.alEffecti(effectIndex, passedProperty, passedValue);
} }
} }

View File

@@ -25,69 +25,69 @@ import org.lwjgl.openal.EFX10;
*/ */
public class EFXEffectEcho extends EFXEffect { public class EFXEffectEcho extends EFXEffect {
/** Constructor creates a generic echo effect. */ /** Constructor creates a generic echo effect. */
public EFXEffectEcho() { public EFXEffectEcho() {
super(EFX10.AL_EFFECT_ECHO); super(EFX10.AL_EFFECT_ECHO);
} }
/** Sets the amount of high frequency damping to apply to the echo effect. /** Sets the amount of high frequency damping to apply to the echo effect.
* @param passedValue The new damping value to apply to the echo effect * @param passedValue The new damping value to apply to the echo effect
*/ */
public void setDamping(float passedValue) { public void setDamping(float passedValue) {
if (passedValue < EFX10.AL_ECHO_MIN_DAMPING) if (passedValue < EFX10.AL_ECHO_MIN_DAMPING)
addEffectf(EFX10.AL_ECHO_DAMPING, EFX10.AL_ECHO_MIN_DAMPING); addEffectf(EFX10.AL_ECHO_DAMPING, EFX10.AL_ECHO_MIN_DAMPING);
else if (passedValue > EFX10.AL_ECHO_MAX_DAMPING) else if (passedValue > EFX10.AL_ECHO_MAX_DAMPING)
addEffectf(EFX10.AL_ECHO_DAMPING, EFX10.AL_ECHO_MAX_DAMPING); addEffectf(EFX10.AL_ECHO_DAMPING, EFX10.AL_ECHO_MAX_DAMPING);
else else
addEffectf(EFX10.AL_ECHO_DAMPING, passedValue); addEffectf(EFX10.AL_ECHO_DAMPING, passedValue);
} }
/** Sets the echo effect's delay time. /** Sets the echo effect's delay time.
* @param passedValue The echo effect's new delay time * @param passedValue The echo effect's new delay time
*/ */
public void setDelay(float passedValue) { public void setDelay(float passedValue) {
if (passedValue < EFX10.AL_ECHO_MIN_DELAY) if (passedValue < EFX10.AL_ECHO_MIN_DELAY)
addEffectf(EFX10.AL_ECHO_DELAY, EFX10.AL_ECHO_MIN_DELAY); addEffectf(EFX10.AL_ECHO_DELAY, EFX10.AL_ECHO_MIN_DELAY);
else if (passedValue > EFX10.AL_ECHO_MAX_DELAY) else if (passedValue > EFX10.AL_ECHO_MAX_DELAY)
addEffectf(EFX10.AL_ECHO_DELAY, EFX10.AL_ECHO_MAX_DELAY); addEffectf(EFX10.AL_ECHO_DELAY, EFX10.AL_ECHO_MAX_DELAY);
else else
addEffectf(EFX10.AL_ECHO_DELAY, passedValue); addEffectf(EFX10.AL_ECHO_DELAY, passedValue);
} }
/** Sets the amount of feedback to echo back. /** Sets the amount of feedback to echo back.
* @param passedValue The new feedback volume of the echo effect * @param passedValue The new feedback volume of the echo effect
*/ */
public void setFeedback(float passedValue) { public void setFeedback(float passedValue) {
if (passedValue < EFX10.AL_ECHO_MIN_FEEDBACK) if (passedValue < EFX10.AL_ECHO_MIN_FEEDBACK)
addEffectf(EFX10.AL_ECHO_FEEDBACK, EFX10.AL_ECHO_MIN_FEEDBACK); addEffectf(EFX10.AL_ECHO_FEEDBACK, EFX10.AL_ECHO_MIN_FEEDBACK);
else if (passedValue > EFX10.AL_ECHO_MAX_FEEDBACK) else if (passedValue > EFX10.AL_ECHO_MAX_FEEDBACK)
addEffectf(EFX10.AL_ECHO_FEEDBACK, EFX10.AL_ECHO_MAX_FEEDBACK); addEffectf(EFX10.AL_ECHO_FEEDBACK, EFX10.AL_ECHO_MAX_FEEDBACK);
else else
addEffectf(EFX10.AL_ECHO_FEEDBACK, passedValue); addEffectf(EFX10.AL_ECHO_FEEDBACK, passedValue);
} }
/** Sets the delay between each echo "tap". /** Sets the delay between each echo "tap".
* @param passedValue The new delay time between each echo "tap" * @param passedValue The new delay time between each echo "tap"
*/ */
public void setLRDelay(float passedValue) { public void setLRDelay(float passedValue) {
if (passedValue < EFX10.AL_ECHO_MIN_LRDELAY) if (passedValue < EFX10.AL_ECHO_MIN_LRDELAY)
addEffectf(EFX10.AL_ECHO_LRDELAY, EFX10.AL_ECHO_MIN_LRDELAY); addEffectf(EFX10.AL_ECHO_LRDELAY, EFX10.AL_ECHO_MIN_LRDELAY);
else if (passedValue > EFX10.AL_ECHO_MAX_LRDELAY) else if (passedValue > EFX10.AL_ECHO_MAX_LRDELAY)
addEffectf(EFX10.AL_ECHO_LRDELAY, EFX10.AL_ECHO_MAX_LRDELAY); addEffectf(EFX10.AL_ECHO_LRDELAY, EFX10.AL_ECHO_MAX_LRDELAY);
else else
addEffectf(EFX10.AL_ECHO_LRDELAY, passedValue); addEffectf(EFX10.AL_ECHO_LRDELAY, passedValue);
} }
/** Sets the amount of hard panning allowed for each echo. /** Sets the amount of hard panning allowed for each echo.
* @param passedValue The new level of flexibility for the echo effect's panning * @param passedValue The new level of flexibility for the echo effect's panning
*/ */
public void setSpread(float passedValue) { public void setSpread(float passedValue) {
if (passedValue < EFX10.AL_ECHO_MIN_SPREAD) if (passedValue < EFX10.AL_ECHO_MIN_SPREAD)
addEffectf(EFX10.AL_ECHO_SPREAD, EFX10.AL_ECHO_MIN_SPREAD); addEffectf(EFX10.AL_ECHO_SPREAD, EFX10.AL_ECHO_MIN_SPREAD);
else if (passedValue > EFX10.AL_ECHO_MAX_SPREAD) else if (passedValue > EFX10.AL_ECHO_MAX_SPREAD)
addEffectf(EFX10.AL_ECHO_SPREAD, EFX10.AL_ECHO_MAX_SPREAD); addEffectf(EFX10.AL_ECHO_SPREAD, EFX10.AL_ECHO_MAX_SPREAD);
else else
addEffectf(EFX10.AL_ECHO_SPREAD, passedValue); addEffectf(EFX10.AL_ECHO_SPREAD, passedValue);
} }
} }

View File

@@ -25,11 +25,11 @@ import org.lwjgl.openal.EFX10;
*/ */
public class EFXEffectReverb extends EFXEffect { public class EFXEffectReverb extends EFXEffect {
/** Constructor creates a generic reverb effect. */ /** Constructor creates a generic reverb effect. */
public EFXEffectReverb() { public EFXEffectReverb() {
super(EFX10.AL_EFFECT_REVERB); super(EFX10.AL_EFFECT_REVERB);
} }
// TODO: Add methods for all AL_EFFECT_REVERB properties. // TODO: Add methods for all AL_EFFECT_REVERB properties.
} }

View File

@@ -25,46 +25,46 @@ import org.lwjgl.openal.EFX10;
*/ */
public class EFXEffectRingModulator extends EFXEffect { public class EFXEffectRingModulator extends EFXEffect {
public static final int SINUSOID = EFX10.AL_RING_MODULATOR_SINUSOID; public static final int SINUSOID = EFX10.AL_RING_MODULATOR_SINUSOID;
public static final int SAWTOOTH = EFX10.AL_RING_MODULATOR_SAWTOOTH; public static final int SAWTOOTH = EFX10.AL_RING_MODULATOR_SAWTOOTH;
public static final int SQUARE = EFX10.AL_RING_MODULATOR_SQUARE; public static final int SQUARE = EFX10.AL_RING_MODULATOR_SQUARE;
/** Constructor creates a generic ring modulator effect. */ /** Constructor creates a generic ring modulator effect. */
public EFXEffectRingModulator() { public EFXEffectRingModulator() {
super(EFX10.AL_EFFECT_RING_MODULATOR); super(EFX10.AL_EFFECT_RING_MODULATOR);
} }
/** Sets the frequency of the ring modulator. /** Sets the frequency of the ring modulator.
* @param passedValue The new frequency of the ring modulator * @param passedValue The new frequency of the ring modulator
*/ */
public void setFrequency(float passedValue) { public void setFrequency(float passedValue) {
if (passedValue > EFX10.AL_RING_MODULATOR_MAX_FREQUENCY) if (passedValue > EFX10.AL_RING_MODULATOR_MAX_FREQUENCY)
addEffectf(EFX10.AL_RING_MODULATOR_FREQUENCY, EFX10.AL_RING_MODULATOR_MAX_FREQUENCY); addEffectf(EFX10.AL_RING_MODULATOR_FREQUENCY, EFX10.AL_RING_MODULATOR_MAX_FREQUENCY);
else if (passedValue < EFX10.AL_RING_MODULATOR_MIN_FREQUENCY) else if (passedValue < EFX10.AL_RING_MODULATOR_MIN_FREQUENCY)
addEffectf(EFX10.AL_RING_MODULATOR_FREQUENCY, EFX10.AL_RING_MODULATOR_MIN_FREQUENCY); addEffectf(EFX10.AL_RING_MODULATOR_FREQUENCY, EFX10.AL_RING_MODULATOR_MIN_FREQUENCY);
else else
addEffectf(EFX10.AL_RING_MODULATOR_FREQUENCY, passedValue); addEffectf(EFX10.AL_RING_MODULATOR_FREQUENCY, passedValue);
} }
/** Sets the high-pass cutoff for the ring modulator. /** Sets the high-pass cutoff for the ring modulator.
* @param passedValue The new cutoff value for the ring modulator high-pass filter * @param passedValue The new cutoff value for the ring modulator high-pass filter
*/ */
public void setHighPassCutoff(float passedValue) { public void setHighPassCutoff(float passedValue) {
if (passedValue > EFX10.AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF) if (passedValue > EFX10.AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF)
addEffectf(EFX10.AL_RING_MODULATOR_HIGHPASS_CUTOFF, EFX10.AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF); addEffectf(EFX10.AL_RING_MODULATOR_HIGHPASS_CUTOFF, EFX10.AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF);
else if (passedValue < EFX10.AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF) else if (passedValue < EFX10.AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF)
addEffectf(EFX10.AL_RING_MODULATOR_HIGHPASS_CUTOFF, EFX10.AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF); addEffectf(EFX10.AL_RING_MODULATOR_HIGHPASS_CUTOFF, EFX10.AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF);
else else
addEffectf(EFX10.AL_RING_MODULATOR_HIGHPASS_CUTOFF, passedValue); addEffectf(EFX10.AL_RING_MODULATOR_HIGHPASS_CUTOFF, passedValue);
} }
/** Sets the waveform of the ring modulator. /** Sets the waveform of the ring modulator.
* @param waveform Should be EFXEffectRingModulator.SINUSOID, SAWTOOTH or SQUARE * @param waveform Should be EFXEffectRingModulator.SINUSOID, SAWTOOTH or SQUARE
*/ */
public void setWaveform(int waveform) { public void setWaveform(int waveform) {
if (waveform != SINUSOID && waveform != SAWTOOTH && waveform != SQUARE) if (waveform != SINUSOID && waveform != SAWTOOTH && waveform != SQUARE)
return; return;
addEffecti(EFX10.AL_RING_MODULATOR_WAVEFORM, waveform); addEffecti(EFX10.AL_RING_MODULATOR_WAVEFORM, waveform);
} }
} }

View File

@@ -25,35 +25,35 @@ import org.lwjgl.openal.EFX10;
*/ */
public abstract class EFXFilter { public abstract class EFXFilter {
private int filterIndex; private int filterIndex;
/** Constructor creates an EFX effect slot containing a filter. /** Constructor creates an EFX effect slot containing a filter.
* @param efxFilter The EFX10 filter type (i.e. EFX10.AL_FILTER_HIGHPASS) * @param efxFilter The EFX10 filter type (i.e. EFX10.AL_FILTER_HIGHPASS)
*/ */
public EFXFilter(int efxFilter) { public EFXFilter(int efxFilter) {
filterIndex = EFX10.alGenFilters(); filterIndex = EFX10.alGenFilters();
// TODO: Check to see if efxFilter is a valid AL_FILTER_TYPE. // TODO: Check to see if efxFilter is a valid AL_FILTER_TYPE.
EFX10.alFilteri(filterIndex, EFX10.AL_FILTER_TYPE, efxFilter); EFX10.alFilteri(filterIndex, EFX10.AL_FILTER_TYPE, efxFilter);
} }
/** Unloads the EFX filter. */ /** Unloads the EFX filter. */
public void killFilter() { public void killFilter() {
EFX10.alDeleteFilters(filterIndex); EFX10.alDeleteFilters(filterIndex);
} }
/** Returns the index of the EFX filter. /** Returns the index of the EFX filter.
* @return The index of the EFX filter * @return The index of the EFX filter
*/ */
public int getIndex() { public int getIndex() {
return filterIndex; return filterIndex;
} }
/** Applies a filter property to this EFX filter. /** Applies a filter property to this EFX filter.
* @param passedProperty The EFX10 filter property * @param passedProperty The EFX10 filter property
* @param passedValue The EFX10 filter value * @param passedValue The EFX10 filter value
*/ */
protected void addFilter(int passedProperty, float passedValue) { protected void addFilter(int passedProperty, float passedValue) {
EFX10.alFilterf(filterIndex, passedProperty, passedValue); EFX10.alFilterf(filterIndex, passedProperty, passedValue);
} }
} }

View File

@@ -26,22 +26,22 @@ import org.lwjgl.openal.EFX10;
public class EFXFilterLowPass extends EFXFilter { public class EFXFilterLowPass extends EFXFilter {
/** Constructor creates a generic low-pass filter. */ /** Constructor creates a generic low-pass filter. */
public EFXFilterLowPass() { public EFXFilterLowPass() {
super(EFX10.AL_FILTER_LOWPASS); super(EFX10.AL_FILTER_LOWPASS);
} }
/** Sets the gain of the low-pass filter. /** Sets the gain of the low-pass filter.
* @param passedValue The new value of the low-pass filter gain * @param passedValue The new value of the low-pass filter gain
*/ */
public void setGain(float passedValue) { public void setGain(float passedValue) {
addFilter(EFX10.AL_LOWPASS_GAIN, passedValue); addFilter(EFX10.AL_LOWPASS_GAIN, passedValue);
} }
/** Sets the gain of the low-pass filter's high frequencies. /** Sets the gain of the low-pass filter's high frequencies.
* @param passedValue The new value of the low-pass filter's HF gain * @param passedValue The new value of the low-pass filter's HF gain
*/ */
public void setGainHF(float passedValue) { public void setGainHF(float passedValue) {
addFilter(EFX10.AL_LOWPASS_GAINHF, passedValue); addFilter(EFX10.AL_LOWPASS_GAINHF, passedValue);
} }
} }

View File

@@ -31,7 +31,7 @@ public class Defines {
public final static int EV_PLAYER_TELEPORT = 6; public final static int EV_PLAYER_TELEPORT = 6;
public final static int EV_OTHER_TELEPORT = 7; public final static int EV_OTHER_TELEPORT = 7;
// angle indexes // angle indexes
public final static int PITCH = 0; // up / down public final static int PITCH = 0; // up / down
public final static int YAW = 1; // left / right public final static int YAW = 1; // left / right
public final static int ROLL = 2; // fall over public final static int ROLL = 2; // fall over
@@ -43,7 +43,7 @@ public class Defines {
public final static int MAX_QPATH = 64; // max length of a quake game pathname public final static int MAX_QPATH = 64; // max length of a quake game pathname
public final static int MAX_OSPATH = 128; // max length of a filesystem pathname public final static int MAX_OSPATH = 128; // max length of a filesystem pathname
// per-level limits // per-level limits
public final static int MAX_CLIENTS = 256; // absolute limit public final static int MAX_CLIENTS = 256; // absolute limit
public final static int MAX_EDICTS = 1024; // must change protocol to increase more public final static int MAX_EDICTS = 1024; // must change protocol to increase more
public final static int MAX_LIGHTSTYLES = 256; public final static int MAX_LIGHTSTYLES = 256;
@@ -53,7 +53,7 @@ public class Defines {
public final static int MAX_ITEMS = 256; public final static int MAX_ITEMS = 256;
private final static int MAX_GENERAL = (MAX_CLIENTS * 2); // general config strings private final static int MAX_GENERAL = (MAX_CLIENTS * 2); // general config strings
// game print flags // game print flags
public final static int PRINT_MEDIUM = 1; // death messages public final static int PRINT_MEDIUM = 1; // death messages
public final static int PRINT_HIGH = 2; // critical messages public final static int PRINT_HIGH = 2; // critical messages
public final static int PRINT_CHAT = 3; // chat messages public final static int PRINT_CHAT = 3; // chat messages
@@ -65,7 +65,7 @@ public class Defines {
public final static int PRINT_ALL = 0; public final static int PRINT_ALL = 0;
public final static int PRINT_DEVELOPER = 1; // only print when "developer 1" public final static int PRINT_DEVELOPER = 1; // only print when "developer 1"
// key / value info strings // key / value info strings
public final static int MAX_INFO_KEY = 64; public final static int MAX_INFO_KEY = 64;
public final static int MAX_INFO_STRING = 512; public final static int MAX_INFO_STRING = 512;
@@ -456,26 +456,26 @@ public class Defines {
public final static int SPLASH_SLIME = 4; public final static int SPLASH_SLIME = 4;
public final static int SPLASH_LAVA = 5; public final static int SPLASH_LAVA = 5;
// sound channels // sound channels
// channel 0 never willingly overrides // channel 0 never willingly overrides
// other channels (1-7) allways override a playing sound on that channel // other channels (1-7) allways override a playing sound on that channel
public final static int CHAN_AUTO = 0; public final static int CHAN_AUTO = 0;
public final static int CHAN_WEAPON = 1; public final static int CHAN_WEAPON = 1;
public final static int CHAN_VOICE = 2; public final static int CHAN_VOICE = 2;
public final static int CHAN_ITEM = 3; public final static int CHAN_ITEM = 3;
public final static int CHAN_BODY = 4; public final static int CHAN_BODY = 4;
// modifier flags // modifier flags
public final static int CHAN_NO_PHS_ADD = 8; public final static int CHAN_NO_PHS_ADD = 8;
// send to all clients, not just ones in PHS (ATTN 0 will also do this) // send to all clients, not just ones in PHS (ATTN 0 will also do this)
public final static int CHAN_RELIABLE = 16; // send by reliable message, not datagram public final static int CHAN_RELIABLE = 16; // send by reliable message, not datagram
// sound attenuation values // sound attenuation values
public final static int ATTN_NONE = 0; // full volume the entire level public final static int ATTN_NONE = 0; // full volume the entire level
public final static int ATTN_NORM = 1; public final static int ATTN_NORM = 1;
public final static int ATTN_IDLE = 2; public final static int ATTN_IDLE = 2;
public final static int ATTN_STATIC = 3; // diminish very rapidly with distance public final static int ATTN_STATIC = 3; // diminish very rapidly with distance
// player_state->stats[] indexes // player_state->stats[] indexes
public final static int STAT_HEALTH_ICON = 0; public final static int STAT_HEALTH_ICON = 0;
public final static int STAT_HEALTH = 1; public final static int STAT_HEALTH = 1;
public final static int STAT_AMMO_ICON = 2; public final static int STAT_AMMO_ICON = 2;
@@ -497,7 +497,7 @@ public class Defines {
public final static int MAX_STATS = 32; public final static int MAX_STATS = 32;
// dmflags->value flags // dmflags->value flags
public final static int DF_NO_HEALTH = 0x00000001; // 1 public final static int DF_NO_HEALTH = 0x00000001; // 1
public final static int DF_NO_ITEMS = 0x00000002; // 2 public final static int DF_NO_ITEMS = 0x00000002; // 2
public final static int DF_WEAPONS_STAY = 0x00000004; // 4 public final static int DF_WEAPONS_STAY = 0x00000004; // 4
@@ -515,17 +515,17 @@ public class Defines {
public final static int DF_QUAD_DROP = 0x00004000; // 16384 public final static int DF_QUAD_DROP = 0x00004000; // 16384
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; protected final static int DF_NO_MINES = 0x00020000;
protected final static int DF_NO_STACK_DOUBLE = 0x00040000; protected final static int DF_NO_STACK_DOUBLE = 0x00040000;
protected final static int DF_NO_NUKES = 0x00080000; protected final static int DF_NO_NUKES = 0x00080000;
protected final static int DF_NO_SPHERES = 0x00100000; protected final static int DF_NO_SPHERES = 0x00100000;
// ROGUE // ROGUE
// //
// config strings are a general means of communication from // config strings are a general means of communication from
// the server to all connected clients. // the server to all connected clients.
// Each config string can be at most MAX_QPATH characters. // Each config string can be at most MAX_QPATH characters.
// //
public final static int CS_NAME = 0; public final static int CS_NAME = 0;
public final static int CS_CDTRACK = 1; public final static int CS_CDTRACK = 1;
@@ -611,7 +611,7 @@ public class Defines {
public final static int TE_EXPLOSION1_NP = 54; public final static int TE_EXPLOSION1_NP = 54;
public final static int TE_FLECHETTE = 55; public final static int TE_FLECHETTE = 55;
// content masks // content masks
public final static int MASK_SOLID = (CONTENTS_SOLID | CONTENTS_WINDOW); public final static int MASK_SOLID = (CONTENTS_SOLID | CONTENTS_WINDOW);
public final static int MASK_PLAYERSOLID = (CONTENTS_SOLID | CONTENTS_PLAYERCLIP | CONTENTS_WINDOW | CONTENTS_MONSTER); public final static int MASK_PLAYERSOLID = (CONTENTS_SOLID | CONTENTS_PLAYERCLIP | CONTENTS_WINDOW | CONTENTS_MONSTER);
public final static int MASK_DEADSOLID = (CONTENTS_SOLID | CONTENTS_PLAYERCLIP | CONTENTS_WINDOW); public final static int MASK_DEADSOLID = (CONTENTS_SOLID | CONTENTS_PLAYERCLIP | CONTENTS_WINDOW);
@@ -663,11 +663,11 @@ public class Defines {
public final static int AMMO_CELLS = 4; public final static int AMMO_CELLS = 4;
public final static int AMMO_SLUGS = 5; public final static int AMMO_SLUGS = 5;
// view pitching times // view pitching times
public final static float DAMAGE_TIME = 0.5f; public final static float DAMAGE_TIME = 0.5f;
public final static float FALL_TIME = 0.3f; public final static float FALL_TIME = 0.3f;
// damage flags // damage flags
public final static int DAMAGE_RADIUS = 0x00000001; // damage was indirect public final static int DAMAGE_RADIUS = 0x00000001; // damage was indirect
public final static int DAMAGE_NO_ARMOR = 0x00000002; // armour does not protect from this damage public final static int DAMAGE_NO_ARMOR = 0x00000002; // armour does not protect from this damage
public final static int DAMAGE_ENERGY = 0x00000004; // damage is from an energy based weapon public final static int DAMAGE_ENERGY = 0x00000004; // damage is from an energy based weapon
@@ -680,7 +680,7 @@ public class Defines {
public final static int DAMAGE_YES = 1; // will take damage if hit public final static int DAMAGE_YES = 1; // will take damage if hit
public final static int DAMAGE_AIM = 2; // auto targeting recognizes this public final static int DAMAGE_AIM = 2; // auto targeting recognizes this
// means of death // means of death
public final static int MOD_UNKNOWN = 0; public final static int MOD_UNKNOWN = 0;
public final static int MOD_BLASTER = 1; public final static int MOD_BLASTER = 1;
public final static int MOD_SHOTGUN = 2; public final static int MOD_SHOTGUN = 2;
@@ -717,15 +717,15 @@ public class Defines {
public final static int MOD_TARGET_BLASTER = 33; public final static int MOD_TARGET_BLASTER = 33;
public final static int MOD_FRIENDLY_FIRE = 0x8000000; public final static int MOD_FRIENDLY_FIRE = 0x8000000;
// edict->spawnflags // edict->spawnflags
// these are set with checkboxes on each entity in the map editor // these are set with checkboxes on each entity in the map editor
public final static int SPAWNFLAG_NOT_EASY = 0x00000100; public final static int SPAWNFLAG_NOT_EASY = 0x00000100;
public final static int SPAWNFLAG_NOT_MEDIUM = 0x00000200; public final static int SPAWNFLAG_NOT_MEDIUM = 0x00000200;
public final static int SPAWNFLAG_NOT_HARD = 0x00000400; public final static int SPAWNFLAG_NOT_HARD = 0x00000400;
public final static int SPAWNFLAG_NOT_DEATHMATCH = 0x00000800; public final static int SPAWNFLAG_NOT_DEATHMATCH = 0x00000800;
public final static int SPAWNFLAG_NOT_COOP = 0x00001000; public final static int SPAWNFLAG_NOT_COOP = 0x00001000;
// edict->flags // edict->flags
public final static int FL_FLY = 0x00000001; public final static int FL_FLY = 0x00000001;
public final static int FL_SWIM = 0x00000002; // implied immunity to drowining public final static int FL_SWIM = 0x00000002; // implied immunity to drowining
public final static int FL_IMMUNE_LASER = 0x00000004; public final static int FL_IMMUNE_LASER = 0x00000004;
@@ -746,21 +746,21 @@ public class Defines {
public final static int BODY_QUEUE_SIZE = 8; public final static int BODY_QUEUE_SIZE = 8;
// deadflag // deadflag
public final static int DEAD_NO = 0; public final static int DEAD_NO = 0;
public final static int DEAD_DEAD = 2; public final static int DEAD_DEAD = 2;
// range // range
public final static int RANGE_MELEE = 0; public final static int RANGE_MELEE = 0;
public final static int RANGE_NEAR = 1; public final static int RANGE_NEAR = 1;
public final static int RANGE_MID = 2; public final static int RANGE_MID = 2;
public final static int RANGE_FAR = 3; public final static int RANGE_FAR = 3;
// gib types // gib types
public final static int GIB_ORGANIC = 0; public final static int GIB_ORGANIC = 0;
public final static int GIB_METALLIC = 1; public final static int GIB_METALLIC = 1;
// monster ai flags // monster ai flags
public final static int AI_STAND_GROUND = 0x00000001; public final static int AI_STAND_GROUND = 0x00000001;
public final static int AI_TEMP_STAND_GROUND = 0x00000002; public final static int AI_TEMP_STAND_GROUND = 0x00000002;
public final static int AI_SOUND_TARGET = 0x00000004; public final static int AI_SOUND_TARGET = 0x00000004;
@@ -777,36 +777,36 @@ public class Defines {
public final static int AI_MEDIC = 0x00002000; public final static int AI_MEDIC = 0x00002000;
public final static int AI_RESURRECTING = 0x00004000; public final static int AI_RESURRECTING = 0x00004000;
// monster attack state // monster attack state
public final static int AS_STRAIGHT = 1; public final static int AS_STRAIGHT = 1;
public final static int AS_SLIDING = 2; public final static int AS_SLIDING = 2;
public final static int AS_MELEE = 3; public final static int AS_MELEE = 3;
public final static int AS_MISSILE = 4; public final static int AS_MISSILE = 4;
// armor types // armor types
public final static int ARMOR_JACKET = 1; public final static int ARMOR_JACKET = 1;
public final static int ARMOR_COMBAT = 2; public final static int ARMOR_COMBAT = 2;
public final static int ARMOR_BODY = 3; public final static int ARMOR_BODY = 3;
public final static int ARMOR_SHARD = 4; public final static int ARMOR_SHARD = 4;
// power armor types // power armor types
public final static int POWER_ARMOR_NONE = 0; public final static int POWER_ARMOR_NONE = 0;
public final static int POWER_ARMOR_SCREEN = 1; public final static int POWER_ARMOR_SCREEN = 1;
public final static int POWER_ARMOR_SHIELD = 2; public final static int POWER_ARMOR_SHIELD = 2;
// handedness values // handedness values
public final static int LEFT_HANDED = 1; public final static int LEFT_HANDED = 1;
public final static int CENTER_HANDED = 2; public final static int CENTER_HANDED = 2;
// game.serverflags values // game.serverflags values
public final static int SFL_CROSS_TRIGGER_MASK = 0x000000ff; public final static int SFL_CROSS_TRIGGER_MASK = 0x000000ff;
// noise types for PlayerNoise // noise types for PlayerNoise
public final static int PNOISE_SELF = 0; public final static int PNOISE_SELF = 0;
public final static int PNOISE_WEAPON = 1; public final static int PNOISE_WEAPON = 1;
public final static int PNOISE_IMPACT = 2; public final static int PNOISE_IMPACT = 2;
// gitem_t->flags // gitem_t->flags
public final static int IT_WEAPON = 1; // use makes active weapon public final static int IT_WEAPON = 1; // use makes active weapon
public final static int IT_AMMO = 2; public final static int IT_AMMO = 2;
public final static int IT_ARMOR = 4; public final static int IT_ARMOR = 4;
@@ -814,7 +814,7 @@ public class Defines {
public final static int IT_KEY = 16; public final static int IT_KEY = 16;
public final static int IT_POWERUP = 32; public final static int IT_POWERUP = 32;
// gitem_t->weapmodel for weapons indicates model index // gitem_t->weapmodel for weapons indicates model index
public final static int WEAP_BLASTER = 1; public final static int WEAP_BLASTER = 1;
public final static int WEAP_SHOTGUN = 2; public final static int WEAP_SHOTGUN = 2;
public final static int WEAP_SUPERSHOTGUN = 3; public final static int WEAP_SUPERSHOTGUN = 3;
@@ -827,7 +827,7 @@ public class Defines {
public final static int WEAP_RAILGUN = 10; public final static int WEAP_RAILGUN = 10;
public final static int WEAP_BFG = 11; public final static int WEAP_BFG = 11;
// edict->movetype values // edict->movetype values
public final static int MOVETYPE_NONE = 0; // never moves public final static int MOVETYPE_NONE = 0; // never moves
public final static int MOVETYPE_NOCLIP = 1; // origin and angles change with no interaction public final static int MOVETYPE_NOCLIP = 1; // origin and angles change with no interaction
public final static int MOVETYPE_PUSH = 2; // no clip to world, push on box contact public final static int MOVETYPE_PUSH = 2; // no clip to world, push on box contact
@@ -855,7 +855,7 @@ public class Defines {
public final static int SOLID_BBOX = 2; // touch on edge public final static int SOLID_BBOX = 2; // touch on edge
public final static int SOLID_BSP = 3; // bsp clip, touch on edge public final static int SOLID_BSP = 3; // bsp clip, touch on edge
// edict->svflags // edict->svflags
public final static int SVF_NOCLIENT = 0x00000001; // don't send entity to clients, even if it has effects public final static int SVF_NOCLIENT = 0x00000001; // don't send entity to clients, even if it has effects
public final static int SVF_DEADMONSTER = 0x00000002; // treat as CONTENTS_DEADMONSTER for collision public final static int SVF_DEADMONSTER = 0x00000002; // treat as CONTENTS_DEADMONSTER for collision
public final static int SVF_MONSTER = 0x00000004; // treat as CONTENTS_MONSTER for collision public final static int SVF_MONSTER = 0x00000004; // treat as CONTENTS_MONSTER for collision

View File

@@ -46,344 +46,344 @@ import java.util.Random;
*/ */
public class Globals extends Defines { public class Globals extends Defines {
public static final String __DATE__ = "2003"; public static final String __DATE__ = "2003";
public static final float VERSION = 3.21f; public static final float VERSION = 3.21f;
public static final String BASEDIRNAME = "baseq2"; public static final String BASEDIRNAME = "baseq2";
/* /*
* global variables * global variables
*/ */
public static int curtime = 0; public static int curtime = 0;
public static boolean cmd_wait; public static boolean cmd_wait;
public static int alias_count; public static int alias_count;
public static int c_traces; public static int c_traces;
public static int c_brush_traces; public static int c_brush_traces;
public static int c_pointcontents; public static int c_pointcontents;
public static int server_state; public static int server_state;
public static cvar_t cl_add_blend; public static cvar_t cl_add_blend;
public static cvar_t cl_add_entities; public static cvar_t cl_add_entities;
public static cvar_t cl_add_lights; public static cvar_t cl_add_lights;
public static cvar_t cl_add_particles; public static cvar_t cl_add_particles;
public static cvar_t cl_anglespeedkey; public static cvar_t cl_anglespeedkey;
public static cvar_t cl_autoskins; public static cvar_t cl_autoskins;
public static cvar_t cl_footsteps; public static cvar_t cl_footsteps;
public static cvar_t cl_forwardspeed; public static cvar_t cl_forwardspeed;
public static cvar_t cl_gun; public static cvar_t cl_gun;
public static cvar_t cl_maxfps; public static cvar_t cl_maxfps;
public static cvar_t cl_noskins; public static cvar_t cl_noskins;
public static cvar_t cl_pitchspeed; public static cvar_t cl_pitchspeed;
public static cvar_t cl_predict; public static cvar_t cl_predict;
public static cvar_t cl_run; public static cvar_t cl_run;
public static cvar_t cl_sidespeed; public static cvar_t cl_sidespeed;
public static cvar_t cl_stereo; public static cvar_t cl_stereo;
public static cvar_t cl_stereo_separation; public static cvar_t cl_stereo_separation;
public static cvar_t cl_timedemo = new cvar_t(); public static cvar_t cl_timedemo = new cvar_t();
public static cvar_t cl_timeout; public static cvar_t cl_timeout;
public static cvar_t cl_upspeed; public static cvar_t cl_upspeed;
public static cvar_t cl_yawspeed; public static cvar_t cl_yawspeed;
public static cvar_t dedicated; public static cvar_t dedicated;
public static cvar_t developer; public static cvar_t developer;
public static cvar_t fixedtime; public static cvar_t fixedtime;
public static cvar_t freelook; public static cvar_t freelook;
public static cvar_t host_speeds; public static cvar_t host_speeds;
public static cvar_t log_stats; public static cvar_t log_stats;
public static cvar_t logfile_active; public static cvar_t logfile_active;
public static cvar_t lookspring; public static cvar_t lookspring;
public static cvar_t lookstrafe; public static cvar_t lookstrafe;
public static cvar_t nostdout; public static cvar_t nostdout;
public static cvar_t sensitivity; public static cvar_t sensitivity;
public static cvar_t showtrace; public static cvar_t showtrace;
public static cvar_t timescale; public static cvar_t timescale;
public static cvar_t in_mouse; public static cvar_t in_mouse;
public static cvar_t in_joystick; public static cvar_t in_joystick;
public static sizebuf_t net_message = new sizebuf_t(); public static sizebuf_t net_message = new sizebuf_t();
/* /*
============================================================================= =============================================================================
COMMAND BUFFER COMMAND BUFFER
============================================================================= =============================================================================
*/ */
public static sizebuf_t cmd_text = new sizebuf_t(); public static sizebuf_t cmd_text = new sizebuf_t();
public static byte defer_text_buf[] = new byte[8192]; public static byte defer_text_buf[] = new byte[8192];
public static byte cmd_text_buf[] = new byte[8192]; public static byte cmd_text_buf[] = new byte[8192];
public static cmdalias_t cmd_alias; public static cmdalias_t cmd_alias;
//============================================================================= //=============================================================================
public static byte[] net_message_buffer = new byte[MAX_MSGLEN]; public static byte[] net_message_buffer = new byte[MAX_MSGLEN];
public static int time_before_game; public static int time_before_game;
public static int time_after_game; public static int time_after_game;
public static int time_before_ref; public static int time_before_ref;
public static int time_after_ref; public static int time_after_ref;
public static FileWriter log_stats_file = null; public static FileWriter log_stats_file = null;
public static cvar_t m_pitch; public static cvar_t m_pitch;
public static cvar_t m_yaw; public static cvar_t m_yaw;
public static cvar_t m_forward; public static cvar_t m_forward;
public static cvar_t m_side; public static cvar_t m_side;
public static cvar_t cl_lightlevel; public static cvar_t cl_lightlevel;
// //
// userinfo // userinfo
// //
public static cvar_t info_password; public static cvar_t info_password;
public static cvar_t info_spectator; public static cvar_t info_spectator;
public static cvar_t name; public static cvar_t name;
public static cvar_t skin; public static cvar_t skin;
public static cvar_t rate; public static cvar_t rate;
public static cvar_t fov; public static cvar_t fov;
public static cvar_t msg; public static cvar_t msg;
public static cvar_t hand; public static cvar_t hand;
public static cvar_t gender; public static cvar_t gender;
public static cvar_t gender_auto; public static cvar_t gender_auto;
public static cvar_t cl_vwep; public static cvar_t cl_vwep;
public static client_static_t cls = new client_static_t(); public static client_static_t cls = new client_static_t();
public static client_state_t cl = new client_state_t(); public static client_state_t cl = new client_state_t();
public static centity_t cl_entities[] = new centity_t[MAX_EDICTS]; public static centity_t cl_entities[] = new centity_t[MAX_EDICTS];
static { static {
for (int i = 0; i < cl_entities.length; i++) { for (int i = 0; i < cl_entities.length; i++) {
cl_entities[i] = new centity_t(); cl_entities[i] = new centity_t();
} }
} }
public static entity_state_t cl_parse_entities[] = new entity_state_t[MAX_PARSE_ENTITIES]; public static entity_state_t cl_parse_entities[] = new entity_state_t[MAX_PARSE_ENTITIES];
static { static {
for (int i = 0; i < cl_parse_entities.length; i++) for (int i = 0; i < cl_parse_entities.length; i++)
{ {
cl_parse_entities[i] = new entity_state_t(null); cl_parse_entities[i] = new entity_state_t(null);
} }
} }
public static cvar_t rcon_client_password; public static cvar_t rcon_client_password;
public static cvar_t rcon_address; public static cvar_t rcon_address;
public static cvar_t cl_shownet; public static cvar_t cl_shownet;
public static cvar_t cl_showmiss; public static cvar_t cl_showmiss;
public static cvar_t cl_showclamp; public static cvar_t cl_showclamp;
public static cvar_t cl_paused; public static cvar_t cl_paused;
// client/anorms.h // client/anorms.h
public static final float bytedirs[][] = { /** public static final float bytedirs[][] = { /**
*/ */
{ -0.525731f, 0.000000f, 0.850651f }, { { -0.525731f, 0.000000f, 0.850651f }, {
-0.442863f, 0.238856f, 0.864188f }, { -0.442863f, 0.238856f, 0.864188f }, {
-0.295242f, 0.000000f, 0.955423f }, { -0.295242f, 0.000000f, 0.955423f }, {
-0.309017f, 0.500000f, 0.809017f }, { -0.309017f, 0.500000f, 0.809017f }, {
-0.162460f, 0.262866f, 0.951056f }, { -0.162460f, 0.262866f, 0.951056f }, {
0.000000f, 0.000000f, 1.000000f }, { 0.000000f, 0.000000f, 1.000000f }, {
0.000000f, 0.850651f, 0.525731f }, { 0.000000f, 0.850651f, 0.525731f }, {
-0.147621f, 0.716567f, 0.681718f }, { -0.147621f, 0.716567f, 0.681718f }, {
0.147621f, 0.716567f, 0.681718f }, { 0.147621f, 0.716567f, 0.681718f }, {
0.000000f, 0.525731f, 0.850651f }, { 0.000000f, 0.525731f, 0.850651f }, {
0.309017f, 0.500000f, 0.809017f }, { 0.309017f, 0.500000f, 0.809017f }, {
0.525731f, 0.000000f, 0.850651f }, { 0.525731f, 0.000000f, 0.850651f }, {
0.295242f, 0.000000f, 0.955423f }, { 0.295242f, 0.000000f, 0.955423f }, {
0.442863f, 0.238856f, 0.864188f }, { 0.442863f, 0.238856f, 0.864188f }, {
0.162460f, 0.262866f, 0.951056f }, { 0.162460f, 0.262866f, 0.951056f }, {
-0.681718f, 0.147621f, 0.716567f }, { -0.681718f, 0.147621f, 0.716567f }, {
-0.809017f, 0.309017f, 0.500000f }, { -0.809017f, 0.309017f, 0.500000f }, {
-0.587785f, 0.425325f, 0.688191f }, { -0.587785f, 0.425325f, 0.688191f }, {
-0.850651f, 0.525731f, 0.000000f }, { -0.850651f, 0.525731f, 0.000000f }, {
-0.864188f, 0.442863f, 0.238856f }, { -0.864188f, 0.442863f, 0.238856f }, {
-0.716567f, 0.681718f, 0.147621f }, { -0.716567f, 0.681718f, 0.147621f }, {
-0.688191f, 0.587785f, 0.425325f }, { -0.688191f, 0.587785f, 0.425325f }, {
-0.500000f, 0.809017f, 0.309017f }, { -0.500000f, 0.809017f, 0.309017f }, {
-0.238856f, 0.864188f, 0.442863f }, { -0.238856f, 0.864188f, 0.442863f }, {
-0.425325f, 0.688191f, 0.587785f }, { -0.425325f, 0.688191f, 0.587785f }, {
-0.716567f, 0.681718f, -0.147621f }, { -0.716567f, 0.681718f, -0.147621f }, {
-0.500000f, 0.809017f, -0.309017f }, { -0.500000f, 0.809017f, -0.309017f }, {
-0.525731f, 0.850651f, 0.000000f }, { -0.525731f, 0.850651f, 0.000000f }, {
0.000000f, 0.850651f, -0.525731f }, { 0.000000f, 0.850651f, -0.525731f }, {
-0.238856f, 0.864188f, -0.442863f }, { -0.238856f, 0.864188f, -0.442863f }, {
0.000000f, 0.955423f, -0.295242f }, { 0.000000f, 0.955423f, -0.295242f }, {
-0.262866f, 0.951056f, -0.162460f }, { -0.262866f, 0.951056f, -0.162460f }, {
0.000000f, 1.000000f, 0.000000f }, { 0.000000f, 1.000000f, 0.000000f }, {
0.000000f, 0.955423f, 0.295242f }, { 0.000000f, 0.955423f, 0.295242f }, {
-0.262866f, 0.951056f, 0.162460f }, { -0.262866f, 0.951056f, 0.162460f }, {
0.238856f, 0.864188f, 0.442863f }, { 0.238856f, 0.864188f, 0.442863f }, {
0.262866f, 0.951056f, 0.162460f }, { 0.262866f, 0.951056f, 0.162460f }, {
0.500000f, 0.809017f, 0.309017f }, { 0.500000f, 0.809017f, 0.309017f }, {
0.238856f, 0.864188f, -0.442863f }, { 0.238856f, 0.864188f, -0.442863f }, {
0.262866f, 0.951056f, -0.162460f }, { 0.262866f, 0.951056f, -0.162460f }, {
0.500000f, 0.809017f, -0.309017f }, { 0.500000f, 0.809017f, -0.309017f }, {
0.850651f, 0.525731f, 0.000000f }, { 0.850651f, 0.525731f, 0.000000f }, {
0.716567f, 0.681718f, 0.147621f }, { 0.716567f, 0.681718f, 0.147621f }, {
0.716567f, 0.681718f, -0.147621f }, { 0.716567f, 0.681718f, -0.147621f }, {
0.525731f, 0.850651f, 0.000000f }, { 0.525731f, 0.850651f, 0.000000f }, {
0.425325f, 0.688191f, 0.587785f }, { 0.425325f, 0.688191f, 0.587785f }, {
0.864188f, 0.442863f, 0.238856f }, { 0.864188f, 0.442863f, 0.238856f }, {
0.688191f, 0.587785f, 0.425325f }, { 0.688191f, 0.587785f, 0.425325f }, {
0.809017f, 0.309017f, 0.500000f }, { 0.809017f, 0.309017f, 0.500000f }, {
0.681718f, 0.147621f, 0.716567f }, { 0.681718f, 0.147621f, 0.716567f }, {
0.587785f, 0.425325f, 0.688191f }, { 0.587785f, 0.425325f, 0.688191f }, {
0.955423f, 0.295242f, 0.000000f }, { 0.955423f, 0.295242f, 0.000000f }, {
1.000000f, 0.000000f, 0.000000f }, { 1.000000f, 0.000000f, 0.000000f }, {
0.951056f, 0.162460f, 0.262866f }, { 0.951056f, 0.162460f, 0.262866f }, {
0.850651f, -0.525731f, 0.000000f }, { 0.850651f, -0.525731f, 0.000000f }, {
0.955423f, -0.295242f, 0.000000f }, { 0.955423f, -0.295242f, 0.000000f }, {
0.864188f, -0.442863f, 0.238856f }, { 0.864188f, -0.442863f, 0.238856f }, {
0.951056f, -0.162460f, 0.262866f }, { 0.951056f, -0.162460f, 0.262866f }, {
0.809017f, -0.309017f, 0.500000f }, { 0.809017f, -0.309017f, 0.500000f }, {
0.681718f, -0.147621f, 0.716567f }, { 0.681718f, -0.147621f, 0.716567f }, {
0.850651f, 0.000000f, 0.525731f }, { 0.850651f, 0.000000f, 0.525731f }, {
0.864188f, 0.442863f, -0.238856f }, { 0.864188f, 0.442863f, -0.238856f }, {
0.809017f, 0.309017f, -0.500000f }, { 0.809017f, 0.309017f, -0.500000f }, {
0.951056f, 0.162460f, -0.262866f }, { 0.951056f, 0.162460f, -0.262866f }, {
0.525731f, 0.000000f, -0.850651f }, { 0.525731f, 0.000000f, -0.850651f }, {
0.681718f, 0.147621f, -0.716567f }, { 0.681718f, 0.147621f, -0.716567f }, {
0.681718f, -0.147621f, -0.716567f }, { 0.681718f, -0.147621f, -0.716567f }, {
0.850651f, 0.000000f, -0.525731f }, { 0.850651f, 0.000000f, -0.525731f }, {
0.809017f, -0.309017f, -0.500000f }, { 0.809017f, -0.309017f, -0.500000f }, {
0.864188f, -0.442863f, -0.238856f }, { 0.864188f, -0.442863f, -0.238856f }, {
0.951056f, -0.162460f, -0.262866f }, { 0.951056f, -0.162460f, -0.262866f }, {
0.147621f, 0.716567f, -0.681718f }, { 0.147621f, 0.716567f, -0.681718f }, {
0.309017f, 0.500000f, -0.809017f }, { 0.309017f, 0.500000f, -0.809017f }, {
0.425325f, 0.688191f, -0.587785f }, { 0.425325f, 0.688191f, -0.587785f }, {
0.442863f, 0.238856f, -0.864188f }, { 0.442863f, 0.238856f, -0.864188f }, {
0.587785f, 0.425325f, -0.688191f }, { 0.587785f, 0.425325f, -0.688191f }, {
0.688191f, 0.587785f, -0.425325f }, { 0.688191f, 0.587785f, -0.425325f }, {
-0.147621f, 0.716567f, -0.681718f }, { -0.147621f, 0.716567f, -0.681718f }, {
-0.309017f, 0.500000f, -0.809017f }, { -0.309017f, 0.500000f, -0.809017f }, {
0.000000f, 0.525731f, -0.850651f }, { 0.000000f, 0.525731f, -0.850651f }, {
-0.525731f, 0.000000f, -0.850651f }, { -0.525731f, 0.000000f, -0.850651f }, {
-0.442863f, 0.238856f, -0.864188f }, { -0.442863f, 0.238856f, -0.864188f }, {
-0.295242f, 0.000000f, -0.955423f }, { -0.295242f, 0.000000f, -0.955423f }, {
-0.162460f, 0.262866f, -0.951056f }, { -0.162460f, 0.262866f, -0.951056f }, {
0.000000f, 0.000000f, -1.000000f }, { 0.000000f, 0.000000f, -1.000000f }, {
0.295242f, 0.000000f, -0.955423f }, { 0.295242f, 0.000000f, -0.955423f }, {
0.162460f, 0.262866f, -0.951056f }, { 0.162460f, 0.262866f, -0.951056f }, {
-0.442863f, -0.238856f, -0.864188f }, { -0.442863f, -0.238856f, -0.864188f }, {
-0.309017f, -0.500000f, -0.809017f }, { -0.309017f, -0.500000f, -0.809017f }, {
-0.162460f, -0.262866f, -0.951056f }, { -0.162460f, -0.262866f, -0.951056f }, {
0.000000f, -0.850651f, -0.525731f }, { 0.000000f, -0.850651f, -0.525731f }, {
-0.147621f, -0.716567f, -0.681718f }, { -0.147621f, -0.716567f, -0.681718f }, {
0.147621f, -0.716567f, -0.681718f }, { 0.147621f, -0.716567f, -0.681718f }, {
0.000000f, -0.525731f, -0.850651f }, { 0.000000f, -0.525731f, -0.850651f }, {
0.309017f, -0.500000f, -0.809017f }, { 0.309017f, -0.500000f, -0.809017f }, {
0.442863f, -0.238856f, -0.864188f }, { 0.442863f, -0.238856f, -0.864188f }, {
0.162460f, -0.262866f, -0.951056f }, { 0.162460f, -0.262866f, -0.951056f }, {
0.238856f, -0.864188f, -0.442863f }, { 0.238856f, -0.864188f, -0.442863f }, {
0.500000f, -0.809017f, -0.309017f }, { 0.500000f, -0.809017f, -0.309017f }, {
0.425325f, -0.688191f, -0.587785f }, { 0.425325f, -0.688191f, -0.587785f }, {
0.716567f, -0.681718f, -0.147621f }, { 0.716567f, -0.681718f, -0.147621f }, {
0.688191f, -0.587785f, -0.425325f }, { 0.688191f, -0.587785f, -0.425325f }, {
0.587785f, -0.425325f, -0.688191f }, { 0.587785f, -0.425325f, -0.688191f }, {
0.000000f, -0.955423f, -0.295242f }, { 0.000000f, -0.955423f, -0.295242f }, {
0.000000f, -1.000000f, 0.000000f }, { 0.000000f, -1.000000f, 0.000000f }, {
0.262866f, -0.951056f, -0.162460f }, { 0.262866f, -0.951056f, -0.162460f }, {
0.000000f, -0.850651f, 0.525731f }, { 0.000000f, -0.850651f, 0.525731f }, {
0.000000f, -0.955423f, 0.295242f }, { 0.000000f, -0.955423f, 0.295242f }, {
0.238856f, -0.864188f, 0.442863f }, { 0.238856f, -0.864188f, 0.442863f }, {
0.262866f, -0.951056f, 0.162460f }, { 0.262866f, -0.951056f, 0.162460f }, {
0.500000f, -0.809017f, 0.309017f }, { 0.500000f, -0.809017f, 0.309017f }, {
0.716567f, -0.681718f, 0.147621f }, { 0.716567f, -0.681718f, 0.147621f }, {
0.525731f, -0.850651f, 0.000000f }, { 0.525731f, -0.850651f, 0.000000f }, {
-0.238856f, -0.864188f, -0.442863f }, { -0.238856f, -0.864188f, -0.442863f }, {
-0.500000f, -0.809017f, -0.309017f }, { -0.500000f, -0.809017f, -0.309017f }, {
-0.262866f, -0.951056f, -0.162460f }, { -0.262866f, -0.951056f, -0.162460f }, {
-0.850651f, -0.525731f, 0.000000f }, { -0.850651f, -0.525731f, 0.000000f }, {
-0.716567f, -0.681718f, -0.147621f }, { -0.716567f, -0.681718f, -0.147621f }, {
-0.716567f, -0.681718f, 0.147621f }, { -0.716567f, -0.681718f, 0.147621f }, {
-0.525731f, -0.850651f, 0.000000f }, { -0.525731f, -0.850651f, 0.000000f }, {
-0.500000f, -0.809017f, 0.309017f }, { -0.500000f, -0.809017f, 0.309017f }, {
-0.238856f, -0.864188f, 0.442863f }, { -0.238856f, -0.864188f, 0.442863f }, {
-0.262866f, -0.951056f, 0.162460f }, { -0.262866f, -0.951056f, 0.162460f }, {
-0.864188f, -0.442863f, 0.238856f }, { -0.864188f, -0.442863f, 0.238856f }, {
-0.809017f, -0.309017f, 0.500000f }, { -0.809017f, -0.309017f, 0.500000f }, {
-0.688191f, -0.587785f, 0.425325f }, { -0.688191f, -0.587785f, 0.425325f }, {
-0.681718f, -0.147621f, 0.716567f }, { -0.681718f, -0.147621f, 0.716567f }, {
-0.442863f, -0.238856f, 0.864188f }, { -0.442863f, -0.238856f, 0.864188f }, {
-0.587785f, -0.425325f, 0.688191f }, { -0.587785f, -0.425325f, 0.688191f }, {
-0.309017f, -0.500000f, 0.809017f }, { -0.309017f, -0.500000f, 0.809017f }, {
-0.147621f, -0.716567f, 0.681718f }, { -0.147621f, -0.716567f, 0.681718f }, {
-0.425325f, -0.688191f, 0.587785f }, { -0.425325f, -0.688191f, 0.587785f }, {
-0.162460f, -0.262866f, 0.951056f }, { -0.162460f, -0.262866f, 0.951056f }, {
0.442863f, -0.238856f, 0.864188f }, { 0.442863f, -0.238856f, 0.864188f }, {
0.162460f, -0.262866f, 0.951056f }, { 0.162460f, -0.262866f, 0.951056f }, {
0.309017f, -0.500000f, 0.809017f }, { 0.309017f, -0.500000f, 0.809017f }, {
0.147621f, -0.716567f, 0.681718f }, { 0.147621f, -0.716567f, 0.681718f }, {
0.000000f, -0.525731f, 0.850651f }, { 0.000000f, -0.525731f, 0.850651f }, {
0.425325f, -0.688191f, 0.587785f }, { 0.425325f, -0.688191f, 0.587785f }, {
0.587785f, -0.425325f, 0.688191f }, { 0.587785f, -0.425325f, 0.688191f }, {
0.688191f, -0.587785f, 0.425325f }, { 0.688191f, -0.587785f, 0.425325f }, {
-0.955423f, 0.295242f, 0.000000f }, { -0.955423f, 0.295242f, 0.000000f }, {
-0.951056f, 0.162460f, 0.262866f }, { -0.951056f, 0.162460f, 0.262866f }, {
-1.000000f, 0.000000f, 0.000000f }, { -1.000000f, 0.000000f, 0.000000f }, {
-0.850651f, 0.000000f, 0.525731f }, { -0.850651f, 0.000000f, 0.525731f }, {
-0.955423f, -0.295242f, 0.000000f }, { -0.955423f, -0.295242f, 0.000000f }, {
-0.951056f, -0.162460f, 0.262866f }, { -0.951056f, -0.162460f, 0.262866f }, {
-0.864188f, 0.442863f, -0.238856f }, { -0.864188f, 0.442863f, -0.238856f }, {
-0.951056f, 0.162460f, -0.262866f }, { -0.951056f, 0.162460f, -0.262866f }, {
-0.809017f, 0.309017f, -0.500000f }, { -0.809017f, 0.309017f, -0.500000f }, {
-0.864188f, -0.442863f, -0.238856f }, { -0.864188f, -0.442863f, -0.238856f }, {
-0.951056f, -0.162460f, -0.262866f }, { -0.951056f, -0.162460f, -0.262866f }, {
-0.809017f, -0.309017f, -0.500000f }, { -0.809017f, -0.309017f, -0.500000f }, {
-0.681718f, 0.147621f, -0.716567f }, { -0.681718f, 0.147621f, -0.716567f }, {
-0.681718f, -0.147621f, -0.716567f }, { -0.681718f, -0.147621f, -0.716567f }, {
-0.850651f, 0.000000f, -0.525731f }, { -0.850651f, 0.000000f, -0.525731f }, {
-0.688191f, 0.587785f, -0.425325f }, { -0.688191f, 0.587785f, -0.425325f }, {
-0.587785f, 0.425325f, -0.688191f }, { -0.587785f, 0.425325f, -0.688191f }, {
-0.425325f, 0.688191f, -0.587785f }, { -0.425325f, 0.688191f, -0.587785f }, {
-0.425325f, -0.688191f, -0.587785f }, { -0.425325f, -0.688191f, -0.587785f }, {
-0.587785f, -0.425325f, -0.688191f }, { -0.587785f, -0.425325f, -0.688191f }, {
-0.688191f, -0.587785f, -0.425325f } -0.688191f, -0.587785f, -0.425325f }
}; };
public static boolean userinfo_modified = false; public static boolean userinfo_modified = false;
public static cvar_t cvar_vars; public static cvar_t cvar_vars;
public static final console_t con = new console_t(); public static final console_t con = new console_t();
public static cvar_t con_notifytime; public static cvar_t con_notifytime;
public static viddef_t viddef = new viddef_t(); public static viddef_t viddef = new viddef_t();
// Renderer interface used by VID, SCR, ... // Renderer interface used by VID, SCR, ...
public static refexport_t re = new DummyRenderer(); public static refexport_t re = new DummyRenderer();
public static String[] keybindings = new String[256]; public static String[] keybindings = new String[256];
public static boolean[] keydown = new boolean[256]; public static boolean[] keydown = new boolean[256];
public static boolean chat_team = false; public static boolean chat_team = false;
public static String chat_buffer = ""; public static String chat_buffer = "";
public static byte[][] key_lines = new byte[32][]; public static byte[][] key_lines = new byte[32][];
public static int key_linepos; public static int key_linepos;
static { static {
for (int i = 0; i < key_lines.length; i++) for (int i = 0; i < key_lines.length; i++)
key_lines[i] = new byte[MAXCMDLINE]; key_lines[i] = new byte[MAXCMDLINE];
}; };
public static int edit_line; public static int edit_line;
public static cvar_t crosshair; public static cvar_t crosshair;
public static vrect_t scr_vrect = new vrect_t(); public static vrect_t scr_vrect = new vrect_t();
public static int sys_frame_time; public static int sys_frame_time;
public static int chat_bufferlen = 0; public static int chat_bufferlen = 0;
public static int gun_frame; public static int gun_frame;
public static model_t gun_model; public static model_t gun_model;
public static netadr_t net_from = new netadr_t(); public static netadr_t net_from = new netadr_t();
// logfile // logfile
public static RandomAccessFile logfile = null; public static RandomAccessFile logfile = null;
public static float vec3_origin[] = { 0.0f, 0.0f, 0.0f }; public static float vec3_origin[] = { 0.0f, 0.0f, 0.0f };
public static cvar_t m_filter; public static cvar_t m_filter;
public static int vidref_val = VIDREF_GL; public static int vidref_val = VIDREF_GL;
public static Random rnd = new Random(); public static Random rnd = new Random();
} }

View File

@@ -36,37 +36,37 @@ public final class LWJake2 {
* @param args * @param args
*/ */
public static void main(@NonNull String[] args) { public static void main(@NonNull String[] args) {
boolean dedicated = false; boolean dedicated = false;
// check if we are in dedicated mode to hide the java dialog. // check if we are in dedicated mode to hide the java dialog.
for (int n = 0; n < args.length; n++) for (int n = 0; n < args.length; n++)
{ {
if (args[n].equals("+set")) if (args[n].equals("+set"))
{ {
if (n++ >= args.length) if (n++ >= args.length)
break; break;
if (!args[n].equals("dedicated")) if (!args[n].equals("dedicated"))
continue; continue;
if (n++ >= args.length) if (n++ >= args.length)
break; break;
if (args[n].equals("1") || args[n].equals("\"1\"")) if (args[n].equals("1") || args[n].equals("\"1\""))
{ {
Com.Printf("Starting in dedicated mode.\n"); Com.Printf("Starting in dedicated mode.\n");
dedicated = true; dedicated = true;
} }
} }
} }
// 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", Qcommon.CVAR_NOSET);
if (dedicated) if (dedicated)
Globals.dedicated.value = 1.0f; Globals.dedicated.value = 1.0f;
// in C the first arg is the filename // in C the first arg is the filename
int argc = (args == null) ? 1 : args.length + 1; int argc = (args == null) ? 1 : args.length + 1;

View File

@@ -114,7 +114,7 @@ public final class CL {
return; return;
} }
// finish up // finish up
len = -1; len = -1;
Globals.cls.demofile.writeInt(EndianHandler.swapInt(len)); Globals.cls.demofile.writeInt(EndianHandler.swapInt(len));
Globals.cls.demofile.close(); Globals.cls.demofile.close();
@@ -509,7 +509,7 @@ public final class CL {
CL_parse.RegisterSounds(); CL_parse.RegisterSounds();
}; };
// ENV_CNT is map load, ENV_CNT+1 is first env map // ENV_CNT is map load, ENV_CNT+1 is first env map
public static final int ENV_CNT = (Defines.CS_PLAYERSKINS + Defines.MAX_CLIENTS public static final int ENV_CNT = (Defines.CS_PLAYERSKINS + Defines.MAX_CLIENTS
* CL.PLAYER_MULT); * CL.PLAYER_MULT);
@@ -545,7 +545,7 @@ public final class CL {
private static int extratime; private static int extratime;
// ============================================================================ // ============================================================================
/** /**
* Shutdown * Shutdown
@@ -590,7 +590,7 @@ public final class CL {
} }
if (adr.port == 0) if (adr.port == 0)
adr.port = Defines.PORT_SERVER; adr.port = Defines.PORT_SERVER;
// adr.port = BigShort(PORT_SERVER); // adr.port = BigShort(PORT_SERVER);
port = (int) Cvar.VariableValue("qport"); port = (int) Cvar.VariableValue("qport");
Globals.userinfo_modified = false; Globals.userinfo_modified = false;
@@ -823,12 +823,12 @@ public final class CL {
// //
// remote command packet // remote command packet
// //
if (Globals.net_message.data[0] == -1 if (Globals.net_message.data[0] == -1
&& Globals.net_message.data[1] == -1 && Globals.net_message.data[1] == -1
&& Globals.net_message.data[2] == -1 && Globals.net_message.data[2] == -1
&& Globals.net_message.data[3] == -1) { && Globals.net_message.data[3] == -1) {
// if (*(int *)net_message.data == -1) // if (*(int *)net_message.data == -1)
ConnectionlessPacket(); ConnectionlessPacket();
continue; continue;
} }
@@ -871,7 +871,7 @@ public final class CL {
Globals.cl.timeoutcount = 0; Globals.cl.timeoutcount = 0;
} }
// ============================================================================= // =============================================================================
/** /**
* FixUpGender_f * FixUpGender_f
@@ -912,7 +912,7 @@ public final class CL {
if (SV_MAIN.allow_download.value == 0 && CL.precache_check < ENV_CNT) if (SV_MAIN.allow_download.value == 0 && CL.precache_check < ENV_CNT)
CL.precache_check = ENV_CNT; CL.precache_check = ENV_CNT;
// ZOID // ZOID
if (CL.precache_check == Defines.CS_MODELS) { // confirm map if (CL.precache_check == Defines.CS_MODELS) { // confirm map
CL.precache_check = Defines.CS_MODELS + 2; // 0 isn't used CL.precache_check = Defines.CS_MODELS + 2; // 0 isn't used
if (SV_MAIN.allow_download_maps.value != 0) if (SV_MAIN.allow_download_maps.value != 0)
@@ -1204,7 +1204,7 @@ public final class CL {
CL.precache_check = TEXTURE_CNT + 999; CL.precache_check = TEXTURE_CNT + 999;
} }
// ZOID // ZOID
CL_parse.RegisterSounds(); CL_parse.RegisterSounds();
CL_view.PrepRefresh(); CL_view.PrepRefresh();
@@ -1427,7 +1427,7 @@ public final class CL {
} }
} }
// ============================================================= // =============================================================
/** /**
* SendCommand * SendCommand
@@ -1452,7 +1452,7 @@ public final class CL {
CheckForResend(); CheckForResend();
} }
// private static int lasttimecalled; // private static int lasttimecalled;
/** /**
* Frame * Frame

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -30,108 +30,108 @@ import lwjake2.util.Vargs;
*/ */
public class CL_inv { public class CL_inv {
/* /*
* ================ CL_ParseInventory ================ * ================ CL_ParseInventory ================
*/ */
static void ParseInventory() { static void ParseInventory() {
int i; int i;
for (i = 0; i < Defines.MAX_ITEMS; i++) for (i = 0; i < Defines.MAX_ITEMS; i++)
Globals.cl.inventory[i] = MSG.ReadShort(Globals.net_message); Globals.cl.inventory[i] = MSG.ReadShort(Globals.net_message);
} }
/* /*
* ================ Inv_DrawString ================ * ================ Inv_DrawString ================
*/ */
static void Inv_DrawString(int x, int y, String string) { static void Inv_DrawString(int x, int y, String string) {
for (int i = 0; i < string.length(); i++) { for (int i = 0; i < string.length(); i++) {
Globals.re.DrawChar(x, y, string.charAt(i)); Globals.re.DrawChar(x, y, string.charAt(i));
x += 8; x += 8;
} }
} }
static String getHighBitString(String s) { static String getHighBitString(String s) {
byte[] b = Lib.stringToBytes(s); byte[] b = Lib.stringToBytes(s);
for (int i = 0; i < b.length; i++) { for (int i = 0; i < b.length; i++) {
b[i] = (byte) (b[i] | 128); b[i] = (byte) (b[i] | 128);
} }
return Lib.bytesToString(b); return Lib.bytesToString(b);
} }
/* /*
* ================ CL_DrawInventory ================ * ================ CL_DrawInventory ================
*/ */
static final int DISPLAY_ITEMS = 17; static final int DISPLAY_ITEMS = 17;
static void DrawInventory() { static void DrawInventory() {
int i, j; int i, j;
int num, selected_num, item; int num, selected_num, item;
int[] index = new int[Defines.MAX_ITEMS]; int[] index = new int[Defines.MAX_ITEMS];
String string; String string;
int x, y; int x, y;
String binding; String binding;
String bind; String bind;
int selected; int selected;
int top; int top;
selected = Globals.cl.frame.playerstate.stats[Defines.STAT_SELECTED_ITEM]; selected = Globals.cl.frame.playerstate.stats[Defines.STAT_SELECTED_ITEM];
num = 0; num = 0;
selected_num = 0; selected_num = 0;
for (i = 0; i < Defines.MAX_ITEMS; i++) { for (i = 0; i < Defines.MAX_ITEMS; i++) {
if (i == selected) if (i == selected)
selected_num = num; selected_num = num;
if (Globals.cl.inventory[i] != 0) { if (Globals.cl.inventory[i] != 0) {
index[num] = i; index[num] = i;
num++; num++;
} }
} }
// determine scroll point // determine scroll point
top = selected_num - DISPLAY_ITEMS / 2; top = selected_num - DISPLAY_ITEMS / 2;
if (num - top < DISPLAY_ITEMS) if (num - top < DISPLAY_ITEMS)
top = num - DISPLAY_ITEMS; top = num - DISPLAY_ITEMS;
if (top < 0) if (top < 0)
top = 0; top = 0;
x = (Globals.viddef.width - 256) / 2; x = (Globals.viddef.width - 256) / 2;
y = (Globals.viddef.height - 240) / 2; y = (Globals.viddef.height - 240) / 2;
// repaint everything next frame // repaint everything next frame
SCR.DirtyScreen(); SCR.DirtyScreen();
Globals.re.DrawPic(x, y + 8, "inventory"); Globals.re.DrawPic(x, y + 8, "inventory");
y += 24; y += 24;
x += 24; x += 24;
Inv_DrawString(x, y, "hotkey ### item"); Inv_DrawString(x, y, "hotkey ### item");
Inv_DrawString(x, y + 8, "------ --- ----"); Inv_DrawString(x, y + 8, "------ --- ----");
y += 16; y += 16;
for (i = top; i < num && i < top + DISPLAY_ITEMS; i++) { for (i = top; i < num && i < top + DISPLAY_ITEMS; i++) {
item = index[i]; item = index[i];
// search for a binding // search for a binding
//Com_sprintf (binding, sizeof(binding), "use %s", //Com_sprintf (binding, sizeof(binding), "use %s",
// cl.configstrings[CS_ITEMS+item]); // cl.configstrings[CS_ITEMS+item]);
binding = "use " + Globals.cl.configstrings[Defines.CS_ITEMS + item]; binding = "use " + Globals.cl.configstrings[Defines.CS_ITEMS + item];
bind = ""; bind = "";
for (j = 0; j < 256; j++) for (j = 0; j < 256; j++)
if (Globals.keybindings[j] != null && Globals.keybindings[j].equals(binding)) { if (Globals.keybindings[j] != null && Globals.keybindings[j].equals(binding)) {
bind = Key.KeynumToString(j); bind = Key.KeynumToString(j);
break; break;
} }
string = Com.sprintf("%6s %3i %s", new Vargs(3).add(bind).add(Globals.cl.inventory[item]).add( string = Com.sprintf("%6s %3i %s", new Vargs(3).add(bind).add(Globals.cl.inventory[item]).add(
Globals.cl.configstrings[Defines.CS_ITEMS + item])); Globals.cl.configstrings[Defines.CS_ITEMS + item]));
if (item != selected) if (item != selected)
string = getHighBitString(string); string = getHighBitString(string);
else // draw a blinky cursor by the selected item else // draw a blinky cursor by the selected item
{ {
if (((int) (Globals.cls.realtime * 10) & 1) != 0) if (((int) (Globals.cls.realtime * 10) & 1) != 0)
Globals.re.DrawChar(x - 8, y, 15); Globals.re.DrawChar(x - 8, y, 15);
} }
Inv_DrawString(x, y, string); Inv_DrawString(x, y, string);
y += 8; y += 8;
} }
} }
} }

View File

@@ -66,22 +66,22 @@ public class CL_newfx {
dl.color[2] = b; dl.color[2] = b;
} }
// stack variable // stack variable
private static final float[] move = {0, 0, 0}; private static final float[] move = {0, 0, 0};
private static final float[] vec = {0, 0, 0}; private static final float[] vec = {0, 0, 0};
private static final float[] right = {0, 0, 0}; private static final float[] right = {0, 0, 0};
private static final float[] up = {0, 0, 0}; private static final float[] up = {0, 0, 0};
/* /*
* ====== CL_DebugTrail ====== * ====== CL_DebugTrail ======
*/ */
static void DebugTrail(float[] start, float[] end) { static void DebugTrail(float[] start, float[] end) {
float len; float len;
// int j; // int j;
cparticle_t p; cparticle_t p;
float dec; float dec;
// int i; // int i;
// float d, c, s; // float d, c, s;
// float[] dir; // float[] dir;
Math3D.VectorCopy(start, move); Math3D.VectorCopy(start, move);
Math3D.VectorSubtract(end, start, vec); Math3D.VectorSubtract(end, start, vec);
@@ -89,10 +89,10 @@ public class CL_newfx {
Math3D.MakeNormalVectors(vec, right, up); Math3D.MakeNormalVectors(vec, right, up);
// VectorScale(vec, RT2_SKIP, vec); // VectorScale(vec, RT2_SKIP, vec);
// dec = 1.0; // dec = 1.0;
// dec = 0.75; // dec = 0.75;
dec = 3; dec = 3;
Math3D.VectorScale(vec, dec, vec); Math3D.VectorScale(vec, dec, vec);
Math3D.VectorCopy(start, move); Math3D.VectorCopy(start, move);
@@ -112,7 +112,7 @@ public class CL_newfx {
Math3D.VectorClear(p.vel); Math3D.VectorClear(p.vel);
p.alpha = 1.0f; p.alpha = 1.0f;
p.alphavel = -0.1f; p.alphavel = -0.1f;
// p.alphavel = 0; // p.alphavel = 0;
p.color = 0x74 + (Lib.rand() & 7); p.color = 0x74 + (Lib.rand() & 7);
Math3D.VectorCopy(move, p.org); Math3D.VectorCopy(move, p.org);
/* /*
@@ -124,7 +124,7 @@ public class CL_newfx {
} }
// stack variable // stack variable
// move, vec // move, vec
static void ForceWall(float[] start, float[] end, int color) { static void ForceWall(float[] start, float[] end, int color) {
float len; float len;
@@ -169,7 +169,7 @@ public class CL_newfx {
} }
} }
// stack variable // stack variable
// move, vec // move, vec
/* /*
* =============== CL_BubbleTrail2 (lets you control the # of bubbles by * =============== CL_BubbleTrail2 (lets you control the # of bubbles by
@@ -210,14 +210,14 @@ public class CL_newfx {
p.vel[j] = Lib.crand() * 10; p.vel[j] = Lib.crand() * 10;
} }
p.org[2] -= 4; p.org[2] -= 4;
// p.vel[2] += 6; // p.vel[2] += 6;
p.vel[2] += 20; p.vel[2] += 20;
Math3D.VectorAdd(move, vec, move); Math3D.VectorAdd(move, vec, move);
} }
} }
// stack variable // stack variable
// move, vec, right, up // move, vec, right, up
private static final float[] dir = {0, 0, 0}; private static final float[] dir = {0, 0, 0};
private static final float[] end = {0, 0, 0}; private static final float[] end = {0, 0, 0};
@@ -241,7 +241,7 @@ public class CL_newfx {
len = Math3D.VectorNormalize(vec); len = Math3D.VectorNormalize(vec);
// FIXME - pmm - these might end up using old values? // FIXME - pmm - these might end up using old values?
// MakeNormalVectors (vec, right, up); // MakeNormalVectors (vec, right, up);
Math3D.VectorCopy(Globals.cl.v_right, right); Math3D.VectorCopy(Globals.cl.v_right, right);
Math3D.VectorCopy(Globals.cl.v_up, up); Math3D.VectorCopy(Globals.cl.v_up, up);
if (Globals.vidref_val == Defines.VIDREF_GL) { // GL mode if (Globals.vidref_val == Defines.VIDREF_GL) { // GL mode
@@ -256,7 +256,7 @@ public class CL_newfx {
Math3D.VectorScale(vec, step, vec); Math3D.VectorScale(vec, step, vec);
// Com_Printf ("%f\n", ltime); // Com_Printf ("%f\n", ltime);
rstep = (float) (Math.PI / 10.0); rstep = (float) (Math.PI / 10.0);
float M_PI2 = (float) (Math.PI * 2.0); float M_PI2 = (float) (Math.PI * 2.0);
for (i = (int) start_pt; i < len; i += step) { for (i = (int) start_pt; i < len; i += step) {
@@ -275,10 +275,10 @@ public class CL_newfx {
p.time = Globals.cl.time; p.time = Globals.cl.time;
Math3D.VectorClear(p.accel); Math3D.VectorClear(p.accel);
// rot+= fmod(ltime, 12.0)*M_PI; // rot+= fmod(ltime, 12.0)*M_PI;
// c = cos(rot)/2.0; // c = cos(rot)/2.0;
// s = sin(rot)/2.0; // s = sin(rot)/2.0;
// variance = 0.4 + ((float)rand()/(float)RAND_MAX) *0.2; // variance = 0.4 + ((float)rand()/(float)RAND_MAX) *0.2;
variance = 0.5f; variance = 0.5f;
c = (float) (Math.cos(rot) * variance); c = (float) (Math.cos(rot) * variance);
s = (float) (Math.sin(rot) * variance); s = (float) (Math.sin(rot) * variance);
@@ -293,13 +293,13 @@ public class CL_newfx {
} }
p.alpha = 0.5f; p.alpha = 0.5f;
// p.alphavel = -1.0 / (1+frand()*0.2); // p.alphavel = -1.0 / (1+frand()*0.2);
p.alphavel = -1000.0f; p.alphavel = -1000.0f;
// p.color = 0x74 + (rand()&7); // p.color = 0x74 + (rand()&7);
p.color = 223 - (Lib.rand() & 7); p.color = 223 - (Lib.rand() & 7);
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
p.org[j] = move[j] + dir[j] * 3; p.org[j] = move[j] + dir[j] * 3;
// p.vel[j] = dir[j]*6; // p.vel[j] = dir[j]*6;
p.vel[j] = 0; p.vel[j] = 0;
} }
} }
@@ -307,7 +307,7 @@ public class CL_newfx {
} }
} }
// stack variable // stack variable
private static final float[] r = {0, 0, 0}; private static final float[] r = {0, 0, 0};
private static final float[] u = {0, 0, 0}; private static final float[] u = {0, 0, 0};
/* /*
@@ -322,8 +322,8 @@ public class CL_newfx {
cparticle_t p; cparticle_t p;
float d; float d;
// vectoangles2 (dir, angle_dir); // vectoangles2 (dir, angle_dir);
// AngleVectors (angle_dir, f, r, u); // AngleVectors (angle_dir, f, r, u);
Math3D.MakeNormalVectors(dir, r, u); Math3D.MakeNormalVectors(dir, r, u);
@@ -340,7 +340,7 @@ public class CL_newfx {
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
p.org[j] = org[j] + magnitude * 0.1f * Lib.crand(); p.org[j] = org[j] + magnitude * 0.1f * Lib.crand();
// p.vel[j] = dir[j]*magnitude; // p.vel[j] = dir[j]*magnitude;
} }
Math3D.VectorScale(dir, magnitude, p.vel); Math3D.VectorScale(dir, magnitude, p.vel);
d = Lib.crand() * magnitude / 3; d = Lib.crand() * magnitude / 3;
@@ -356,17 +356,17 @@ public class CL_newfx {
} }
} }
// stack variable // stack variable
// r, u, dir // r, u, dir
static void ParticleSteamEffect2(cl_sustain_t self) static void ParticleSteamEffect2(cl_sustain_t self)
// float[] org, float[] dir, int color, int count, int magnitude) // float[] org, float[] dir, int color, int count, int magnitude)
{ {
int i, j; int i, j;
cparticle_t p; cparticle_t p;
float d; float d;
// vectoangles2 (dir, angle_dir); // vectoangles2 (dir, angle_dir);
// AngleVectors (angle_dir, f, r, u); // AngleVectors (angle_dir, f, r, u);
Math3D.VectorCopy(self.dir, dir); Math3D.VectorCopy(self.dir, dir);
Math3D.MakeNormalVectors(dir, r, u); Math3D.MakeNormalVectors(dir, r, u);
@@ -384,7 +384,7 @@ public class CL_newfx {
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
p.org[j] = self.org[j] + self.magnitude * 0.1f * Lib.crand(); p.org[j] = self.org[j] + self.magnitude * 0.1f * Lib.crand();
// p.vel[j] = dir[j]*magnitude; // p.vel[j] = dir[j]*magnitude;
} }
Math3D.VectorScale(dir, self.magnitude, p.vel); Math3D.VectorScale(dir, self.magnitude, p.vel);
d = Lib.crand() * self.magnitude / 3; d = Lib.crand() * self.magnitude / 3;
@@ -401,7 +401,7 @@ public class CL_newfx {
self.nextthink += self.thinkinterval; self.nextthink += self.thinkinterval;
} }
// stack variable // stack variable
// move, vec, right, up // move, vec, right, up
private static final float[] forward = {0, 0, 0}; private static final float[] forward = {0, 0, 0};
private static final float[] angle_dir = {0, 0, 0}; private static final float[] angle_dir = {0, 0, 0};
@@ -509,7 +509,7 @@ public class CL_newfx {
Math3D.VectorNormalize(dir); Math3D.VectorNormalize(dir);
Math3D.VectorMA(origin, 10, dir, p.org); Math3D.VectorMA(origin, 10, dir, p.org);
// VectorMA(origin, 10*(((rand () & 0x7fff) / ((float)0x7fff))), // VectorMA(origin, 10*(((rand () & 0x7fff) / ((float)0x7fff))),
// dir, p.org); // dir, p.org);
} }
} }
@@ -547,7 +547,7 @@ public class CL_newfx {
Math3D.VectorNormalize(dir); Math3D.VectorNormalize(dir);
Math3D.VectorMA(self.org, (45.0f * ratio), dir, p.org); Math3D.VectorMA(self.org, (45.0f * ratio), dir, p.org);
// VectorMA(origin, 10*(((rand () & 0x7fff) / ((float)0x7fff))), // VectorMA(origin, 10*(((rand () & 0x7fff) / ((float)0x7fff))),
// dir, p.org); // dir, p.org);
} }
} }
@@ -585,7 +585,7 @@ public class CL_newfx {
Math3D.VectorNormalize(dir); Math3D.VectorNormalize(dir);
Math3D.VectorMA(self.org, (200.0f * ratio), dir, p.org); Math3D.VectorMA(self.org, (200.0f * ratio), dir, p.org);
// VectorMA(origin, 10*(((rand () & 0x7fff) / ((float)0x7fff))), // VectorMA(origin, 10*(((rand () & 0x7fff) / ((float)0x7fff))),
// dir, p.org); // dir, p.org);
} }
} }
@@ -728,7 +728,7 @@ public class CL_newfx {
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
p.org[j] = org[j] + magnitude * 0.1f * Lib.crand(); p.org[j] = org[j] + magnitude * 0.1f * Lib.crand();
// p.vel[j] = dir[j]*magnitude; // p.vel[j] = dir[j]*magnitude;
} }
Math3D.VectorScale(dir, magnitude, p.vel); Math3D.VectorScale(dir, magnitude, p.vel);
d = Lib.crand() * magnitude / 3; d = Lib.crand() * magnitude / 3;

View File

@@ -56,7 +56,7 @@ public class CL_parse {
"svc_download", "svc_playerinfo", "svc_packetentities", "svc_download", "svc_playerinfo", "svc_packetentities",
"svc_deltapacketentities", "svc_frame" }; "svc_deltapacketentities", "svc_frame" };
// ============================================================================= // =============================================================================
public static String DownloadFileName(String fn) { public static String DownloadFileName(String fn) {
return fileSystem.getGamedir() + "/" + fn; return fileSystem.getGamedir() + "/" + fn;
@@ -90,7 +90,7 @@ public class CL_parse {
.StripExtension(Globals.cls.downloadname); .StripExtension(Globals.cls.downloadname);
Globals.cls.downloadtempname += ".tmp"; Globals.cls.downloadtempname += ".tmp";
// ZOID // ZOID
// check to see if we already have a tmp for this file, if so, try to // check to see if we already have a tmp for this file, if so, try to
// resume // resume
// open the file if not opened yet // open the file if not opened yet
@@ -245,7 +245,7 @@ public class CL_parse {
if (percent != 100) { if (percent != 100) {
// request next block // request next block
// change display routines by zoid // change display routines by zoid
Globals.cls.downloadpercent = percent; Globals.cls.downloadpercent = percent;
MSG.WriteByte(Globals.cls.netchan.message, Defines.clc_stringcmd); MSG.WriteByte(Globals.cls.netchan.message, Defines.clc_stringcmd);
SZ.Print(Globals.cls.netchan.message, "nextdl"); SZ.Print(Globals.cls.netchan.message, "nextdl");
@@ -254,7 +254,7 @@ public class CL_parse {
//char oldn[MAX_OSPATH]; //char oldn[MAX_OSPATH];
//char newn[MAX_OSPATH]; //char newn[MAX_OSPATH];
// Com.Printf ("100%%\n"); // Com.Printf ("100%%\n");
try { try {
Globals.cls.download.close(); Globals.cls.download.close();
@@ -296,12 +296,12 @@ public class CL_parse {
Com.DPrintf("ParseServerData():Serverdata packet received.\n"); Com.DPrintf("ParseServerData():Serverdata packet received.\n");
// //
// wipe the client_state_t struct // wipe the client_state_t struct
// //
CL.ClearState(); CL.ClearState();
Globals.cls.state = Defines.ca_connected; Globals.cls.state = Defines.ca_connected;
// parse protocol version number // parse protocol version number
i = MSG.ReadLong(Globals.net_message); i = MSG.ReadLong(Globals.net_message);
Globals.cls.serverProtocol = i; Globals.cls.serverProtocol = i;
@@ -340,9 +340,9 @@ public class CL_parse {
SCR.PlayCinematic(str); SCR.PlayCinematic(str);
} else { } else {
// seperate the printfs so the server message can have a color // seperate the printfs so the server message can have a color
// Com.Printf( // Com.Printf(
// "\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n"); // "\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n");
// Com.Printf('\02' + str + "\n"); // Com.Printf('\02' + str + "\n");
Com.Printf("Levelname:" + str + "\n"); Com.Printf("Levelname:" + str + "\n");
// need to prep refresh at next oportunity // need to prep refresh at next oportunity
Globals.cl.refresh_prepped = false; Globals.cl.refresh_prepped = false;
@@ -648,7 +648,7 @@ public class CL_parse {
int i; int i;
// //
// if recording demos, copy the message out // if recording demos, copy the message out
// //
//if (cl_shownet.value == 1) //if (cl_shownet.value == 1)
//Com.Printf(net_message.cursize + " "); //Com.Printf(net_message.cursize + " ");
@@ -656,7 +656,7 @@ public class CL_parse {
//Com.Printf("------------------\n"); //Com.Printf("------------------\n");
// //
// parse the message // parse the message
// //
while (true) { while (true) {
if (Globals.net_message.readcount > Globals.net_message.cursize) { if (Globals.net_message.readcount > Globals.net_message.cursize) {
@@ -688,7 +688,7 @@ public class CL_parse {
break; break;
case Defines.svc_nop: case Defines.svc_nop:
// Com.Printf ("svc_nop\n"); // Com.Printf ("svc_nop\n");
break; break;
case Defines.svc_disconnect: case Defines.svc_disconnect:

View File

@@ -63,7 +63,7 @@ public class CL_tent {
static beam_t[] cl_beams = new beam_t[MAX_BEAMS]; static beam_t[] cl_beams = new beam_t[MAX_BEAMS];
// PMM - added this for player-linked beams. Currently only used by the // PMM - added this for player-linked beams. Currently only used by the
// plasma beam // plasma beam
static beam_t[] cl_playerbeams = new beam_t[MAX_BEAMS]; static beam_t[] cl_playerbeams = new beam_t[MAX_BEAMS];
@@ -71,7 +71,7 @@ public class CL_tent {
static laser_t[] cl_lasers = new laser_t[MAX_LASERS]; static laser_t[] cl_lasers = new laser_t[MAX_LASERS];
// ROGUE // ROGUE
static final int MAX_SUSTAINS = 32; static final int MAX_SUSTAINS = 32;
static cl_sustain_t[] cl_sustains = new cl_sustain_t[MAX_SUSTAINS]; static cl_sustain_t[] cl_sustains = new cl_sustain_t[MAX_SUSTAINS];
@@ -143,7 +143,7 @@ public class CL_tent {
static final int ex_poly2 = 6; static final int ex_poly2 = 6;
// ROGUE // ROGUE
// all are references; // all are references;
static sfx_t cl_sfx_ric1; static sfx_t cl_sfx_ric1;
@@ -191,10 +191,10 @@ public class CL_tent {
static model_t cl_mod_powerscreen; static model_t cl_mod_powerscreen;
// RAFAEL // RAFAEL
static model_t cl_mod_plasmaexplo; static model_t cl_mod_plasmaexplo;
// ROGUE // ROGUE
static sfx_t cl_sfx_lightning; static sfx_t cl_sfx_lightning;
static sfx_t cl_sfx_disrexp; static sfx_t cl_sfx_disrexp;
@@ -207,7 +207,7 @@ public class CL_tent {
static model_t cl_mod_explo4_big; static model_t cl_mod_explo4_big;
// ROGUE // ROGUE
/* /*
* ================= CL_RegisterTEntSounds ================= * ================= CL_RegisterTEntSounds =================
*/ */
@@ -216,7 +216,7 @@ public class CL_tent {
String name; String name;
// PMM - version stuff // PMM - version stuff
// Com_Printf ("%s\n", ROGUE_VERSION_STRING); // Com_Printf ("%s\n", ROGUE_VERSION_STRING);
// PMM // PMM
cl_sfx_ric1 = S.RegisterSound("world/ric1.wav"); cl_sfx_ric1 = S.RegisterSound("world/ric1.wav");
cl_sfx_ric2 = S.RegisterSound("world/ric2.wav"); cl_sfx_ric2 = S.RegisterSound("world/ric2.wav");
@@ -242,14 +242,14 @@ public class CL_tent {
cl_sfx_footsteps[i] = S.RegisterSound(name); cl_sfx_footsteps[i] = S.RegisterSound(name);
} }
// PGM // PGM
cl_sfx_lightning = S.RegisterSound("weapons/tesla.wav"); cl_sfx_lightning = S.RegisterSound("weapons/tesla.wav");
cl_sfx_disrexp = S.RegisterSound("weapons/disrupthit.wav"); cl_sfx_disrexp = S.RegisterSound("weapons/disrupthit.wav");
// version stuff // version stuff
// sprintf (name, "weapons/sound%d.wav", ROGUE_VERSION_ID); // sprintf (name, "weapons/sound%d.wav", ROGUE_VERSION_ID);
// if (name[0] == 'w') // if (name[0] == 'w')
// name[0] = 'W'; // name[0] = 'W';
// PGM // PGM
} }
/* /*
@@ -282,15 +282,15 @@ public class CL_tent {
Globals.re.RegisterModel("models/objects/gibs/bone/tris.md2"); Globals.re.RegisterModel("models/objects/gibs/bone/tris.md2");
Globals.re.RegisterModel("models/objects/gibs/sm_meat/tris.md2"); Globals.re.RegisterModel("models/objects/gibs/sm_meat/tris.md2");
Globals.re.RegisterModel("models/objects/gibs/bone2/tris.md2"); Globals.re.RegisterModel("models/objects/gibs/bone2/tris.md2");
// RAFAEL // RAFAEL
// re.RegisterModel ("models/objects/blaser/tris.md2"); // re.RegisterModel ("models/objects/blaser/tris.md2");
Globals.re.RegisterPic("w_machinegun"); Globals.re.RegisterPic("w_machinegun");
Globals.re.RegisterPic("a_bullets"); Globals.re.RegisterPic("a_bullets");
Globals.re.RegisterPic("i_health"); Globals.re.RegisterPic("i_health");
Globals.re.RegisterPic("a_grenades"); Globals.re.RegisterPic("a_grenades");
// ROGUE // ROGUE
cl_mod_explo4_big = Globals.re cl_mod_explo4_big = Globals.re
.RegisterModel("models/objects/r_explode2/tris.md2"); .RegisterModel("models/objects/r_explode2/tris.md2");
cl_mod_lightning = Globals.re cl_mod_lightning = Globals.re
@@ -298,31 +298,31 @@ public class CL_tent {
cl_mod_heatbeam = Globals.re.RegisterModel("models/proj/beam/tris.md2"); cl_mod_heatbeam = Globals.re.RegisterModel("models/proj/beam/tris.md2");
cl_mod_monster_heatbeam = Globals.re cl_mod_monster_heatbeam = Globals.re
.RegisterModel("models/proj/widowbeam/tris.md2"); .RegisterModel("models/proj/widowbeam/tris.md2");
// ROGUE // ROGUE
} }
/* /*
* ================= CL_ClearTEnts ================= * ================= CL_ClearTEnts =================
*/ */
static void ClearTEnts() { static void ClearTEnts() {
// memset (cl_beams, 0, sizeof(cl_beams)); // memset (cl_beams, 0, sizeof(cl_beams));
for (int i = 0; i < cl_beams.length; i++) for (int i = 0; i < cl_beams.length; i++)
cl_beams[i].clear(); cl_beams[i].clear();
// memset (cl_explosions, 0, sizeof(cl_explosions)); // memset (cl_explosions, 0, sizeof(cl_explosions));
for (int i = 0; i < cl_explosions.length; i++) for (int i = 0; i < cl_explosions.length; i++)
cl_explosions[i].clear(); cl_explosions[i].clear();
// memset (cl_lasers, 0, sizeof(cl_lasers)); // memset (cl_lasers, 0, sizeof(cl_lasers));
for (int i = 0; i < cl_lasers.length; i++) for (int i = 0; i < cl_lasers.length; i++)
cl_lasers[i].clear(); cl_lasers[i].clear();
// //
// ROGUE // ROGUE
// memset (cl_playerbeams, 0, sizeof(cl_playerbeams)); // memset (cl_playerbeams, 0, sizeof(cl_playerbeams));
for (int i = 0; i < cl_playerbeams.length; i++) for (int i = 0; i < cl_playerbeams.length; i++)
cl_playerbeams[i].clear(); cl_playerbeams[i].clear();
// memset (cl_sustains, 0, sizeof(cl_sustains)); // memset (cl_sustains, 0, sizeof(cl_sustains));
for (int i = 0; i < cl_sustains.length; i++) for (int i = 0; i < cl_sustains.length; i++)
cl_sustains[i].clear(); cl_sustains[i].clear();
// ROGUE // ROGUE
} }
/* /*
@@ -340,7 +340,7 @@ public class CL_tent {
return cl_explosions[i]; return cl_explosions[i];
} }
} }
// find the oldest explosion // find the oldest explosion
time = Globals.cl.time; time = Globals.cl.time;
index = 0; index = 0;
@@ -394,7 +394,7 @@ public class CL_tent {
MSG.ReadPos(Globals.net_message, start); MSG.ReadPos(Globals.net_message, start);
MSG.ReadPos(Globals.net_message, end); MSG.ReadPos(Globals.net_message, end);
// override any beam with the same entity // override any beam with the same entity
b = cl_beams; b = cl_beams;
for (i = 0; i < MAX_BEAMS; i++) for (i = 0; i < MAX_BEAMS; i++)
if (b[i].entity == ent) { if (b[i].entity == ent) {
@@ -407,7 +407,7 @@ public class CL_tent {
return ent; return ent;
} }
// find a free beam // find a free beam
b = cl_beams; b = cl_beams;
for (i = 0; i < MAX_BEAMS; i++) { for (i = 0; i < MAX_BEAMS; i++) {
if (b[i].model == null || b[i].endtime < Globals.cl.time) { if (b[i].model == null || b[i].endtime < Globals.cl.time) {
@@ -441,9 +441,9 @@ public class CL_tent {
MSG.ReadPos(Globals.net_message, end); MSG.ReadPos(Globals.net_message, end);
MSG.ReadPos(Globals.net_message, offset); MSG.ReadPos(Globals.net_message, offset);
// Com_Printf ("end- %f %f %f\n", end[0], end[1], end[2]); // Com_Printf ("end- %f %f %f\n", end[0], end[1], end[2]);
// override any beam with the same entity // override any beam with the same entity
b = cl_beams; b = cl_beams;
for (i = 0; i < MAX_BEAMS; i++) for (i = 0; i < MAX_BEAMS; i++)
if (b[i].entity == ent) { if (b[i].entity == ent) {
@@ -456,7 +456,7 @@ public class CL_tent {
return ent; return ent;
} }
// find a free beam // find a free beam
b = cl_beams; b = cl_beams;
for (i = 0; i < MAX_BEAMS; i++) { for (i = 0; i < MAX_BEAMS; i++) {
if (b[i].model == null || b[i].endtime < Globals.cl.time) { if (b[i].model == null || b[i].endtime < Globals.cl.time) {
@@ -473,7 +473,7 @@ public class CL_tent {
return ent; return ent;
} }
// ROGUE // ROGUE
/* /*
* ================= CL_ParsePlayerBeam - adds to the cl_playerbeam array * ================= CL_ParsePlayerBeam - adds to the cl_playerbeam array
* instead of the cl_beams array ================= * instead of the cl_beams array =================
@@ -499,10 +499,10 @@ public class CL_tent {
} else } else
MSG.ReadPos(Globals.net_message, offset); MSG.ReadPos(Globals.net_message, offset);
// Com_Printf ("end- %f %f %f\n", end[0], end[1], end[2]); // Com_Printf ("end- %f %f %f\n", end[0], end[1], end[2]);
// override any beam with the same entity // override any beam with the same entity
// PMM - For player beams, we only want one per player (entity) so.. // PMM - For player beams, we only want one per player (entity) so..
b = cl_playerbeams; b = cl_playerbeams;
for (i = 0; i < MAX_BEAMS; i++) { for (i = 0; i < MAX_BEAMS; i++) {
if (b[i].entity == ent) { if (b[i].entity == ent) {
@@ -516,7 +516,7 @@ public class CL_tent {
} }
} }
// find a free beam // find a free beam
b = cl_playerbeams; b = cl_playerbeams;
for (i = 0; i < MAX_BEAMS; i++) { for (i = 0; i < MAX_BEAMS; i++) {
if (b[i].model == null || b[i].endtime < Globals.cl.time) { if (b[i].model == null || b[i].endtime < Globals.cl.time) {
@@ -535,7 +535,7 @@ public class CL_tent {
return ent; return ent;
} }
// rogue // rogue
// stack variable // stack variable
private static final float[] start = new float[3]; private static final float[] start = new float[3];
@@ -554,11 +554,11 @@ public class CL_tent {
MSG.ReadPos(Globals.net_message, start); MSG.ReadPos(Globals.net_message, start);
MSG.ReadPos(Globals.net_message, end); MSG.ReadPos(Globals.net_message, end);
// override any beam with the same source AND destination entities // override any beam with the same source AND destination entities
b = cl_beams; b = cl_beams;
for (i = 0; i < MAX_BEAMS; i++) for (i = 0; i < MAX_BEAMS; i++)
if (b[i].entity == srcEnt && b[i].dest_entity == destEnt) { if (b[i].entity == srcEnt && b[i].dest_entity == destEnt) {
// Com_Printf("%d: OVERRIDE %d . %d\n", cl.time, srcEnt, // Com_Printf("%d: OVERRIDE %d . %d\n", cl.time, srcEnt,
// destEnt); // destEnt);
b[i].entity = srcEnt; b[i].entity = srcEnt;
b[i].dest_entity = destEnt; b[i].dest_entity = destEnt;
@@ -570,11 +570,11 @@ public class CL_tent {
return srcEnt; return srcEnt;
} }
// find a free beam // find a free beam
b = cl_beams; b = cl_beams;
for (i = 0; i < MAX_BEAMS; i++) { for (i = 0; i < MAX_BEAMS; i++) {
if (b[i].model == null || b[i].endtime < Globals.cl.time) { if (b[i].model == null || b[i].endtime < Globals.cl.time) {
// Com_Printf("%d: NORMAL %d . %d\n", cl.time, srcEnt, destEnt); // Com_Printf("%d: NORMAL %d . %d\n", cl.time, srcEnt, destEnt);
b[i].entity = srcEnt; b[i].entity = srcEnt;
b[i].dest_entity = destEnt; b[i].dest_entity = destEnt;
b[i].model = model; b[i].model = model;
@@ -620,8 +620,8 @@ public class CL_tent {
// stack variable // stack variable
private static final float[] pos = new float[3]; private static final float[] pos = new float[3];
private static final float[] dir = new float[3]; private static final float[] dir = new float[3];
// ============= // =============
// ROGUE // ROGUE
static void ParseSteam() { static void ParseSteam() {
int id, i; int id, i;
int r; int r;
@@ -635,7 +635,7 @@ public class CL_tent {
// effect // effect
if (id != -1) // sustains if (id != -1) // sustains
{ {
// Com_Printf ("Sustain effect id %d\n", id); // Com_Printf ("Sustain effect id %d\n", id);
free_sustain = null; free_sustain = null;
s = cl_sustains; s = cl_sustains;
for (i = 0; i < MAX_SUSTAINS; i++) { for (i = 0; i < MAX_SUSTAINS; i++) {
@@ -662,7 +662,7 @@ public class CL_tent {
s[i].thinkinterval = 100; s[i].thinkinterval = 100;
s[i].nextthink = Globals.cl.time; s[i].nextthink = Globals.cl.time;
} else { } else {
// Com_Printf ("No free sustains!\n"); // Com_Printf ("No free sustains!\n");
// FIXME - read the stuff anyway // FIXME - read the stuff anyway
MSG.ReadByte(Globals.net_message); MSG.ReadByte(Globals.net_message);
MSG.ReadPos(Globals.net_message, pos); MSG.ReadPos(Globals.net_message, pos);
@@ -681,7 +681,7 @@ public class CL_tent {
magnitude = MSG.ReadShort(Globals.net_message); magnitude = MSG.ReadShort(Globals.net_message);
color = r & 0xff; color = r & 0xff;
CL_newfx.ParticleSteamEffect(pos, dir, color, cnt, magnitude); CL_newfx.ParticleSteamEffect(pos, dir, color, cnt, magnitude);
// S_StartSound (pos, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0); // S_StartSound (pos, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
} }
} }
@@ -753,8 +753,8 @@ public class CL_tent {
} }
} }
// ROGUE // ROGUE
// ============= // =============
/* /*
* ================= CL_ParseTEnt ================= * ================= CL_ParseTEnt =================
@@ -1079,8 +1079,8 @@ public class CL_tent {
CL_fx.ParticleEffect3(pos, dir, color, cnt); CL_fx.ParticleEffect3(pos, dir, color, cnt);
break; break;
// ============= // =============
// PGM // PGM
// PMM -following code integrated for flechette (different color) // PMM -following code integrated for flechette (different color)
case Defines.TE_BLASTER2: // green blaster hitting wall case Defines.TE_BLASTER2: // green blaster hitting wall
case Defines.TE_FLECHETTE: // flechette case Defines.TE_FLECHETTE: // flechette
@@ -1194,12 +1194,12 @@ public class CL_tent {
break; break;
case Defines.TE_HEATBEAM_SPARKS: case Defines.TE_HEATBEAM_SPARKS:
// cnt = MSG.ReadByte (net_message); // cnt = MSG.ReadByte (net_message);
cnt = 50; cnt = 50;
MSG.ReadPos(Globals.net_message, pos); MSG.ReadPos(Globals.net_message, pos);
MSG.ReadDir(Globals.net_message, dir); MSG.ReadDir(Globals.net_message, dir);
// r = MSG.ReadByte (net_message); // r = MSG.ReadByte (net_message);
// magnitude = MSG.ReadShort (net_message); // magnitude = MSG.ReadShort (net_message);
r = 8; r = 8;
magnitude = 60; magnitude = 60;
color = r & 0xff; color = r & 0xff;
@@ -1208,13 +1208,13 @@ public class CL_tent {
break; break;
case Defines.TE_HEATBEAM_STEAM: case Defines.TE_HEATBEAM_STEAM:
// cnt = MSG.ReadByte (net_message); // cnt = MSG.ReadByte (net_message);
cnt = 20; cnt = 20;
MSG.ReadPos(Globals.net_message, pos); MSG.ReadPos(Globals.net_message, pos);
MSG.ReadDir(Globals.net_message, dir); MSG.ReadDir(Globals.net_message, dir);
// r = MSG.ReadByte (net_message); // r = MSG.ReadByte (net_message);
// magnitude = MSG.ReadShort (net_message); // magnitude = MSG.ReadShort (net_message);
// color = r & 0xff; // color = r & 0xff;
color = 0xe0; color = 0xe0;
magnitude = 60; magnitude = 60;
CL_newfx.ParticleSteamEffect(pos, dir, color, cnt, magnitude); CL_newfx.ParticleSteamEffect(pos, dir, color, cnt, magnitude);
@@ -1226,7 +1226,7 @@ public class CL_tent {
break; break;
case Defines.TE_BUBBLETRAIL2: case Defines.TE_BUBBLETRAIL2:
// cnt = MSG.ReadByte (net_message); // cnt = MSG.ReadByte (net_message);
cnt = 8; cnt = 8;
MSG.ReadPos(Globals.net_message, pos); MSG.ReadPos(Globals.net_message, pos);
MSG.ReadPos(Globals.net_message, pos2); MSG.ReadPos(Globals.net_message, pos2);
@@ -1251,7 +1251,7 @@ public class CL_tent {
case Defines.TE_ELECTRIC_SPARKS: case Defines.TE_ELECTRIC_SPARKS:
MSG.ReadPos(Globals.net_message, pos); MSG.ReadPos(Globals.net_message, pos);
MSG.ReadDir(Globals.net_message, dir); MSG.ReadDir(Globals.net_message, dir);
// CL_ParticleEffect (pos, dir, 109, 40); // CL_ParticleEffect (pos, dir, 109, 40);
CL_fx.ParticleEffect(pos, dir, 0x75, 40); CL_fx.ParticleEffect(pos, dir, 0x75, 40);
//FIXME : replace or remove this sound //FIXME : replace or remove this sound
S.StartSound(pos, 0, 0, cl_sfx_lashit, 1, Defines.ATTN_NORM, 0); S.StartSound(pos, 0, 0, cl_sfx_lashit, 1, Defines.ATTN_NORM, 0);
@@ -1282,8 +1282,8 @@ public class CL_tent {
MSG.ReadPos(Globals.net_message, pos); MSG.ReadPos(Globals.net_message, pos);
CL_newfx.WidowSplash(pos); CL_newfx.WidowSplash(pos);
break; break;
// PGM // PGM
// ============== // ==============
default: default:
Com.Error(Defines.ERR_DROP, "CL_ParseTEnt: bad type"); Com.Error(Defines.ERR_DROP, "CL_ParseTEnt: bad type");
@@ -1305,7 +1305,7 @@ public class CL_tent {
float len, steps; float len, steps;
float model_length; float model_length;
// update beams // update beams
b = cl_beams; b = cl_beams;
for (i = 0; i < MAX_BEAMS; i++) { for (i = 0; i < MAX_BEAMS; i++) {
if (b[i].model == null || b[i].endtime < Globals.cl.time) if (b[i].model == null || b[i].endtime < Globals.cl.time)
@@ -1367,13 +1367,13 @@ public class CL_tent {
// the model from going // the model from going
// through the tesla mine (instead it goes through the target) // through the tesla mine (instead it goes through the target)
if ((b[i].model == cl_mod_lightning) && (d <= model_length)) { if ((b[i].model == cl_mod_lightning) && (d <= model_length)) {
// Com_Printf ("special case\n"); // Com_Printf ("special case\n");
Math3D.VectorCopy(b[i].end, ent.origin); Math3D.VectorCopy(b[i].end, ent.origin);
// offset to push beam outside of tesla model (negative because // offset to push beam outside of tesla model (negative because
// dist is from end to start // dist is from end to start
// for this beam) // for this beam)
// for (j=0 ; j<3 ; j++) // for (j=0 ; j<3 ; j++)
// ent.origin[j] -= dist[j]*10.0; // ent.origin[j] -= dist[j]*10.0;
ent.model = b[i].model; ent.model = b[i].model;
ent.flags = Defines.RF_FULLBRIGHT; ent.flags = Defines.RF_FULLBRIGHT;
ent.angles[0] = pitch; ent.angles[0] = pitch;
@@ -1396,7 +1396,7 @@ public class CL_tent {
ent.angles[2] = Lib.rand() % 360; ent.angles[2] = Lib.rand() % 360;
} }
// Com_Printf("B: %d . %d\n", b[i].entity, b[i].dest_entity); // Com_Printf("B: %d . %d\n", b[i].entity, b[i].dest_entity);
V.AddEntity(ent); V.AddEntity(ent);
for (j = 0; j < 3; j++) for (j = 0; j < 3; j++)
@@ -1431,7 +1431,7 @@ public class CL_tent {
frame_t oldframe; frame_t oldframe;
player_state_t ps, ops; player_state_t ps, ops;
// PMM // PMM
if (Globals.hand != null) { if (Globals.hand != null) {
if (Globals.hand.value == 2) if (Globals.hand.value == 2)
hand_multiplier = 0; hand_multiplier = 0;
@@ -1442,9 +1442,9 @@ public class CL_tent {
} else { } else {
hand_multiplier = 1; hand_multiplier = 1;
} }
// PMM // PMM
// update beams // update beams
beam_t[] b = cl_playerbeams; beam_t[] b = cl_playerbeams;
for (int i = 0; i < MAX_BEAMS; i++) { for (int i = 0; i < MAX_BEAMS; i++) {
@@ -1505,7 +1505,7 @@ public class CL_tent {
// calculate pitch and yaw // calculate pitch and yaw
Math3D.VectorSubtract(b[i].end, org, dist); Math3D.VectorSubtract(b[i].end, org, dist);
// PMM // PMM
if (cl_mod_heatbeam != null && (b[i].model == cl_mod_heatbeam) if (cl_mod_heatbeam != null && (b[i].model == cl_mod_heatbeam)
&& (b[i].entity == Globals.cl.playernum + 1)) { && (b[i].entity == Globals.cl.playernum + 1)) {
@@ -1519,7 +1519,7 @@ public class CL_tent {
Math3D.VectorMA(org, -1, Globals.cl.v_up, org); Math3D.VectorMA(org, -1, Globals.cl.v_up, org);
} }
} }
// PMM // PMM
if (dist[1] == 0 && dist[0] == 0) { if (dist[1] == 0 && dist[0] == 0) {
yaw = 0; yaw = 0;
@@ -1548,11 +1548,11 @@ public class CL_tent {
if (cl_mod_heatbeam != null && (b[i].model == cl_mod_heatbeam)) { if (cl_mod_heatbeam != null && (b[i].model == cl_mod_heatbeam)) {
if (b[i].entity != Globals.cl.playernum + 1) { if (b[i].entity != Globals.cl.playernum + 1) {
framenum = 2; framenum = 2;
// Com_Printf ("Third person\n"); // Com_Printf ("Third person\n");
ent.angles[0] = -pitch; ent.angles[0] = -pitch;
ent.angles[1] = yaw + 180.0f; ent.angles[1] = yaw + 180.0f;
ent.angles[2] = 0; ent.angles[2] = 0;
// Com_Printf ("%f %f - %f %f %f\n", -pitch, yaw+180.0, // Com_Printf ("%f %f - %f %f %f\n", -pitch, yaw+180.0,
// b[i].offset[0], b[i].offset[1], b[i].offset[2]); // b[i].offset[0], b[i].offset[1], b[i].offset[2]);
Math3D.AngleVectors(ent.angles, f, r, u); Math3D.AngleVectors(ent.angles, f, r, u);
@@ -1599,13 +1599,13 @@ public class CL_tent {
// the model from going // the model from going
// through the tesla mine (instead it goes through the target) // through the tesla mine (instead it goes through the target)
if ((b[i].model == cl_mod_lightning) && (d <= model_length)) { if ((b[i].model == cl_mod_lightning) && (d <= model_length)) {
// Com_Printf ("special case\n"); // Com_Printf ("special case\n");
Math3D.VectorCopy(b[i].end, ent.origin); Math3D.VectorCopy(b[i].end, ent.origin);
// offset to push beam outside of tesla model (negative because // offset to push beam outside of tesla model (negative because
// dist is from end to start // dist is from end to start
// for this beam) // for this beam)
// for (j=0 ; j<3 ; j++) // for (j=0 ; j<3 ; j++)
// ent.origin[j] -= dist[j]*10.0; // ent.origin[j] -= dist[j]*10.0;
ent.model = b[i].model; ent.model = b[i].model;
ent.flags = Defines.RF_FULLBRIGHT; ent.flags = Defines.RF_FULLBRIGHT;
ent.angles[0] = pitch; ent.angles[0] = pitch;
@@ -1618,13 +1618,13 @@ public class CL_tent {
Math3D.VectorCopy(org, ent.origin); Math3D.VectorCopy(org, ent.origin);
ent.model = b[i].model; ent.model = b[i].model;
if (cl_mod_heatbeam != null && (b[i].model == cl_mod_heatbeam)) { if (cl_mod_heatbeam != null && (b[i].model == cl_mod_heatbeam)) {
// ent.flags = RF_FULLBRIGHT|RF_TRANSLUCENT; // ent.flags = RF_FULLBRIGHT|RF_TRANSLUCENT;
// ent.alpha = 0.3; // ent.alpha = 0.3;
ent.flags = Defines.RF_FULLBRIGHT; ent.flags = Defines.RF_FULLBRIGHT;
ent.angles[0] = -pitch; ent.angles[0] = -pitch;
ent.angles[1] = yaw + 180.0f; ent.angles[1] = yaw + 180.0f;
ent.angles[2] = (Globals.cl.time) % 360; ent.angles[2] = (Globals.cl.time) % 360;
// ent.angles[2] = rand()%360; // ent.angles[2] = rand()%360;
ent.frame = framenum; ent.frame = framenum;
} else if (b[i].model == cl_mod_lightning) { } else if (b[i].model == cl_mod_lightning) {
ent.flags = Defines.RF_FULLBRIGHT; ent.flags = Defines.RF_FULLBRIGHT;
@@ -1637,7 +1637,7 @@ public class CL_tent {
ent.angles[2] = Lib.rand() % 360; ent.angles[2] = Lib.rand() % 360;
} }
// Com_Printf("B: %d . %d\n", b[i].entity, b[i].dest_entity); // Com_Printf("B: %d . %d\n", b[i].entity, b[i].dest_entity);
V.AddEntity(ent); V.AddEntity(ent);
for (int j = 0; j < 3; j++) for (int j = 0; j < 3; j++)

View File

@@ -409,7 +409,7 @@ public final class Console extends Globals {
// start += 1 + key_linepos - con.linewidth; // start += 1 + key_linepos - con.linewidth;
// draw it // draw it
// y = con.vislines-16; // y = con.vislines-16;
for (i = 0; i < con.linewidth; i++) for (i = 0; i < con.linewidth; i++)
re.DrawChar((i + 1) << 3, con.vislines - 22, text[i]); re.DrawChar((i + 1) << 3, con.vislines - 22, text[i]);

File diff suppressed because it is too large Load Diff

View File

@@ -92,9 +92,9 @@ public final class M {
Math3D.VectorAdd(ent.s.origin, ent.mins, mins); Math3D.VectorAdd(ent.s.origin, ent.mins, mins);
Math3D.VectorAdd(ent.s.origin, ent.maxs, maxs); Math3D.VectorAdd(ent.s.origin, ent.maxs, maxs);
// if all of the points under the corners are solid world, don't bother // if all of the points under the corners are solid world, don't bother
// with the tougher checks // with the tougher checks
// the corners must be within 16 of the midpoint // the corners must be within 16 of the midpoint
start[2] = mins[2] - 1; start[2] = mins[2] - 1;
for (x = 0; x <= 1; x++) for (x = 0; x <= 1; x++)
for (y = 0; y <= 1; y++) { for (y = 0; y <= 1; y++) {
@@ -103,11 +103,11 @@ public final class M {
if (GameBase.gi.pointcontents.pointcontents(start) != Defines.CONTENTS_SOLID) { if (GameBase.gi.pointcontents.pointcontents(start) != Defines.CONTENTS_SOLID) {
GameBase.c_no++; GameBase.c_no++;
// //
// check it for real... // check it for real...
// //
start[2] = mins[2]; start[2] = mins[2];
// the midpoint must be within 16 of the bottom // the midpoint must be within 16 of the bottom
start[0] = stop[0] = (mins[0] + maxs[0]) * 0.5f; start[0] = stop[0] = (mins[0] + maxs[0]) * 0.5f;
start[1] = stop[1] = (mins[1] + maxs[1]) * 0.5f; start[1] = stop[1] = (mins[1] + maxs[1]) * 0.5f;
stop[2] = start[2] - 2 * GameBase.STEPSIZE; stop[2] = start[2] - 2 * GameBase.STEPSIZE;
@@ -119,7 +119,7 @@ public final class M {
return false; return false;
mid = bottom = trace.endpos[2]; mid = bottom = trace.endpos[2];
// the corners must be within 16 of the midpoint // the corners must be within 16 of the midpoint
for (x = 0; x <= 1; x++) for (x = 0; x <= 1; x++)
for (y = 0; y <= 1; y++) { for (y = 0; y <= 1; y++) {
start[0] = stop[0] = x != 0 ? maxs[0] : mins[0]; start[0] = stop[0] = x != 0 ? maxs[0] : mins[0];
@@ -191,11 +191,11 @@ public final class M {
&& (ent.flags & (Defines.FL_FLY | Defines.FL_SWIM)) == 0) && (ent.flags & (Defines.FL_FLY | Defines.FL_SWIM)) == 0)
return; return;
// if the next step hits the enemy, return immediately // if the next step hits the enemy, return immediately
if (ent.enemy != null && SV.SV_CloseEnough(ent, ent.enemy, dist)) if (ent.enemy != null && SV.SV_CloseEnough(ent, ent.enemy, dist))
return; return;
// bump around... // bump around...
if ((Lib.rand() & 3) == 1 if ((Lib.rand() & 3) == 1
|| !SV.SV_StepDirection(ent, ent.ideal_yaw, dist)) { || !SV.SV_StepDirection(ent, ent.ideal_yaw, dist)) {
if (ent.inuse) if (ent.inuse)
@@ -227,7 +227,7 @@ public final class M {
int cont; int cont;
// //
// get waterlevel // get waterlevel
// //
point[0] = ent.s.origin[0]; point[0] = ent.s.origin[0];
point[1] = ent.s.origin[1]; point[1] = ent.s.origin[1];

View File

@@ -67,7 +67,7 @@ public final class Menu extends Key {
static KeyCallback m_keyfunc; static KeyCallback m_keyfunc;
// ============================================================================= // =============================================================================
/* Support Routines */ /* Support Routines */
public final static int MAX_MENU_DEPTH = 8; public final static int MAX_MENU_DEPTH = 8;
@@ -220,8 +220,8 @@ public final class Menu extends Key {
Com.Error(ERR_FATAL, "PopMenu: depth < 1"); Com.Error(ERR_FATAL, "PopMenu: depth < 1");
if (0 < m_menudepth){ if (0 < m_menudepth){
m_drawfunc = m_layers[m_menudepth-1].draw; m_drawfunc = m_layers[m_menudepth-1].draw;
m_keyfunc = m_layers[m_menudepth-1].key; m_keyfunc = m_layers[m_menudepth-1].key;
} }
if (0 == m_menudepth) if (0 == m_menudepth)
@@ -1119,9 +1119,9 @@ public final class Menu extends Key {
// Cvar.VariableValue("s_loadas8bit")); // Cvar.VariableValue("s_loadas8bit"));
String s = Cvar.VariableString("s_impl"); String s = Cvar.VariableString("s_impl");
for (int i = 0; i < s_drivers.length; i++) { for (int i = 0; i < s_drivers.length; i++) {
if (s.equals(s_drivers[i])) { if (s.equals(s_drivers[i])) {
s_options_quality_list.curvalue = i; s_options_quality_list.curvalue = i;
} }
} }
s_options_sensitivity_slider.curvalue = (sensitivity.value) * 2; s_options_sensitivity_slider.curvalue = (sensitivity.value) * 2;
@@ -1199,13 +1199,13 @@ public final class Menu extends Key {
String current = s_drivers[s_options_quality_list.curvalue]; String current = s_drivers[s_options_quality_list.curvalue];
driverNotChanged = S.getDriverName().equals(current); driverNotChanged = S.getDriverName().equals(current);
// if (s_options_quality_list.curvalue != 0) { // if (s_options_quality_list.curvalue != 0) {
// // Cvar.SetValue("s_khz", 22); // // Cvar.SetValue("s_khz", 22);
// // Cvar.SetValue("s_loadas8bit", 0); // // Cvar.SetValue("s_loadas8bit", 0);
// driverNotChanged = S.getDriverName().equals("dummy"); // driverNotChanged = S.getDriverName().equals("dummy");
// Cvar.Set("s_impl", "dummy"); // Cvar.Set("s_impl", "dummy");
// } else { // } else {
// // Cvar.SetValue("s_khz", 11); // // Cvar.SetValue("s_khz", 11);
// // Cvar.SetValue("s_loadas8bit", 1); // // Cvar.SetValue("s_loadas8bit", 1);
// driverNotChanged = S.getDriverName().equals("joal"); // driverNotChanged = S.getDriverName().equals("joal");
// Cvar.Set("s_impl", "joal"); // Cvar.Set("s_impl", "joal");
// } // }
@@ -1215,7 +1215,7 @@ public final class Menu extends Key {
if (driverNotChanged) { if (driverNotChanged) {
re.EndFrame(); re.EndFrame();
} else { } else {
Cvar.Set("s_impl", current); Cvar.Set("s_impl", current);
DrawTextBox(8, 120 - 48, 36, 3); DrawTextBox(8, 120 - 48, 36, 3);
Print(16 + 16, 120 - 48 + 8, "Restarting the sound system. This"); Print(16 + 16, 120 - 48 + 8, "Restarting the sound system. This");
@@ -1240,15 +1240,15 @@ public final class Menu extends Key {
static void Options_MenuInit() { static void Options_MenuInit() {
s_drivers = S.getDriverNames(); s_drivers = S.getDriverNames();
s_labels = new String[s_drivers.length]; s_labels = new String[s_drivers.length];
for (int i = 0; i < s_drivers.length; i++) { for (int i = 0; i < s_drivers.length; i++) {
if ("dummy".equals(s_drivers[i])) { if ("dummy".equals(s_drivers[i])) {
s_labels[i] = "off"; s_labels[i] = "off";
} else { } else {
s_labels[i] = s_drivers[i]; s_labels[i] = s_drivers[i];
} }
} }
win_noalttab = Cvar.Get("win_noalttab", "0", CVAR_ARCHIVE); win_noalttab = Cvar.Get("win_noalttab", "0", CVAR_ARCHIVE);
@@ -1366,7 +1366,7 @@ public final class Menu extends Key {
Menu_AddItem(s_options_menu, s_options_cdvolume_box); Menu_AddItem(s_options_menu, s_options_cdvolume_box);
Menu_AddItem(s_options_menu, s_options_quality_list); Menu_AddItem(s_options_menu, s_options_quality_list);
// Menu_AddItem(s_options_menu, s_options_compatibility_list); // Menu_AddItem(s_options_menu, s_options_compatibility_list);
Menu_AddItem(s_options_menu, s_options_sensitivity_slider); Menu_AddItem(s_options_menu, s_options_sensitivity_slider);
Menu_AddItem(s_options_menu, s_options_alwaysrun_box); Menu_AddItem(s_options_menu, s_options_alwaysrun_box);
Menu_AddItem(s_options_menu, s_options_invertmouse_box); Menu_AddItem(s_options_menu, s_options_invertmouse_box);
@@ -1374,7 +1374,7 @@ public final class Menu extends Key {
Menu_AddItem(s_options_menu, s_options_lookstrafe_box); Menu_AddItem(s_options_menu, s_options_lookstrafe_box);
Menu_AddItem(s_options_menu, s_options_freelook_box); Menu_AddItem(s_options_menu, s_options_freelook_box);
Menu_AddItem(s_options_menu, s_options_crosshair_box); Menu_AddItem(s_options_menu, s_options_crosshair_box);
// Menu_AddItem(s_options_menu, s_options_joystick_box); // Menu_AddItem(s_options_menu, s_options_joystick_box);
Menu_AddItem(s_options_menu, s_options_customize_options_action); Menu_AddItem(s_options_menu, s_options_customize_options_action);
Menu_AddItem(s_options_menu, s_options_defaults_action); Menu_AddItem(s_options_menu, s_options_defaults_action);
Menu_AddItem(s_options_menu, s_options_console_action); Menu_AddItem(s_options_menu, s_options_console_action);
@@ -1836,7 +1836,7 @@ public final class Menu extends Key {
f = new QuakeFile(name, "r"); f = new QuakeFile(name, "r");
String str = f.readString(); String str = f.readString();
if (str != null) if (str != null)
m_savestrings[i] = str; m_savestrings[i] = str;
f.close(); f.close();
m_savevalid[i] = true; m_savevalid[i] = true;
} catch (Exception e) { } catch (Exception e) {
@@ -1882,7 +1882,7 @@ public final class Menu extends Key {
static void LoadGame_MenuDraw() { static void LoadGame_MenuDraw() {
Banner("m_banner_load_game"); Banner("m_banner_load_game");
// Menu_AdjustCursor( &s_loadgame_menu, 1 ); // Menu_AdjustCursor( &s_loadgame_menu, 1 );
Menu_Draw(s_loadgame_menu); Menu_Draw(s_loadgame_menu);
} }
@@ -1998,8 +1998,8 @@ public final class Menu extends Key {
static menuaction_s s_joinserver_server_actions[] = new menuaction_s[MAX_LOCAL_SERVERS]; static menuaction_s s_joinserver_server_actions[] = new menuaction_s[MAX_LOCAL_SERVERS];
// user readable information // user readable information
// network address // network address
static { static {
for (int n = 0; n < MAX_LOCAL_SERVERS; n++) { for (int n = 0; n < MAX_LOCAL_SERVERS; n++) {
local_server_netadr[n] = new netadr_t(); local_server_netadr[n] = new netadr_t();
@@ -2189,8 +2189,8 @@ public final class Menu extends Key {
s_maxclients_field.buffer = new StringBuffer("4"); s_maxclients_field.buffer = new StringBuffer("4");
s_startserver_dmoptions_action.statusbar = "N/A for cooperative"; s_startserver_dmoptions_action.statusbar = "N/A for cooperative";
} }
// ===== // =====
// PGM // PGM
// ROGUE GAMES // ROGUE GAMES
else if (fileSystem.developer_searchpath(2) == 2) { else if (fileSystem.developer_searchpath(2) == 2) {
if (s_rules_box.curvalue == 2) // tag if (s_rules_box.curvalue == 2) // tag
@@ -2204,8 +2204,8 @@ public final class Menu extends Key {
* s_startserver_dmoptions_action.statusbar = null; } * s_startserver_dmoptions_action.statusbar = null; }
*/ */
} }
// PGM // PGM
// ===== // =====
} }
static void StartServerActionFunc() { static void StartServerActionFunc() {
@@ -2234,10 +2234,10 @@ public final class Menu extends Key {
Cvar.SetValue("timelimit", ClampCvar(timelimit, timelimit)); Cvar.SetValue("timelimit", ClampCvar(timelimit, timelimit));
Cvar.SetValue("fraglimit", ClampCvar(fraglimit, fraglimit)); Cvar.SetValue("fraglimit", ClampCvar(fraglimit, fraglimit));
Cvar.Set("hostname", s_hostname_field.buffer.toString()); Cvar.Set("hostname", s_hostname_field.buffer.toString());
// Cvar.SetValue ("deathmatch", !s_rules_box.curvalue ); // Cvar.SetValue ("deathmatch", !s_rules_box.curvalue );
// Cvar.SetValue ("coop", s_rules_box.curvalue ); // Cvar.SetValue ("coop", s_rules_box.curvalue );
// PGM // PGM
if ((s_rules_box.curvalue < 2) || (fileSystem.developer_searchpath(2) != 2)) { if ((s_rules_box.curvalue < 2) || (fileSystem.developer_searchpath(2) != 2)) {
Cvar.SetValue("deathmatch", 1 - s_rules_box.curvalue); Cvar.SetValue("deathmatch", 1 - s_rules_box.curvalue);
Cvar.SetValue("coop", s_rules_box.curvalue); Cvar.SetValue("coop", s_rules_box.curvalue);
@@ -2249,7 +2249,7 @@ public final class Menu extends Key {
// FIXME - this might need to depend on which game we're running // FIXME - this might need to depend on which game we're running
Cvar.SetValue("gamerules", s_rules_box.curvalue); Cvar.SetValue("gamerules", s_rules_box.curvalue);
} }
// PGM // PGM
spot = null; spot = null;
if (s_rules_box.curvalue == 1) // PGM if (s_rules_box.curvalue == 1) // PGM
@@ -2289,9 +2289,9 @@ public final class Menu extends Key {
static void StartServer_MenuInit() { static void StartServer_MenuInit() {
// ======= // =======
// PGM // PGM
// ======= // =======
byte[] buffer = null; byte[] buffer = null;
String mapsname; String mapsname;
@@ -2306,14 +2306,14 @@ public final class Menu extends Key {
// Check user dir first (default ~/.lwjake2) // Check user dir first (default ~/.lwjake2)
if ((fp = Lib.fopen(mapsname, "r")) == null) { if ((fp = Lib.fopen(mapsname, "r")) == null) {
// Check base dir first (baseq2 folder) // Check base dir first (baseq2 folder)
mapsname = fileSystem.getBaseGamedir() + "/maps.lst"; mapsname = fileSystem.getBaseGamedir() + "/maps.lst";
if ((fp = Lib.fopen(mapsname, "r")) == null) { if ((fp = Lib.fopen(mapsname, "r")) == null) {
// Open the pak's maplist // Open the pak's maplist
buffer = fileSystem.loadFile("maps.lst"); buffer = fileSystem.loadFile("maps.lst");
if (buffer == null) if (buffer == null)
Com.Error(ERR_DROP, "couldn't find maps.lst\n"); Com.Error(ERR_DROP, "couldn't find maps.lst\n");
} else { } else {
try { try {
int len = (int) fp.length(); int len = (int) fp.length();
buffer = new byte[len]; buffer = new byte[len];
@@ -2375,12 +2375,12 @@ public final class Menu extends Key {
s_rules_box.y = 20; s_rules_box.y = 20;
s_rules_box.name = "rules"; s_rules_box.name = "rules";
// PGM - rogue games only available with rogue DLL. // PGM - rogue games only available with rogue DLL.
if (fileSystem.developer_searchpath(2) == 2) if (fileSystem.developer_searchpath(2) == 2)
s_rules_box.itemnames = dm_coop_names_rogue; s_rules_box.itemnames = dm_coop_names_rogue;
else else
s_rules_box.itemnames = dm_coop_names; s_rules_box.itemnames = dm_coop_names;
// PGM // PGM
if (Cvar.VariableValue("coop") != 0) if (Cvar.VariableValue("coop") != 0)
s_rules_box.curvalue = 1; s_rules_box.curvalue = 1;
@@ -2542,7 +2542,7 @@ public final class Menu extends Key {
static menulist_s s_quad_drop_box = new menulist_s(); static menulist_s s_quad_drop_box = new menulist_s();
// ROGUE // ROGUE
static menulist_s s_no_mines_box = new menulist_s(); static menulist_s s_no_mines_box = new menulist_s();
static menulist_s s_no_nukes_box = new menulist_s(); static menulist_s s_no_nukes_box = new menulist_s();
@@ -2551,7 +2551,7 @@ public final class Menu extends Key {
static menulist_s s_no_spheres_box = new menulist_s(); static menulist_s s_no_spheres_box = new menulist_s();
// ROGUE // ROGUE
static void setvalue(int flags) { static void setvalue(int flags) {
Cvar.SetValue("dmflags", flags); Cvar.SetValue("dmflags", flags);
@@ -2633,8 +2633,8 @@ public final class Menu extends Key {
bit = DF_QUAD_DROP; bit = DF_QUAD_DROP;
} }
// ======= // =======
// ROGUE // ROGUE
else if (fileSystem.developer_searchpath(2) == 2) { else if (fileSystem.developer_searchpath(2) == 2) {
if (f == s_no_mines_box) { if (f == s_no_mines_box) {
bit = DF_NO_MINES; bit = DF_NO_MINES;
@@ -2646,8 +2646,8 @@ public final class Menu extends Key {
bit = DF_NO_SPHERES; bit = DF_NO_SPHERES;
} }
} }
// ROGUE // ROGUE
// ======= // =======
if (f != null) { if (f != null) {
if (f.curvalue == 0) if (f.curvalue == 0)
@@ -2798,8 +2798,8 @@ public final class Menu extends Key {
s_friendlyfire_box.itemnames = yes_no_names; s_friendlyfire_box.itemnames = yes_no_names;
s_friendlyfire_box.curvalue = (dmflags & DF_NO_FRIENDLY_FIRE) == 0 ? 1 : 0; s_friendlyfire_box.curvalue = (dmflags & DF_NO_FRIENDLY_FIRE) == 0 ? 1 : 0;
// ============ // ============
// ROGUE // ROGUE
if (fileSystem.developer_searchpath(2) == 2) { if (fileSystem.developer_searchpath(2) == 2) {
s_no_mines_box.type = MTYPE_SPINCONTROL; s_no_mines_box.type = MTYPE_SPINCONTROL;
s_no_mines_box.x = 0; s_no_mines_box.x = 0;
@@ -2834,8 +2834,8 @@ public final class Menu extends Key {
s_no_spheres_box.curvalue = (dmflags & DF_NO_SPHERES) != 0 ? 1 : 0; s_no_spheres_box.curvalue = (dmflags & DF_NO_SPHERES) != 0 ? 1 : 0;
} }
// ROGUE // ROGUE
// ============ // ============
Menu_AddItem(s_dmoptions_menu, s_falls_box); Menu_AddItem(s_dmoptions_menu, s_falls_box);
Menu_AddItem(s_dmoptions_menu, s_weapons_stay_box); Menu_AddItem(s_dmoptions_menu, s_weapons_stay_box);
@@ -2853,16 +2853,16 @@ public final class Menu extends Key {
Menu_AddItem(s_dmoptions_menu, s_quad_drop_box); Menu_AddItem(s_dmoptions_menu, s_quad_drop_box);
Menu_AddItem(s_dmoptions_menu, s_friendlyfire_box); Menu_AddItem(s_dmoptions_menu, s_friendlyfire_box);
// ======= // =======
// ROGUE // ROGUE
if (fileSystem.developer_searchpath(2) == 2) { if (fileSystem.developer_searchpath(2) == 2) {
Menu_AddItem(s_dmoptions_menu, s_no_mines_box); Menu_AddItem(s_dmoptions_menu, s_no_mines_box);
Menu_AddItem(s_dmoptions_menu, s_no_nukes_box); Menu_AddItem(s_dmoptions_menu, s_no_nukes_box);
Menu_AddItem(s_dmoptions_menu, s_stack_double_box); Menu_AddItem(s_dmoptions_menu, s_stack_double_box);
Menu_AddItem(s_dmoptions_menu, s_no_spheres_box); Menu_AddItem(s_dmoptions_menu, s_no_spheres_box);
} }
// ROGUE // ROGUE
// ======= // =======
Menu_Center(s_dmoptions_menu); Menu_Center(s_dmoptions_menu);
@@ -3647,7 +3647,7 @@ public final class Menu extends Key {
PushMenu(Menu::Quit_Draw, Menu::Quit_Key); PushMenu(Menu::Quit_Draw, Menu::Quit_Key);
} }
// ============================================================================= // =============================================================================
/* Menu Subsystem */ /* Menu Subsystem */
/** /**

View File

@@ -40,7 +40,7 @@ import java.util.Arrays;
@Slf4j @Slf4j
public final class SCR extends Globals { public final class SCR extends Globals {
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
static String[][] sb_nums = { static String[][] sb_nums = {
{ "num_0", "num_1", "num_2", "num_3", "num_4", "num_5", "num_6", { "num_0", "num_1", "num_2", "num_3", "num_4", "num_5", "num_6",
@@ -132,11 +132,11 @@ public final class SCR extends Globals {
* =============================================================================== * ===============================================================================
*/ */
// typedef struct // typedef struct
// { // {
// float value; // float value;
// int color; // int color;
// } graphsamp_t; // } graphsamp_t;
static class graphsamp_t { static class graphsamp_t {
float value; float value;
@@ -861,7 +861,7 @@ public final class SCR extends Globals {
if (cls.state != ca_active || !cl.refresh_prepped) if (cls.state != ca_active || !cl.refresh_prepped)
return; return;
// if (!s[0]) // if (!s[0])
if (s == null || s.length() == 0) if (s == null || s.length() == 0)
return; return;
@@ -1238,12 +1238,12 @@ public final class SCR extends Globals {
DrawFPS(); DrawFPS();
// //
// if (scr_timegraph->value) // if (scr_timegraph->value)
// SCR_DebugGraph (cls.frametime*300, 0); // SCR_DebugGraph (cls.frametime*300, 0);
// //
// if (scr_debuggraph->value || scr_timegraph->value || // if (scr_debuggraph->value || scr_timegraph->value ||
// scr_netgraph->value) // scr_netgraph->value)
// SCR_DrawDebugGraph (); // SCR_DrawDebugGraph ();
// //
DrawPause(); DrawPause();
DrawConsole(); DrawConsole();
@@ -1767,7 +1767,7 @@ public final class SCR extends Globals {
if (!cl.cinematicpalette_active) { if (!cl.cinematicpalette_active) {
re.CinematicSetPalette(cl.cinematicpalette); re.CinematicSetPalette(cl.cinematicpalette);
cl.cinematicpalette_active = true; cl.cinematicpalette_active = true;
} }
if (cin.pic == null) if (cin.pic == null)

View File

@@ -186,7 +186,7 @@ public final class V extends Globals {
r_numentities = 32; r_numentities = 32;
//memset (r_entities, 0, sizeof(r_entities)); //memset (r_entities, 0, sizeof(r_entities));
for (i = 0; i < r_entities.length; i++) for (i = 0; i < r_entities.length; i++)
r_entities[i].clear(); r_entities[i].clear();
for (i = 0; i < r_numentities; i++) { for (i = 0; i < r_numentities; i++) {
ent = r_entities[i]; ent = r_entities[i];
@@ -261,7 +261,7 @@ public final class V extends Globals {
* ================== * ==================
*/ */
static void RenderView(float stereo_separation) { static void RenderView(float stereo_separation) {
// extern int entitycmpfnc( const entity_t *, const entity_t * ); // extern int entitycmpfnc( const entity_t *, const entity_t * );
// //
if (cls.state != ca_active) if (cls.state != ca_active)
return; return;

File diff suppressed because it is too large Load Diff

View File

@@ -21,14 +21,14 @@ package lwjake2.client;
import lwjake2.game.entity_state_t; import lwjake2.game.entity_state_t;
public class centity_t { public class centity_t {
entity_state_t baseline= new entity_state_t(null); // delta from this if not from a previous frame entity_state_t baseline= new entity_state_t(null); // delta from this if not from a previous frame
public entity_state_t current= new entity_state_t(null); public entity_state_t current= new entity_state_t(null);
entity_state_t prev= new entity_state_t(null); // will always be valid, but might just be a copy of current entity_state_t prev= new entity_state_t(null); // will always be valid, but might just be a copy of current
int serverframe; // if not current, this ent isn't in the frame int serverframe; // if not current, this ent isn't in the frame
int trailcount; // for diminishing grenade trails int trailcount; // for diminishing grenade trails
float[] lerp_origin = { 0, 0, 0 }; // for trails (variable hz) float[] lerp_origin = { 0, 0, 0 }; // for trails (variable hz)
int fly_stoptime; int fly_stoptime;
} }

View File

@@ -22,27 +22,27 @@ package lwjake2.client;
* cl_sustain_t * cl_sustain_t
*/ */
public class cl_sustain_t { public class cl_sustain_t {
static abstract class ThinkAdapter { static abstract class ThinkAdapter {
abstract void think(cl_sustain_t self); abstract void think(cl_sustain_t self);
} }
int id; int id;
int type; int type;
int endtime; int endtime;
int nextthink; int nextthink;
int thinkinterval; int thinkinterval;
float[] org = new float[3]; float[] org = new float[3];
float[] dir = new float[3]; float[] dir = new float[3];
int color; int color;
int count; int count;
int magnitude; int magnitude;
ThinkAdapter think; ThinkAdapter think;
void clear() { void clear() {
org[0] = org[1] = org[2] = org[0] = org[1] = org[2] =
dir[0] = dir[1] = dir[2] = dir[0] = dir[1] = dir[2] =
id = type = endtime = nextthink = thinkinterval = color = count = magnitude = 0; id = type = endtime = nextthink = thinkinterval = color = count = magnitude = 0;
think = null; think = null;
} }
} }

View File

@@ -29,105 +29,105 @@ import java.nio.ByteBuffer;
public class client_state_t { public class client_state_t {
public client_state_t() { public client_state_t() {
for (int n = 0; n < Defines.CMD_BACKUP; n++) for (int n = 0; n < Defines.CMD_BACKUP; n++)
cmds[n] = new usercmd_t(); cmds[n] = new usercmd_t();
for (int i = 0; i < frames.length; i++) { for (int i = 0; i < frames.length; i++) {
frames[i] = new frame_t(); frames[i] = new frame_t();
} }
for (int n = 0; n < Defines.MAX_CONFIGSTRINGS; n++) for (int n = 0; n < Defines.MAX_CONFIGSTRINGS; n++)
configstrings[n] = new String(); configstrings[n] = new String();
for (int n=0; n < Defines.MAX_CLIENTS; n++) for (int n=0; n < Defines.MAX_CLIENTS; n++)
clientinfo[n] = new clientinfo_t(); clientinfo[n] = new clientinfo_t();
} }
// //
// the client_state_t structure is wiped completely at every // the client_state_t structure is wiped completely at every
// server map change // server map change
// //
int timeoutcount; int timeoutcount;
int timedemo_frames; int timedemo_frames;
int timedemo_start; int timedemo_start;
public boolean refresh_prepped; // false if on new level or new ref dll public boolean refresh_prepped; // false if on new level or new ref dll
public boolean sound_prepped; // ambient sounds can start public boolean sound_prepped; // ambient sounds can start
boolean force_refdef; // vid has changed, so we can't use a paused refdef boolean force_refdef; // vid has changed, so we can't use a paused refdef
int parse_entities; // index (not anded off) into cl_parse_entities[] int parse_entities; // index (not anded off) into cl_parse_entities[]
usercmd_t cmd = new usercmd_t(); usercmd_t cmd = new usercmd_t();
usercmd_t cmds[] = new usercmd_t[Defines.CMD_BACKUP]; // each mesage will send several old cmds usercmd_t cmds[] = new usercmd_t[Defines.CMD_BACKUP]; // each mesage will send several old cmds
int cmd_time[] = new int[Defines.CMD_BACKUP]; // time sent, for calculating pings int cmd_time[] = new int[Defines.CMD_BACKUP]; // time sent, for calculating pings
short predicted_origins[][] = new short[Defines.CMD_BACKUP][3]; // for debug comparing against server short predicted_origins[][] = new short[Defines.CMD_BACKUP][3]; // for debug comparing against server
float predicted_step; // for stair up smoothing float predicted_step; // for stair up smoothing
int predicted_step_time; int predicted_step_time;
float[] predicted_origin ={0,0,0}; // generated by CL_PredictMovement float[] predicted_origin ={0,0,0}; // generated by CL_PredictMovement
float[] predicted_angles={0,0,0}; float[] predicted_angles={0,0,0};
float[] prediction_error={0,0,0}; float[] prediction_error={0,0,0};
public frame_t frame = new frame_t(); // received from server public frame_t frame = new frame_t(); // received from server
int surpressCount; // number of messages rate supressed int surpressCount; // number of messages rate supressed
frame_t frames[] = new frame_t[Defines.UPDATE_BACKUP]; frame_t frames[] = new frame_t[Defines.UPDATE_BACKUP];
// the client maintains its own idea of view angles, which are // the client maintains its own idea of view angles, which are
// sent to the server each frame. It is cleared to 0 upon entering each level. // sent to the server each frame. It is cleared to 0 upon entering each level.
// the server sends a delta each frame which is added to the locally // the server sends a delta each frame which is added to the locally
// tracked view angles to account for standing on rotating objects, // tracked view angles to account for standing on rotating objects,
// and teleport direction changes // and teleport direction changes
public float[] viewangles = { 0, 0, 0 }; public float[] viewangles = { 0, 0, 0 };
public int time; // this is the time value that the client public int time; // this is the time value that the client
// is rendering at. always <= cls.realtime // is rendering at. always <= cls.realtime
float lerpfrac; // between oldframe and frame float lerpfrac; // between oldframe and frame
refdef_t refdef = new refdef_t(); refdef_t refdef = new refdef_t();
float[] v_forward = { 0, 0, 0 }; float[] v_forward = { 0, 0, 0 };
float[] v_right = { 0, 0, 0 }; float[] v_right = { 0, 0, 0 };
float[] v_up = { 0, 0, 0 }; // set when refdef.angles is set float[] v_up = { 0, 0, 0 }; // set when refdef.angles is set
// //
// transient data from server // transient data from server
// //
String layout = ""; // general 2D overlay String layout = ""; // general 2D overlay
int inventory[] = new int[Defines.MAX_ITEMS]; int inventory[] = new int[Defines.MAX_ITEMS];
// //
// non-gameserver infornamtion // non-gameserver infornamtion
// FIXME: move this cinematic stuff into the cin_t structure // FIXME: move this cinematic stuff into the cin_t structure
ByteBuffer cinematic_file; ByteBuffer cinematic_file;
int cinematictime; // cls.realtime for first cinematic frame int cinematictime; // cls.realtime for first cinematic frame
int cinematicframe; int cinematicframe;
byte cinematicpalette[] = new byte[768]; byte cinematicpalette[] = new byte[768];
boolean cinematicpalette_active; boolean cinematicpalette_active;
// //
// server state information // server state information
// //
boolean attractloop; // running the attract loop, any key will menu boolean attractloop; // running the attract loop, any key will menu
int servercount; // server identification for prespawns int servercount; // server identification for prespawns
String gamedir =""; String gamedir ="";
public int playernum; public int playernum;
public String configstrings[] = new String[Defines.MAX_CONFIGSTRINGS]; public String configstrings[] = new String[Defines.MAX_CONFIGSTRINGS];
// //
// locally derived information from server state // locally derived information from server state
// //
model_t model_draw[] = new model_t[Defines.MAX_MODELS]; model_t model_draw[] = new model_t[Defines.MAX_MODELS];
cmodel_t model_clip[] = new cmodel_t[Defines.MAX_MODELS]; cmodel_t model_clip[] = new cmodel_t[Defines.MAX_MODELS];
public sfx_t sound_precache[] = new sfx_t[Defines.MAX_SOUNDS]; public sfx_t sound_precache[] = new sfx_t[Defines.MAX_SOUNDS];
image_t image_precache[] = new image_t[Defines.MAX_IMAGES]; image_t image_precache[] = new image_t[Defines.MAX_IMAGES];
clientinfo_t clientinfo[] = new clientinfo_t[Defines.MAX_CLIENTS]; clientinfo_t clientinfo[] = new clientinfo_t[Defines.MAX_CLIENTS];
clientinfo_t baseclientinfo = new clientinfo_t(); clientinfo_t baseclientinfo = new clientinfo_t();
} }

View File

@@ -24,44 +24,44 @@ import java.io.RandomAccessFile;
public class client_static_t { public class client_static_t {
// was enum connstate_t // was enum connstate_t
public int state; public int state;
// was enum keydest_t // was enum keydest_t
public int key_dest; public int key_dest;
public int framecount; public int framecount;
public int realtime; // always increasing, no clamping, etc public int realtime; // always increasing, no clamping, etc
public float frametime; // seconds since last frame public float frametime; // seconds since last frame
// screen rendering information // screen rendering information
public float disable_screen; // showing loading plaque between levels public float disable_screen; // showing loading plaque between levels
// or changing rendering dlls // or changing rendering dlls
// if time gets > 30 seconds ahead, break it // if time gets > 30 seconds ahead, break it
public int disable_servercount; // when we receive a frame and cl.servercount public int disable_servercount; // when we receive a frame and cl.servercount
// > cls.disable_servercount, clear disable_screen // > cls.disable_servercount, clear disable_screen
// connection information // connection information
public String servername = ""; // name of server from original connect public String servername = ""; // name of server from original connect
public float connect_time; // for connection retransmits public float connect_time; // for connection retransmits
int quakePort; // a 16 bit value that allows quake servers int quakePort; // a 16 bit value that allows quake servers
// to work around address translating routers // to work around address translating routers
public netchan_t netchan = new netchan_t(); public netchan_t netchan = new netchan_t();
public int serverProtocol; // in case we are doing some kind of version hack public int serverProtocol; // in case we are doing some kind of version hack
public int challenge; // from the server to use for connecting public int challenge; // from the server to use for connecting
public RandomAccessFile download; // file transfer from server public RandomAccessFile download; // file transfer from server
public String downloadtempname=""; public String downloadtempname="";
public String downloadname=""; public String downloadname="";
public int downloadnumber; public int downloadnumber;
// was enum dltype_t // was enum dltype_t
public int downloadtype; public int downloadtype;
public int downloadpercent; public int downloadpercent;
// demo recording info must be here, so it isn't cleared on level change // demo recording info must be here, so it isn't cleared on level change
public boolean demorecording; public boolean demorecording;
public boolean demowaiting; // don't record until a non-delta message is received public boolean demowaiting; // don't record until a non-delta message is received
public RandomAccessFile demofile; public RandomAccessFile demofile;
} }

View File

@@ -23,27 +23,27 @@ import lwjake2.render.image_t;
import lwjake2.render.model_t; import lwjake2.render.model_t;
public class clientinfo_t { public class clientinfo_t {
String name =""; String name ="";
String cinfo =""; String cinfo ="";
image_t skin; // ptr image_t skin; // ptr
image_t icon; // ptr image_t icon; // ptr
String iconname =""; String iconname ="";
model_t model; // ptr model_t model; // ptr
model_t weaponmodel[] = new model_t[Defines.MAX_CLIENTWEAPONMODELS]; // arary of references model_t weaponmodel[] = new model_t[Defines.MAX_CLIENTWEAPONMODELS]; // arary of references
// public void reset() // public void reset()
// { // {
// set(new clientinfo_t()); // set(new clientinfo_t());
// } // }
public void set (clientinfo_t from) public void set (clientinfo_t from)
{ {
name = from.name; name = from.name;
cinfo = from.cinfo; cinfo = from.cinfo;
skin = from.skin; skin = from.skin;
icon = from.icon; icon = from.icon;
iconname = from.iconname; iconname = from.iconname;
model = from.model; model = from.model;
System.arraycopy(from.weaponmodel,0, weaponmodel, 0 , Defines.MAX_CLIENTWEAPONMODELS); System.arraycopy(from.weaponmodel,0, weaponmodel, 0 , Defines.MAX_CLIENTWEAPONMODELS);
} }
} }

View File

@@ -24,21 +24,21 @@ import lwjake2.Defines;
* console_t * console_t
*/ */
public final class console_t { public final class console_t {
boolean initialized; boolean initialized;
byte[] text = new byte[Defines.CON_TEXTSIZE]; byte[] text = new byte[Defines.CON_TEXTSIZE];
int current; // line where next message will be printed int current; // line where next message will be printed
int x; // offset in current line for next print int x; // offset in current line for next print
int display; // bottom of console displays this line int display; // bottom of console displays this line
int ormask; // high bit mask for colored characters int ormask; // high bit mask for colored characters
int linewidth; // characters across screen int linewidth; // characters across screen
int totallines; // total lines in console scrollback int totallines; // total lines in console scrollback
float cursorspeed; float cursorspeed;
int vislines; int vislines;
float[] times = new float[Defines.NUM_CON_TIMES]; // cls.realtime time the line was generated float[] times = new float[Defines.NUM_CON_TIMES]; // cls.realtime time the line was generated
// for transparent notify lines // for transparent notify lines
} }

View File

@@ -25,15 +25,15 @@ package lwjake2.client;
*/ */
public class cparticle_t { public class cparticle_t {
public cparticle_t next; public cparticle_t next;
public float time; public float time;
public float[] org = {0, 0, 0}; // vec3_t public float[] org = {0, 0, 0}; // vec3_t
public float[] vel = {0, 0, 0}; // vec3_t public float[] vel = {0, 0, 0}; // vec3_t
public float[] accel = {0, 0, 0}; // vec3_t public float[] accel = {0, 0, 0}; // vec3_t
public float color; public float color;
//public float colorvel; //public float colorvel;
public float alpha; public float alpha;
public float alphavel; public float alphavel;
} }

View File

@@ -20,7 +20,7 @@ package lwjake2.client;
public class dlight_t public class dlight_t
{ {
public float origin[] = { 0, 0, 0 }; public float origin[] = { 0, 0, 0 };
public float color[] = { 0, 0, 0 }; public float color[] = { 0, 0, 0 };
public float intensity; public float intensity;
} }

View File

@@ -23,64 +23,64 @@ import lwjake2.render.model_t;
import lwjake2.util.Math3D; import lwjake2.util.Math3D;
public class entity_t implements Cloneable{ public class entity_t implements Cloneable{
//ptr //ptr
public model_t model; // opaque type outside refresh public model_t model; // opaque type outside refresh
public float angles[] = { 0, 0, 0 }; public float angles[] = { 0, 0, 0 };
/* /*
** most recent data ** most recent data
*/ */
public float origin[] = { 0, 0, 0 }; // also used as RF_BEAM's "from" public float origin[] = { 0, 0, 0 }; // also used as RF_BEAM's "from"
public int frame; // also used as RF_BEAM's diameter public int frame; // also used as RF_BEAM's diameter
/* /*
** previous data for lerping ** previous data for lerping
*/ */
public float oldorigin[] = { 0, 0, 0 }; // also used as RF_BEAM's "to" public float oldorigin[] = { 0, 0, 0 }; // also used as RF_BEAM's "to"
public int oldframe; public int oldframe;
/* /*
** misc ** misc
*/ */
public float backlerp; // 0.0 = current, 1.0 = old public float backlerp; // 0.0 = current, 1.0 = old
public int skinnum; // also used as RF_BEAM's palette index public int skinnum; // also used as RF_BEAM's palette index
public int lightstyle; // for flashing entities public int lightstyle; // for flashing entities
public float alpha; // ignore if RF_TRANSLUCENT isn't set public float alpha; // ignore if RF_TRANSLUCENT isn't set
// reference // reference
public image_t skin; // NULL for inline skin public image_t skin; // NULL for inline skin
public int flags; public int flags;
public void set(entity_t src) { public void set(entity_t src) {
this.model = src.model; this.model = src.model;
Math3D.VectorCopy(src.angles, this.angles); Math3D.VectorCopy(src.angles, this.angles);
Math3D.VectorCopy(src.origin, this.origin); Math3D.VectorCopy(src.origin, this.origin);
this.frame = src.frame; this.frame = src.frame;
Math3D.VectorCopy(src.oldorigin, this.oldorigin); Math3D.VectorCopy(src.oldorigin, this.oldorigin);
this.oldframe = src.oldframe; this.oldframe = src.oldframe;
this.backlerp = src.backlerp; this.backlerp = src.backlerp;
this.skinnum = src.skinnum; this.skinnum = src.skinnum;
this.lightstyle = src.lightstyle; this.lightstyle = src.lightstyle;
this.alpha = src.alpha; this.alpha = src.alpha;
this.skin = src.skin; this.skin = src.skin;
this.flags = src.flags; this.flags = src.flags;
} }
public void clear() { public void clear() {
model = null; model = null;
Math3D.VectorClear(angles); Math3D.VectorClear(angles);
Math3D.VectorClear(origin); Math3D.VectorClear(origin);
frame = 0; frame = 0;
Math3D.VectorClear(oldorigin); Math3D.VectorClear(oldorigin);
oldframe = 0; oldframe = 0;
backlerp = 0; backlerp = 0;
skinnum = 0; skinnum = 0;
lightstyle = 0; lightstyle = 0;
alpha = 0; alpha = 0;
skin = null; skin = null;
flags = 0; flags = 0;
} }
} }

View File

@@ -23,34 +23,34 @@ import lwjake2.game.player_state_t;
import java.util.Arrays; import java.util.Arrays;
public class frame_t { public class frame_t {
public static final int MAX_MAP_AREAS = 256; public static final int MAX_MAP_AREAS = 256;
boolean valid; // cleared if delta parsing was invalid boolean valid; // cleared if delta parsing was invalid
int serverframe; int serverframe;
public int servertime; // server time the message is valid for (in msec) public int servertime; // server time the message is valid for (in msec)
int deltaframe; int deltaframe;
byte areabits[] = new byte [MAX_MAP_AREAS/8]; // portalarea visibility bits byte areabits[] = new byte [MAX_MAP_AREAS/8]; // portalarea visibility bits
public player_state_t playerstate = new player_state_t(); // mem public player_state_t playerstate = new player_state_t(); // mem
public int num_entities; public int num_entities;
public int parse_entities; // non-masked index into cl_parse_entities array public int parse_entities; // non-masked index into cl_parse_entities array
public void set(frame_t from) { public void set(frame_t from) {
valid = from.valid; valid = from.valid;
serverframe = from.serverframe; serverframe = from.serverframe;
deltaframe = from.deltaframe; deltaframe = from.deltaframe;
num_entities = from.num_entities; num_entities = from.num_entities;
parse_entities = from.parse_entities; parse_entities = from.parse_entities;
System.arraycopy(from.areabits, 0, areabits, 0, areabits.length); System.arraycopy(from.areabits, 0, areabits, 0, areabits.length);
playerstate.set(from.playerstate); playerstate.set(from.playerstate);
} }
public void reset() public void reset()
{ {
valid = false; valid = false;
serverframe = servertime = deltaframe = 0; serverframe = servertime = deltaframe = 0;
Arrays.fill(areabits, (byte)0); Arrays.fill(areabits, (byte)0);
playerstate.clear(); playerstate.clear();
num_entities = parse_entities = 0; num_entities = parse_entities = 0;
} }
} }

View File

@@ -22,8 +22,8 @@ package lwjake2.client;
* kbutton_t * kbutton_t
*/ */
public class kbutton_t { public class kbutton_t {
int[] down = new int[2]; // key nums holding it down int[] down = new int[2]; // key nums holding it down
long downtime; // msec timestamp long downtime; // msec timestamp
long msec; // msec down this frame long msec; // msec down this frame
public int state; public int state;
} }

View File

@@ -20,6 +20,6 @@ package lwjake2.client;
public class lightstyle_t public class lightstyle_t
{ {
public float rgb[] = { 0, 0, 0 }; // 0.0 - 2.0 public float rgb[] = { 0, 0, 0 }; // 0.0 - 2.0
public float white; // highest of rgb public float white; // highest of rgb
} }

View File

@@ -27,22 +27,22 @@ import java.nio.FloatBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
public class particle_t { public class particle_t {
// lwjgl renderer needs a ByteBuffer // lwjgl renderer needs a ByteBuffer
private static ByteBuffer colorByteArray = Lib.newByteBuffer(Defines.MAX_PARTICLES * Lib.SIZEOF_INT, ByteOrder.LITTLE_ENDIAN); private static ByteBuffer colorByteArray = Lib.newByteBuffer(Defines.MAX_PARTICLES * Lib.SIZEOF_INT, ByteOrder.LITTLE_ENDIAN);
public static FloatBuffer vertexArray = Lib.newFloatBuffer(Defines.MAX_PARTICLES * 3); public static FloatBuffer vertexArray = Lib.newFloatBuffer(Defines.MAX_PARTICLES * 3);
public static int[] colorTable = new int[256]; public static int[] colorTable = new int[256];
public static IntBuffer colorArray = colorByteArray.asIntBuffer(); public static IntBuffer colorArray = colorByteArray.asIntBuffer();
public static void setColorPalette(int[] palette) { public static void setColorPalette(int[] palette) {
for (int i=0; i < 256; i++) { for (int i=0; i < 256; i++) {
colorTable[i] = palette[i] & 0x00FFFFFF; colorTable[i] = palette[i] & 0x00FFFFFF;
} }
} }
public static ByteBuffer getColorAsByteBuffer() { public static ByteBuffer getColorAsByteBuffer() {
return colorByteArray; return colorByteArray;
} }
} }

View File

@@ -19,24 +19,24 @@
package lwjake2.client; package lwjake2.client;
public class refdef_t { public class refdef_t {
public int x, y, width, height;// in virtual screen coordinates public int x, y, width, height;// in virtual screen coordinates
public float fov_x, fov_y; public float fov_x, fov_y;
public float vieworg[] ={0,0,0}; public float vieworg[] ={0,0,0};
public float viewangles[]={0,0,0}; public float viewangles[]={0,0,0};
public float blend[]={0,0,0,0}; // rgba 0-1 full screen blend public float blend[]={0,0,0,0}; // rgba 0-1 full screen blend
public float time; // time is uesed to auto animate public float time; // time is uesed to auto animate
public int rdflags; // RDF_UNDERWATER, etc public int rdflags; // RDF_UNDERWATER, etc
public byte areabits[]; // if not NULL, only areas with set bits will be drawn public byte areabits[]; // if not NULL, only areas with set bits will be drawn
public lightstyle_t lightstyles[]; // [MAX_LIGHTSTYLES] public lightstyle_t lightstyles[]; // [MAX_LIGHTSTYLES]
public int num_entities; public int num_entities;
public entity_t entities[]; public entity_t entities[];
public int num_dlights; public int num_dlights;
public dlight_t dlights[]; public dlight_t dlights[];
public int num_particles; public int num_particles;
//public particle_t particles[]; //public particle_t particles[];
} }

View File

@@ -31,74 +31,74 @@ import java.awt.DisplayMode;
* @author cwei * @author cwei
*/ */
public interface refexport_t { public interface refexport_t {
// ============================================================================ // ============================================================================
// public interface for Renderer implementations // public interface for Renderer implementations
// //
// ref.h, refexport_t // ref.h, refexport_t
// ============================================================================ // ============================================================================
// //
// these are the functions exported by the refresh module // these are the functions exported by the refresh module
// //
// called when the library is loaded // called when the library is loaded
boolean Init(int vid_xpos, int vid_ypos); boolean Init(int vid_xpos, int vid_ypos);
// called before the library is unloaded // called before the library is unloaded
void Shutdown(); void Shutdown();
// All data that will be used in a level should be // All data that will be used in a level should be
// registered before rendering any frames to prevent disk hits, // registered before rendering any frames to prevent disk hits,
// but they can still be registered at a later time // but they can still be registered at a later time
// if necessary. // if necessary.
// //
// EndRegistration will free any remaining data that wasn't registered. // EndRegistration will free any remaining data that wasn't registered.
// Any model_s or skin_s pointers from before the BeginRegistration // Any model_s or skin_s pointers from before the BeginRegistration
// are no longer valid after EndRegistration. // are no longer valid after EndRegistration.
// //
// Skins and images need to be differentiated, because skins // Skins and images need to be differentiated, because skins
// are flood filled to eliminate mip map edge errors, and pics have // are flood filled to eliminate mip map edge errors, and pics have
// an implicit "pics/" prepended to the name. (a pic name that starts with a // an implicit "pics/" prepended to the name. (a pic name that starts with a
// slash will not use the "pics/" prefix or the ".pcx" postfix) // slash will not use the "pics/" prefix or the ".pcx" postfix)
void BeginRegistration(String map); void BeginRegistration(String map);
model_t RegisterModel(String name); model_t RegisterModel(String name);
image_t RegisterSkin(String name); image_t RegisterSkin(String name);
image_t RegisterPic(String name); image_t RegisterPic(String name);
void SetSky(String name, float rotate, /* vec3_t */ void SetSky(String name, float rotate, /* vec3_t */
float[] axis); float[] axis);
void EndRegistration(); void EndRegistration();
void RenderFrame(refdef_t fd); void RenderFrame(refdef_t fd);
void DrawGetPicSize(Dimension dim /* int *w, *h */, String name); void DrawGetPicSize(Dimension dim /* int *w, *h */, String name);
// will return 0 0 if not found // will return 0 0 if not found
void DrawPic(int x, int y, String name); void DrawPic(int x, int y, String name);
void DrawStretchPic(int x, int y, int w, int h, String name); void DrawStretchPic(int x, int y, int w, int h, String name);
void DrawChar(int x, int y, int num); // num is 8 bit ASCII void DrawChar(int x, int y, int num); // num is 8 bit ASCII
void DrawTileClear(int x, int y, int w, int h, String name); void DrawTileClear(int x, int y, int w, int h, String name);
void DrawFill(int x, int y, int w, int h, int c); void DrawFill(int x, int y, int w, int h, int c);
void DrawFadeScreen(); void DrawFadeScreen();
// Draw images for cinematic rendering (which can have a different palette). Note that calls // Draw images for cinematic rendering (which can have a different palette). Note that calls
void DrawStretchRaw(int x, int y, int w, int h, int cols, int rows, byte[] data); void DrawStretchRaw(int x, int y, int w, int h, int cols, int rows, byte[] data);
/* /*
** video mode and refresh state management entry points ** video mode and refresh state management entry points
*/ */
/* 256 r,g,b values; null = game palette, size = 768 bytes */ /* 256 r,g,b values; null = game palette, size = 768 bytes */
void CinematicSetPalette(final byte[] palette); void CinematicSetPalette(final byte[] palette);
void BeginFrame(float camera_separation); void BeginFrame(float camera_separation);
void EndFrame(); void EndFrame();
void AppActivate(boolean activate); void AppActivate(boolean activate);
/** /**
* *
* *
*/ */
void updateScreen(Runnable callback); void updateScreen(Runnable callback);
int apiVersion(); int apiVersion();
DisplayMode[] getModeList(); DisplayMode[] getModeList();
KBD getKeyboardHandler(); KBD getKeyboardHandler();
} }

View File

@@ -19,5 +19,5 @@
package lwjake2.client; package lwjake2.client;
public class viddef_t { public class viddef_t {
public int width, height; public int width, height;
} }

View File

@@ -24,14 +24,14 @@ package lwjake2.client;
* @author cwei * @author cwei
*/ */
public class vidmode_t { public class vidmode_t {
String description; String description;
int width, height; int width, height;
int mode; int mode;
vidmode_t (String description, int width, int height, int mode) { vidmode_t (String description, int width, int height, int mode) {
this.description = description; this.description = description;
this.width = width; this.width = width;
this.height = height; this.height = height;
this.mode = mode; this.mode = mode;
} }
} }

View File

@@ -24,9 +24,9 @@ package lwjake2.client;
* @author cwei * @author cwei
*/ */
public class vrect_t { public class vrect_t {
public int x; public int x;
public int y; public int y;
public int width; public int width;
public int height; public int height;
vrect_t pnext; vrect_t pnext;
} }

View File

@@ -20,5 +20,5 @@ package lwjake2.game;
public abstract class AIAdapter extends SuperAdapter public abstract class AIAdapter extends SuperAdapter
{ {
public abstract void ai(edict_t self, float dist); public abstract void ai(edict_t self, float dist);
} }

View File

@@ -427,7 +427,7 @@ public final class Cmd {
if (GameBase.deathmatch.value != 0 && GameBase.sv_cheats.value == 0) { if (GameBase.deathmatch.value != 0 && GameBase.sv_cheats.value == 0) {
SV_GAME.PF_cprintfhigh(ent, SV_GAME.PF_cprintfhigh(ent,
"You must run the server with '+set cheats 1' to enable this command.\n"); "You must run the server with '+set cheats 1' to enable this command.\n");
return; return;
} }
@@ -559,7 +559,7 @@ public final class Cmd {
if (GameBase.deathmatch.value != 0 && GameBase.sv_cheats.value == 0) { if (GameBase.deathmatch.value != 0 && GameBase.sv_cheats.value == 0) {
SV_GAME.PF_cprintfhigh(ent, SV_GAME.PF_cprintfhigh(ent,
"You must run the server with '+set cheats 1' to enable this command.\n"); "You must run the server with '+set cheats 1' to enable this command.\n");
return; return;
} }
@@ -584,7 +584,7 @@ public final class Cmd {
if (GameBase.deathmatch.value != 0 && GameBase.sv_cheats.value == 0) { if (GameBase.deathmatch.value != 0 && GameBase.sv_cheats.value == 0) {
SV_GAME.PF_cprintfhigh(ent, SV_GAME.PF_cprintfhigh(ent,
"You must run the server with '+set cheats 1' to enable this command.\n"); "You must run the server with '+set cheats 1' to enable this command.\n");
return; return;
} }
@@ -607,7 +607,7 @@ public final class Cmd {
if (GameBase.deathmatch.value != 0 && GameBase.sv_cheats.value == 0) { if (GameBase.deathmatch.value != 0 && GameBase.sv_cheats.value == 0) {
SV_GAME.PF_cprintfhigh(ent, SV_GAME.PF_cprintfhigh(ent,
"You must run the server with '+set cheats 1' to enable this command.\n"); "You must run the server with '+set cheats 1' to enable this command.\n");
return; return;
} }
@@ -1256,7 +1256,7 @@ public final class Cmd {
Say_f(ent, false, true); Say_f(ent, false, true);
} }
public static void ValidateSelectedItem(edict_t ent) { public static void ValidateSelectedItem(edict_t ent) {
gclient_t cl = ent.client; gclient_t cl = ent.client;
if (cl.pers.inventory[cl.pers.selected_item] != 0) if (cl.pers.inventory[cl.pers.selected_item] != 0)

View File

@@ -22,8 +22,8 @@ package lwjake2.game;
public class EdictFindFilter public class EdictFindFilter
{ {
boolean matches(edict_t e, String s) boolean matches(edict_t e, String s)
{ {
return false; return false;
}; };
} }

View File

@@ -22,10 +22,10 @@ package lwjake2.game;
public class EdictIterator public class EdictIterator
{ {
EdictIterator(int i) EdictIterator(int i)
{ {
this.i = i; this.i = i;
} }
public edict_t o; public edict_t o;
int i; int i;
} }

View File

@@ -20,50 +20,50 @@ package lwjake2.game;
public abstract class EndianHandler public abstract class EndianHandler
{ {
private static final int mask = 0xFF; private static final int mask = 0xFF;
abstract public float BigFloat(float f); abstract public float BigFloat(float f);
abstract public short BigShort(short s); abstract public short BigShort(short s);
abstract public int BigLong(int i); abstract public int BigLong(int i);
abstract public float LittleFloat(float f); abstract public float LittleFloat(float f);
abstract public short LittleShort(short s); abstract public short LittleShort(short s);
abstract public int LittleLong(int i); abstract public int LittleLong(int i);
public static float swapFloat(float f) public static float swapFloat(float f)
{ {
int i = Float.floatToRawIntBits(f); int i = Float.floatToRawIntBits(f);
i = swapInt(i); i = swapInt(i);
f = Float.intBitsToFloat(i); f = Float.intBitsToFloat(i);
return f; return f;
} }
public static int swapInt(int i) public static int swapInt(int i)
{ {
int a = i & mask; int a = i & mask;
i >>>= 8; i >>>= 8;
a <<= 24; a <<= 24;
int b = i & mask; int b = i & mask;
i >>>= 8; i >>>= 8;
b <<= 16; b <<= 16;
int c = i & mask; int c = i & mask;
i >>>= 8; i >>>= 8;
c <<= 8; c <<= 8;
return i | c | b | a; return i | c | b | a;
} }
public static short swapShort(short s) public static short swapShort(short s)
{ {
int a = s & mask; int a = s & mask;
a <<= 8; a <<= 8;
int b = (s >>> 8) & mask; int b = (s >>> 8) & mask;
return (short) (b | a); return (short) (b | a);
} }
} }

View File

@@ -20,6 +20,6 @@ package lwjake2.game;
public abstract class EntBlockedAdapter extends SuperAdapter public abstract class EntBlockedAdapter extends SuperAdapter
{ {
// move to moveinfo? // move to moveinfo?
public abstract void blocked(edict_t self, edict_t other); public abstract void blocked(edict_t self, edict_t other);
} }

View File

@@ -20,5 +20,5 @@ package lwjake2.game;
public abstract class EntDieAdapter extends SuperAdapter public abstract class EntDieAdapter extends SuperAdapter
{ {
public abstract void die(edict_t self, edict_t inflictor, edict_t attacker, int damage, float[] point); public abstract void die(edict_t self, edict_t inflictor, edict_t attacker, int damage, float[] point);
} }

View File

@@ -20,5 +20,5 @@ package lwjake2.game;
public abstract class EntDodgeAdapter extends SuperAdapter public abstract class EntDodgeAdapter extends SuperAdapter
{ {
public abstract void dodge(edict_t self, edict_t other, float eta); public abstract void dodge(edict_t self, edict_t other, float eta);
} }

View File

@@ -20,5 +20,5 @@ package lwjake2.game;
public abstract class EntInteractAdapter extends SuperAdapter public abstract class EntInteractAdapter extends SuperAdapter
{ {
public abstract boolean interact(edict_t self, edict_t other); public abstract boolean interact(edict_t self, edict_t other);
} }

View File

@@ -20,5 +20,5 @@ package lwjake2.game;
public abstract class EntPainAdapter extends SuperAdapter public abstract class EntPainAdapter extends SuperAdapter
{ {
public abstract void pain(edict_t self, edict_t other, float kick, int damage); public abstract void pain(edict_t self, edict_t other, float kick, int damage);
} }

View File

@@ -20,5 +20,5 @@ package lwjake2.game;
public abstract class EntThinkAdapter extends SuperAdapter public abstract class EntThinkAdapter extends SuperAdapter
{ {
public abstract boolean think(edict_t self); public abstract boolean think(edict_t self);
} }

View File

@@ -20,5 +20,5 @@ package lwjake2.game;
public abstract class EntTouchAdapter extends SuperAdapter public abstract class EntTouchAdapter extends SuperAdapter
{ {
public abstract void touch(edict_t self, edict_t other, cplane_t plane, csurface_t surf); public abstract void touch(edict_t self, edict_t other, cplane_t plane, csurface_t surf);
} }

View File

@@ -20,5 +20,5 @@ package lwjake2.game;
public abstract class EntUseAdapter extends SuperAdapter public abstract class EntUseAdapter extends SuperAdapter
{ {
public abstract void use(edict_t self, edict_t other, edict_t activator); public abstract void use(edict_t self, edict_t other, edict_t activator);
} }

View File

@@ -622,7 +622,7 @@ public class GameAI {
// just lost sight of the player, decide where to go first // just lost sight of the player, decide where to go first
// dprint("lost sight of player, last seen at "); // dprint("lost sight of player, last seen at ");
// dprint(vtos(self.last_sighting)); // dprint(vtos(self.last_sighting));
// dprint("\n"); // dprint("\n");
self.monsterinfo.aiflags |= (Defines.AI_LOST_SIGHT | Defines.AI_PURSUIT_LAST_SEEN); self.monsterinfo.aiflags |= (Defines.AI_LOST_SIGHT | Defines.AI_PURSUIT_LAST_SEEN);
self.monsterinfo.aiflags &= ~(Defines.AI_PURSUE_NEXT | Defines.AI_PURSUE_TEMP); self.monsterinfo.aiflags &= ~(Defines.AI_PURSUE_NEXT | Defines.AI_PURSUE_TEMP);
new1 = true; new1 = true;

View File

@@ -456,16 +456,16 @@ public class GameBase {
StringTokenizer tk = new StringTokenizer(s, seps); StringTokenizer tk = new StringTokenizer(s, seps);
while (tk.hasMoreTokens()){ while (tk.hasMoreTokens()){
t = tk.nextToken(); t = tk.nextToken();
// store first map // store first map
if (f == null) if (f == null)
f = t; f = t;
if (t.equalsIgnoreCase(level.mapname)) { if (t.equalsIgnoreCase(level.mapname)) {
// it's in the list, go to the next one // it's in the list, go to the next one
if (!tk.hasMoreTokens()) { if (!tk.hasMoreTokens()) {
// end of list, go to first one // end of list, go to first one
if (f == null) // there isn't a first one, same level if (f == null) // there isn't a first one, same level
PlayerHud.BeginIntermission(CreateTargetChangeLevel(level.mapname)); PlayerHud.BeginIntermission(CreateTargetChangeLevel(level.mapname));
else else

View File

@@ -102,7 +102,7 @@ public class GameCombat {
if ((targ.svflags & Defines.SVF_MONSTER) != 0 if ((targ.svflags & Defines.SVF_MONSTER) != 0
&& (targ.deadflag != Defines.DEAD_DEAD)) { && (targ.deadflag != Defines.DEAD_DEAD)) {
// targ.svflags |= SVF_DEADMONSTER; // now treat as a different // targ.svflags |= SVF_DEADMONSTER; // now treat as a different
// content type // content type
if (0 == (targ.monsterinfo.aiflags & Defines.AI_GOOD_GUY)) { if (0 == (targ.monsterinfo.aiflags & Defines.AI_GOOD_GUY)) {
GameBase.level.killed_monsters++; GameBase.level.killed_monsters++;
@@ -139,7 +139,7 @@ public class GameCombat {
damage = 255; damage = 255;
GameBase.gi.WriteByte(Defines.svc_temp_entity); GameBase.gi.WriteByte(Defines.svc_temp_entity);
GameBase.gi.WriteByte(type); GameBase.gi.WriteByte(type);
// gi.WriteByte (damage); // gi.WriteByte (damage);
GameBase.gi.WritePosition(origin); GameBase.gi.WritePosition(origin);
GameBase.gi.WriteDir(normal); GameBase.gi.WriteDir(normal);
GameBase.gi.multicast(origin, Defines.MULTICAST_PVS); GameBase.gi.multicast(origin, Defines.MULTICAST_PVS);

View File

@@ -190,8 +190,8 @@ public class GameFunc {
float[] tmin = { 0, 0, 0 }, tmax = { 0, 0, 0 }; float[] tmin = { 0, 0, 0 }, tmax = { 0, 0, 0 };
// //
// middle trigger // middle trigger
// //
trigger = GameUtil.G_Spawn(); trigger = GameUtil.G_Spawn();
trigger.touch = Touch_Plat_Center; trigger.touch = Touch_Plat_Center;
trigger.movetype = Defines.MOVETYPE_NONE; trigger.movetype = Defines.MOVETYPE_NONE;
@@ -583,7 +583,7 @@ public class GameFunc {
public final static int DOOR_Y_AXIS = 128; public final static int DOOR_Y_AXIS = 128;
// //
// Support routines for movement (changes in origin using velocity) // Support routines for movement (changes in origin using velocity)
// //
static EntThinkAdapter Move_Done = new EntThinkAdapter() { static EntThinkAdapter Move_Done = new EntThinkAdapter() {
@@ -638,7 +638,7 @@ public class GameFunc {
}; };
// //
// Support routines for angular movement (changes in angle using avelocity) // Support routines for angular movement (changes in angle using avelocity)
// //
static EntThinkAdapter AngleMove_Done = new EntThinkAdapter() { static EntThinkAdapter AngleMove_Done = new EntThinkAdapter() {
@@ -925,7 +925,7 @@ public class GameFunc {
if (0 == ent.dmg) if (0 == ent.dmg)
ent.dmg = 2; ent.dmg = 2;
// ent.moveinfo.sound_middle = "doors/hydro1.wav"; // ent.moveinfo.sound_middle = "doors/hydro1.wav";
ent.use = rotating_use; ent.use = rotating_use;
if (ent.dmg != 0) if (ent.dmg != 0)
@@ -1725,7 +1725,7 @@ public class GameFunc {
boolean dogoto = true; boolean dogoto = true;
while (dogoto) { while (dogoto) {
if (null == self.target) { if (null == self.target) {
// gi.dprintf ("train_next: no next target\n"); // gi.dprintf ("train_next: no next target\n");
return true; return true;
} }
@@ -1841,7 +1841,7 @@ public class GameFunc {
edict_t target; edict_t target;
if (0 != self.movetarget.nextthink) { if (0 != self.movetarget.nextthink) {
// gi.dprintf("elevator busy\n"); // gi.dprintf("elevator busy\n");
return; return;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -902,7 +902,7 @@ public class GameMisc {
public String getID() { return "use_areaportal";} public String getID() { return "use_areaportal";}
public void use(edict_t ent, edict_t other, edict_t activator) { public void use(edict_t ent, edict_t other, edict_t activator) {
ent.count ^= 1; // toggle state ent.count ^= 1; // toggle state
// gi.dprintf ("portalstate: %i = %i\n", ent.style, ent.count); // gi.dprintf ("portalstate: %i = %i\n", ent.style, ent.count);
GameBase.gi.SetAreaPortalState(ent.style, ent.count != 0); GameBase.gi.SetAreaPortalState(ent.style, ent.count != 0);
} }
}; };
@@ -1871,7 +1871,7 @@ public class GameMisc {
GameBase.gi.setmodel(ent, "models/objects/dmspot/tris.md2"); GameBase.gi.setmodel(ent, "models/objects/dmspot/tris.md2");
ent.s.skinnum = 0; ent.s.skinnum = 0;
ent.solid = Defines.SOLID_BBOX; ent.solid = Defines.SOLID_BBOX;
// ent.s.effects |= EF_FLIES; // ent.s.effects |= EF_FLIES;
Math3D.VectorSet(ent.mins, -32, -32, -24); Math3D.VectorSet(ent.mins, -32, -32, -24);
Math3D.VectorSet(ent.maxs, 32, 32, -16); Math3D.VectorSet(ent.maxs, 32, 32, -16);
GameBase.gi.linkentity(ent); GameBase.gi.linkentity(ent);

View File

@@ -87,7 +87,7 @@ public class GameSVCmds {
*/ */
static boolean StringToFilter(String s, GameSVCmds.ipfilter_t f) { static boolean StringToFilter(String s, GameSVCmds.ipfilter_t f) {
byte b[] = { 0, 0, 0, 0 }; byte b[] = { 0, 0, 0, 0 };
byte m[] = { 0, 0, 0, 0 }; byte m[] = { 0, 0, 0, 0 };
try { try {

View File

@@ -41,71 +41,71 @@ public class GameSave {
} }
private static String preloadclasslist [] = private static String preloadclasslist [] =
{ {
"jake2.game.PlayerWeapon", "jake2.game.PlayerWeapon",
"jake2.game.AIAdapter", "jake2.game.AIAdapter",
"jake2.game.Cmd", "jake2.game.Cmd",
"jake2.game.EdictFindFilter", "jake2.game.EdictFindFilter",
"jake2.game.EdictIterator", "jake2.game.EdictIterator",
"jake2.game.EndianHandler", "jake2.game.EndianHandler",
"jake2.game.EntBlockedAdapter", "jake2.game.EntBlockedAdapter",
"jake2.game.EntDieAdapter", "jake2.game.EntDieAdapter",
"jake2.game.EntDodgeAdapter", "jake2.game.EntDodgeAdapter",
"jake2.game.EntInteractAdapter", "jake2.game.EntInteractAdapter",
"jake2.game.EntPainAdapter", "jake2.game.EntPainAdapter",
"jake2.game.EntThinkAdapter", "jake2.game.EntThinkAdapter",
"jake2.game.EntTouchAdapter", "jake2.game.EntTouchAdapter",
"jake2.game.EntUseAdapter", "jake2.game.EntUseAdapter",
"jake2.game.GameAI", "jake2.game.GameAI",
"jake2.game.GameBase", "jake2.game.GameBase",
"jake2.game.GameChase", "jake2.game.GameChase",
"jake2.game.GameCombat", "jake2.game.GameCombat",
"jake2.game.GameFunc", "jake2.game.GameFunc",
"jake2.game.GameMisc", "jake2.game.GameMisc",
"jake2.game.GameSVCmds", "jake2.game.GameSVCmds",
"jake2.game.GameSave", "jake2.game.GameSave",
"jake2.game.GameSpawn", "jake2.game.GameSpawn",
"jake2.game.GameTarget", "jake2.game.GameTarget",
"jake2.game.GameTrigger", "jake2.game.GameTrigger",
"jake2.game.GameTurret", "jake2.game.GameTurret",
"jake2.game.GameUtil", "jake2.game.GameUtil",
"jake2.game.GameWeapon", "jake2.game.GameWeapon",
"jake2.game.Info", "jake2.game.Info",
"jake2.game.ItemDropAdapter", "jake2.game.ItemDropAdapter",
"jake2.game.ItemUseAdapter", "jake2.game.ItemUseAdapter",
"jake2.game.Monster", "jake2.game.Monster",
"jake2.game.PlayerClient", "jake2.game.PlayerClient",
"jake2.game.PlayerHud", "jake2.game.PlayerHud",
"jake2.game.PlayerTrail", "jake2.game.PlayerTrail",
"jake2.game.PlayerView", "jake2.game.PlayerView",
"jake2.game.SuperAdapter", "jake2.game.SuperAdapter",
"jake2.game.monsters.M_Actor", "jake2.game.monsters.M_Actor",
"jake2.game.monsters.M_Berserk", "jake2.game.monsters.M_Berserk",
"jake2.game.monsters.M_Boss2", "jake2.game.monsters.M_Boss2",
"jake2.game.monsters.M_Boss3", "jake2.game.monsters.M_Boss3",
"jake2.game.monsters.M_Boss31", "jake2.game.monsters.M_Boss31",
"jake2.game.monsters.M_Boss32", "jake2.game.monsters.M_Boss32",
"jake2.game.monsters.M_Brain", "jake2.game.monsters.M_Brain",
"jake2.game.monsters.M_Chick", "jake2.game.monsters.M_Chick",
"jake2.game.monsters.M_Flash", "jake2.game.monsters.M_Flash",
"jake2.game.monsters.M_Flipper", "jake2.game.monsters.M_Flipper",
"jake2.game.monsters.M_Float", "jake2.game.monsters.M_Float",
"jake2.game.monsters.M_Flyer", "jake2.game.monsters.M_Flyer",
"jake2.game.monsters.M_Gladiator", "jake2.game.monsters.M_Gladiator",
"jake2.game.monsters.M_Gunner", "jake2.game.monsters.M_Gunner",
"jake2.game.monsters.M_Hover", "jake2.game.monsters.M_Hover",
"jake2.game.monsters.M_Infantry", "jake2.game.monsters.M_Infantry",
"jake2.game.monsters.M_Insane", "jake2.game.monsters.M_Insane",
"jake2.game.monsters.M_Medic", "jake2.game.monsters.M_Medic",
"jake2.game.monsters.M_Mutant", "jake2.game.monsters.M_Mutant",
"jake2.game.monsters.M_Parasite", "jake2.game.monsters.M_Parasite",
"jake2.game.monsters.M_Player", "jake2.game.monsters.M_Player",
"jake2.game.monsters.M_Soldier", "jake2.game.monsters.M_Soldier",
"jake2.game.monsters.M_Supertank", "jake2.game.monsters.M_Supertank",
"jake2.game.monsters.M_Tank", "jake2.game.monsters.M_Tank",
"jake2.game.GameItems", "jake2.game.GameItems",
// DANGER! init as last, when all adatpers are != null // DANGER! init as last, when all adatpers are != null
"jake2.game.GameItemList" "jake2.game.GameItemList"
}; };
/** /**
@@ -120,14 +120,14 @@ public class GameSave {
// preload all classes to register the adapters // preload all classes to register the adapters
for ( int n=0; n < preloadclasslist.length; n++) for ( int n=0; n < preloadclasslist.length; n++)
{ {
try try
{ {
Class.forName(preloadclasslist[n]); Class.forName(preloadclasslist[n]);
} }
catch(Exception e) catch(Exception e)
{ {
Com.DPrintf("error loading class: " + e.getMessage()); Com.DPrintf("error loading class: " + e.getMessage());
} }
} }

View File

@@ -569,42 +569,42 @@ public class GameSpawn {
PlayerTrail.Init(); PlayerTrail.Init();
} }
static String single_statusbar = "yb -24 " // health static String single_statusbar = "yb -24 " // health
+ "xv 0 " + "hnum " + "xv 50 " + "pic 0 " // ammo + "xv 0 " + "hnum " + "xv 50 " + "pic 0 " // ammo
+ "if 2 " + " xv 100 " + " anum " + " xv 150 " + " pic 2 " + "if 2 " + " xv 100 " + " anum " + " xv 150 " + " pic 2 "
+ "endif " // armor + "endif " // armor
+ "if 4 " + " xv 200 " + " rnum " + " xv 250 " + " pic 4 " + "if 4 " + " xv 200 " + " rnum " + " xv 250 " + " pic 4 "
+ "endif " // selected item + "endif " // selected item
+ "if 6 " + " xv 296 " + " pic 6 " + "endif " + "yb -50 " // picked + "if 6 " + " xv 296 " + " pic 6 " + "endif " + "yb -50 " // picked
// up // up
// item // item
+ "if 7 " + " xv 0 " + " pic 7 " + " xv 26 " + " yb -42 " + "if 7 " + " xv 0 " + " pic 7 " + " xv 26 " + " yb -42 "
+ " stat_string 8 " + " yb -50 " + "endif " + " stat_string 8 " + " yb -50 " + "endif "
// timer // timer
+ "if 9 " + " xv 262 " + " num 2 10 " + " xv 296 " + " pic 9 " + "if 9 " + " xv 262 " + " num 2 10 " + " xv 296 " + " pic 9 "
+ "endif " + "endif "
// help / weapon icon // help / weapon icon
+ "if 11 " + " xv 148 " + " pic 11 " + "endif "; + "if 11 " + " xv 148 " + " pic 11 " + "endif ";
static String dm_statusbar = "yb -24 " // health static String dm_statusbar = "yb -24 " // health
+ "xv 0 " + "hnum " + "xv 50 " + "pic 0 " // ammo + "xv 0 " + "hnum " + "xv 50 " + "pic 0 " // ammo
+ "if 2 " + " xv 100 " + " anum " + " xv 150 " + " pic 2 " + "if 2 " + " xv 100 " + " anum " + " xv 150 " + " pic 2 "
+ "endif " // armor + "endif " // armor
+ "if 4 " + " xv 200 " + " rnum " + " xv 250 " + " pic 4 " + "if 4 " + " xv 200 " + " rnum " + " xv 250 " + " pic 4 "
+ "endif " // selected item + "endif " // selected item
+ "if 6 " + " xv 296 " + " pic 6 " + "endif " + "yb -50 " // picked + "if 6 " + " xv 296 " + " pic 6 " + "endif " + "yb -50 " // picked
// up // up
// item // item
+ "if 7 " + " xv 0 " + " pic 7 " + " xv 26 " + " yb -42 " + "if 7 " + " xv 0 " + " pic 7 " + " xv 26 " + " yb -42 "
+ " stat_string 8 " + " yb -50 " + "endif " + " stat_string 8 " + " yb -50 " + "endif "
// timer // timer
+ "if 9 " + " xv 246 " + " num 2 10 " + " xv 296 " + " pic 9 " + "if 9 " + " xv 246 " + " num 2 10 " + " xv 296 " + " pic 9 "
+ "endif " + "endif "
// help / weapon icon // help / weapon icon
+ "if 11 " + " xv 148 " + " pic 11 " + "endif " // frags + "if 11 " + " xv 148 " + " pic 11 " + "endif " // frags
+ "xr -50 " + "yt 2 " + "num 3 14 " // spectator + "xr -50 " + "yt 2 " + "num 3 14 " // spectator
+ "if 17 " + "xv 0 " + "yb -58 " + "string2 \"SPECTATOR MODE\" " + "if 17 " + "xv 0 " + "yb -58 " + "string2 \"SPECTATOR MODE\" "
+ "endif " // chase camera + "endif " // chase camera
+ "if 16 " + "xv 0 " + "yb -68 " + "string \"Chasing\" " + "xv 64 " + "if 16 " + "xv 0 " + "yb -68 " + "string \"Chasing\" " + "xv 64 "
+ "stat_string 16 " + "endif "; + "stat_string 16 " + "endif ";

View File

@@ -261,7 +261,7 @@ public class GameTarget {
* temp entity event to the clients. "style" type byte * temp entity event to the clients. "style" type byte
*/ */
public static EntUseAdapter Use_Target_Tent = new EntUseAdapter() { public static EntUseAdapter Use_Target_Tent = new EntUseAdapter() {
public String getID() { return "Use_Target_Tent"; } public String getID() { return "Use_Target_Tent"; }
public void use(edict_t ent, edict_t other, edict_t activator) { public void use(edict_t ent, edict_t other, edict_t activator) {
GameBase.gi.WriteByte(Defines.svc_temp_entity); GameBase.gi.WriteByte(Defines.svc_temp_entity);
GameBase.gi.WriteByte(ent.style); GameBase.gi.WriteByte(ent.style);
@@ -284,7 +284,7 @@ public class GameTarget {
* without any speed cost. * without any speed cost.
*/ */
public static EntUseAdapter Use_Target_Speaker = new EntUseAdapter() { public static EntUseAdapter Use_Target_Speaker = new EntUseAdapter() {
public String getID() { return "Use_Target_Speaker"; } public String getID() { return "Use_Target_Speaker"; }
public void use(edict_t ent, edict_t other, edict_t activator) { public void use(edict_t ent, edict_t other, edict_t activator) {
int chan; int chan;
@@ -309,7 +309,7 @@ public class GameTarget {
public static EntUseAdapter Use_Target_Help = new EntUseAdapter() { public static EntUseAdapter Use_Target_Help = new EntUseAdapter() {
public String getID() { return "Use_Target_Help"; } public String getID() { return "Use_Target_Help"; }
public void use(edict_t ent, edict_t other, edict_t activator) { public void use(edict_t ent, edict_t other, edict_t activator) {
if ((ent.spawnflags & 1) != 0) if ((ent.spawnflags & 1) != 0)
@@ -326,7 +326,7 @@ public class GameTarget {
* These are single use targets. * These are single use targets.
*/ */
static EntUseAdapter use_target_secret = new EntUseAdapter() { static EntUseAdapter use_target_secret = new EntUseAdapter() {
public String getID() { return "use_target_secret"; } public String getID() { return "use_target_secret"; }
public void use(edict_t ent, edict_t other, edict_t activator) { public void use(edict_t ent, edict_t other, edict_t activator) {
GameBase.gi.sound(ent, Defines.CHAN_VOICE, ent.noise_index, 1, GameBase.gi.sound(ent, Defines.CHAN_VOICE, ent.noise_index, 1,
Defines.ATTN_NORM, 0); Defines.ATTN_NORM, 0);
@@ -343,7 +343,7 @@ public class GameTarget {
* These are single use targets. * These are single use targets.
*/ */
static EntUseAdapter use_target_goal = new EntUseAdapter() { static EntUseAdapter use_target_goal = new EntUseAdapter() {
public String getID() { return "use_target_goal"; } public String getID() { return "use_target_goal"; }
public void use(edict_t ent, edict_t other, edict_t activator) { public void use(edict_t ent, edict_t other, edict_t activator) {
GameBase.gi.sound(ent, Defines.CHAN_VOICE, ent.noise_index, 1, GameBase.gi.sound(ent, Defines.CHAN_VOICE, ent.noise_index, 1,
Defines.ATTN_NORM, 0); Defines.ATTN_NORM, 0);
@@ -367,7 +367,7 @@ public class GameTarget {
* should be done, defaults to 0 * should be done, defaults to 0
*/ */
static EntThinkAdapter target_explosion_explode = new EntThinkAdapter() { static EntThinkAdapter target_explosion_explode = new EntThinkAdapter() {
public String getID() { return "target_explosion_explode"; } public String getID() { return "target_explosion_explode"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float save; float save;
@@ -389,7 +389,7 @@ public class GameTarget {
}; };
static EntUseAdapter use_target_explosion = new EntUseAdapter() { static EntUseAdapter use_target_explosion = new EntUseAdapter() {
public String getID() { return "use_target_explosion"; } public String getID() { return "use_target_explosion"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
self.activator = activator; self.activator = activator;
@@ -408,7 +408,7 @@ public class GameTarget {
* "map" when fired * "map" when fired
*/ */
static EntUseAdapter use_target_changelevel = new EntUseAdapter() { static EntUseAdapter use_target_changelevel = new EntUseAdapter() {
public String getID() { return "use_target_changelevel"; } public String getID() { return "use_target_changelevel"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
if (GameBase.level.intermissiontime != 0) if (GameBase.level.intermissiontime != 0)
return; // already activated return; // already activated
@@ -456,7 +456,7 @@ public class GameTarget {
* at this location when it splashes useful for lava/sparks * at this location when it splashes useful for lava/sparks
*/ */
static EntUseAdapter use_target_splash = new EntUseAdapter() { static EntUseAdapter use_target_splash = new EntUseAdapter() {
public String getID() { return "use_target_splash"; } public String getID() { return "use_target_splash"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
GameBase.gi.WriteByte(Defines.svc_temp_entity); GameBase.gi.WriteByte(Defines.svc_temp_entity);
GameBase.gi.WriteByte(Defines.TE_SPLASH); GameBase.gi.WriteByte(Defines.TE_SPLASH);
@@ -484,7 +484,7 @@ public class GameTarget {
*/ */
static EntUseAdapter use_target_spawner = new EntUseAdapter() { static EntUseAdapter use_target_spawner = new EntUseAdapter() {
public String getID() { return "use_target_spawner"; } public String getID() { return "use_target_spawner"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
edict_t ent; edict_t ent;
@@ -508,10 +508,10 @@ public class GameTarget {
* dmg default is 15 speed default is 1000 * dmg default is 15 speed default is 1000
*/ */
public static EntUseAdapter use_target_blaster = new EntUseAdapter() { public static EntUseAdapter use_target_blaster = new EntUseAdapter() {
public String getID() { return "use_target_blaster"; } public String getID() { return "use_target_blaster"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
/* Wait what - flibit /* Wait what - flibit
int effect; int effect;
if ((self.spawnflags & 2) != 0) if ((self.spawnflags & 2) != 0)
@@ -520,7 +520,7 @@ public class GameTarget {
effect = Defines.EF_HYPERBLASTER; effect = Defines.EF_HYPERBLASTER;
else else
effect = Defines.EF_BLASTER; effect = Defines.EF_BLASTER;
*/ */
GameWeapon.fire_blaster(self, self.s.origin, self.movedir, self.dmg, GameWeapon.fire_blaster(self, self.s.origin, self.movedir, self.dmg,
(int) self.speed, Defines.EF_BLASTER, (int) self.speed, Defines.EF_BLASTER,
@@ -541,7 +541,7 @@ public class GameTarget {
* and killtarget also work. * and killtarget also work.
*/ */
public static EntUseAdapter trigger_crosslevel_trigger_use = new EntUseAdapter() { public static EntUseAdapter trigger_crosslevel_trigger_use = new EntUseAdapter() {
public String getID() { return "trigger_crosslevel_trigger_use"; } public String getID() { return "trigger_crosslevel_trigger_use"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
GameBase.game.serverflags |= self.spawnflags; GameBase.game.serverflags |= self.spawnflags;
GameUtil.G_FreeEdict(self); GameUtil.G_FreeEdict(self);
@@ -558,7 +558,7 @@ public class GameTarget {
* (default 1) * (default 1)
*/ */
static EntThinkAdapter target_crosslevel_target_think = new EntThinkAdapter() { static EntThinkAdapter target_crosslevel_target_think = new EntThinkAdapter() {
public String getID() { return "target_crosslevel_target_think"; } public String getID() { return "target_crosslevel_target_think"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
if (self.spawnflags == (GameBase.game.serverflags if (self.spawnflags == (GameBase.game.serverflags
& Defines.SFL_CROSS_TRIGGER_MASK & self.spawnflags)) { & Defines.SFL_CROSS_TRIGGER_MASK & self.spawnflags)) {
@@ -575,7 +575,7 @@ public class GameTarget {
* target or a direction. * target or a direction.
*/ */
public static EntThinkAdapter target_laser_think = new EntThinkAdapter() { public static EntThinkAdapter target_laser_think = new EntThinkAdapter() {
public String getID() { return "target_laser_think"; } public String getID() { return "target_laser_think"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
edict_t ignore; edict_t ignore;
@@ -648,7 +648,7 @@ public class GameTarget {
}; };
public static EntUseAdapter target_laser_use = new EntUseAdapter() { public static EntUseAdapter target_laser_use = new EntUseAdapter() {
public String getID() { return "target_laser_use"; } public String getID() { return "target_laser_use"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
self.activator = activator; self.activator = activator;
@@ -660,7 +660,7 @@ public class GameTarget {
}; };
static EntThinkAdapter target_laser_start = new EntThinkAdapter() { static EntThinkAdapter target_laser_start = new EntThinkAdapter() {
public String getID() { return "target_laser_start"; } public String getID() { return "target_laser_start"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
self.movetype = Defines.MOVETYPE_NONE; self.movetype = Defines.MOVETYPE_NONE;
@@ -724,7 +724,7 @@ public class GameTarget {
*/ */
static EntThinkAdapter target_lightramp_think = new EntThinkAdapter() { static EntThinkAdapter target_lightramp_think = new EntThinkAdapter() {
public String getID() { return "target_lightramp_think"; } public String getID() { return "target_lightramp_think"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
char tmp[] = {(char) ('a' + (int) (self.movedir[0] + (GameBase.level.time - self.timestamp) char tmp[] = {(char) ('a' + (int) (self.movedir[0] + (GameBase.level.time - self.timestamp)
@@ -749,7 +749,7 @@ public class GameTarget {
}; };
static EntUseAdapter target_lightramp_use = new EntUseAdapter() { static EntUseAdapter target_lightramp_use = new EntUseAdapter() {
public String getID() { return "target_lightramp_use"; } public String getID() { return "target_lightramp_use"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
if (self.enemy == null) { if (self.enemy == null) {
edict_t e; edict_t e;
@@ -800,7 +800,7 @@ public class GameTarget {
*/ */
static EntThinkAdapter target_earthquake_think = new EntThinkAdapter() { static EntThinkAdapter target_earthquake_think = new EntThinkAdapter() {
public String getID() { return "target_earthquake_think"; } public String getID() { return "target_earthquake_think"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
int i; int i;
@@ -837,7 +837,7 @@ public class GameTarget {
}; };
static EntUseAdapter target_earthquake_use = new EntUseAdapter() { static EntUseAdapter target_earthquake_use = new EntUseAdapter() {
public String getID() { return "target_earthquake_use"; } public String getID() { return "target_earthquake_use"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
self.timestamp = GameBase.level.time + self.count; self.timestamp = GameBase.level.time + self.count;
self.nextthink = GameBase.level.time + Defines.FRAMETIME; self.nextthink = GameBase.level.time + Defines.FRAMETIME;

View File

@@ -233,7 +233,7 @@ public class GameTrigger {
// the wait time has passed, so set back up for another activation // the wait time has passed, so set back up for another activation
public static EntThinkAdapter multi_wait = new EntThinkAdapter() { public static EntThinkAdapter multi_wait = new EntThinkAdapter() {
public String getID(){ return "multi_wait"; } public String getID(){ return "multi_wait"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
ent.nextthink = 0; ent.nextthink = 0;
@@ -242,7 +242,7 @@ public class GameTrigger {
}; };
static EntUseAdapter Use_Multi = new EntUseAdapter() { static EntUseAdapter Use_Multi = new EntUseAdapter() {
public String getID(){ return "Use_Multi"; } public String getID(){ return "Use_Multi"; }
public void use(edict_t ent, edict_t other, edict_t activator) { public void use(edict_t ent, edict_t other, edict_t activator) {
ent.activator = activator; ent.activator = activator;
multi_trigger(ent); multi_trigger(ent);
@@ -250,7 +250,7 @@ public class GameTrigger {
}; };
static EntTouchAdapter Touch_Multi = new EntTouchAdapter() { static EntTouchAdapter Touch_Multi = new EntTouchAdapter() {
public String getID(){ return "Touch_Multi"; } public String getID(){ return "Touch_Multi"; }
public void touch(edict_t self, edict_t other, cplane_t plane, public void touch(edict_t self, edict_t other, cplane_t plane,
csurface_t surf) { csurface_t surf) {
if (other.client != null) { if (other.client != null) {
@@ -283,7 +283,7 @@ public class GameTrigger {
* 1) secret 2) beep beep 3) large switch 4) set "message" to text string * 1) secret 2) beep beep 3) large switch 4) set "message" to text string
*/ */
static EntUseAdapter trigger_enable = new EntUseAdapter() { static EntUseAdapter trigger_enable = new EntUseAdapter() {
public String getID(){ return "trigger_enable"; } public String getID(){ return "trigger_enable"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
self.solid = Defines.SOLID_TRIGGER; self.solid = Defines.SOLID_TRIGGER;
self.use = Use_Multi; self.use = Use_Multi;
@@ -296,7 +296,7 @@ public class GameTrigger {
* trigger cannot be touched, it can only be fired by other events. * trigger cannot be touched, it can only be fired by other events.
*/ */
public static EntUseAdapter trigger_relay_use = new EntUseAdapter() { public static EntUseAdapter trigger_relay_use = new EntUseAdapter() {
public String getID(){ return "trigger_relay_use"; } public String getID(){ return "trigger_relay_use"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
GameUtil.G_UseTargets(self, activator); GameUtil.G_UseTargets(self, activator);
} }
@@ -317,7 +317,7 @@ public class GameTrigger {
*/ */
static EntUseAdapter trigger_key_use = new EntUseAdapter() { static EntUseAdapter trigger_key_use = new EntUseAdapter() {
public String getID(){ return "trigger_key_use"; } public String getID(){ return "trigger_key_use"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
int index; int index;
@@ -334,7 +334,7 @@ public class GameTrigger {
GameBase.gi.centerprintf(activator, "You need the " GameBase.gi.centerprintf(activator, "You need the "
+ self.item.pickup_name); + self.item.pickup_name);
GameBase.gi.sound(activator, Defines.CHAN_AUTO, GameBase.gi.sound(activator, Defines.CHAN_AUTO,
GameBase.gi.soundindex("misc/keytry.wav"), 1, GameBase.gi.soundindex("misc/keytry.wav"), 1,
Defines.ATTN_NORM, 0); Defines.ATTN_NORM, 0);
return; return;
} }
@@ -393,7 +393,7 @@ public class GameTrigger {
* fire all of it's targets and remove itself. * fire all of it's targets and remove itself.
*/ */
static EntUseAdapter trigger_counter_use = new EntUseAdapter() { static EntUseAdapter trigger_counter_use = new EntUseAdapter() {
public String getID(){ return "trigger_counter_use"; } public String getID(){ return "trigger_counter_use"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
if (self.count == 0) if (self.count == 0)
@@ -435,7 +435,7 @@ public class GameTrigger {
public static int windsound; public static int windsound;
static EntTouchAdapter trigger_push_touch = new EntTouchAdapter() { static EntTouchAdapter trigger_push_touch = new EntTouchAdapter() {
public String getID(){ return "trigger_push_touch"; } public String getID(){ return "trigger_push_touch"; }
public void touch(edict_t self, edict_t other, cplane_t plane, public void touch(edict_t self, edict_t other, cplane_t plane,
csurface_t surf) { csurface_t surf) {
if (Lib.strcmp(other.classname, "grenade") == 0) { if (Lib.strcmp(other.classname, "grenade") == 0) {
@@ -474,7 +474,7 @@ public class GameTrigger {
* *
*/ */
static EntUseAdapter hurt_use = new EntUseAdapter() { static EntUseAdapter hurt_use = new EntUseAdapter() {
public String getID(){ return "hurt_use"; } public String getID(){ return "hurt_use"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
if (self.solid == Defines.SOLID_NOT) if (self.solid == Defines.SOLID_NOT)
@@ -489,7 +489,7 @@ public class GameTrigger {
}; };
static EntTouchAdapter hurt_touch = new EntTouchAdapter() { static EntTouchAdapter hurt_touch = new EntTouchAdapter() {
public String getID(){ return "hurt_touch"; } public String getID(){ return "hurt_touch"; }
public void touch(edict_t self, edict_t other, cplane_t plane, public void touch(edict_t self, edict_t other, cplane_t plane,
csurface_t surf) { csurface_t surf) {
int dflags; int dflags;
@@ -535,7 +535,7 @@ public class GameTrigger {
*/ */
static EntTouchAdapter trigger_gravity_touch = new EntTouchAdapter() { static EntTouchAdapter trigger_gravity_touch = new EntTouchAdapter() {
public String getID(){ return "trigger_gravity_touch"; } public String getID(){ return "trigger_gravity_touch"; }
public void touch(edict_t self, edict_t other, cplane_t plane, public void touch(edict_t self, edict_t other, cplane_t plane,
csurface_t surf) { csurface_t surf) {
@@ -559,7 +559,7 @@ public class GameTrigger {
*/ */
static EntTouchAdapter trigger_monsterjump_touch = new EntTouchAdapter() { static EntTouchAdapter trigger_monsterjump_touch = new EntTouchAdapter() {
public String getID(){ return "trigger_monsterjump_touch"; } public String getID(){ return "trigger_monsterjump_touch"; }
public void touch(edict_t self, edict_t other, cplane_t plane, public void touch(edict_t self, edict_t other, cplane_t plane,
csurface_t surf) { csurface_t surf) {
if ((other.flags & (Defines.FL_FLY | Defines.FL_SWIM)) != 0) if ((other.flags & (Defines.FL_FLY | Defines.FL_SWIM)) != 0)

View File

@@ -172,7 +172,7 @@ public class GameTurret {
} }
static EntBlockedAdapter turret_blocked = new EntBlockedAdapter() { static EntBlockedAdapter turret_blocked = new EntBlockedAdapter() {
public String getID() { return "turret_blocked"; } public String getID() { return "turret_blocked"; }
public void blocked(edict_t self, edict_t other) { public void blocked(edict_t self, edict_t other) {
edict_t attacker; edict_t attacker;
@@ -189,7 +189,7 @@ public class GameTurret {
}; };
static EntThinkAdapter turret_breach_think = new EntThinkAdapter() { static EntThinkAdapter turret_breach_think = new EntThinkAdapter() {
public String getID() { return "turret_breach_think"; } public String getID() { return "turret_breach_think"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
edict_t ent; edict_t ent;
@@ -274,9 +274,9 @@ public class GameTurret {
angle = self.s.angles[1] + self.owner.move_origin[1]; angle = self.s.angles[1] + self.owner.move_origin[1];
angle *= (Math.PI * 2 / 360); angle *= (Math.PI * 2 / 360);
target[0] = GameTurret.SnapToEights((float) (self.s.origin[0] + target[0] = GameTurret.SnapToEights((float) (self.s.origin[0] +
Math.cos(angle) * self.owner.move_origin[0])); Math.cos(angle) * self.owner.move_origin[0]));
target[1] = GameTurret.SnapToEights((float) (self.s.origin[1] + target[1] = GameTurret.SnapToEights((float) (self.s.origin[1] +
Math.sin(angle) * self.owner.move_origin[0])); Math.sin(angle) * self.owner.move_origin[0]));
target[2] = self.owner.s.origin[2]; target[2] = self.owner.s.origin[2];
Math3D.VectorSubtract(target, self.owner.s.origin, dir); Math3D.VectorSubtract(target, self.owner.s.origin, dir);
@@ -301,7 +301,7 @@ public class GameTurret {
}; };
static EntThinkAdapter turret_breach_finish_init = new EntThinkAdapter() { static EntThinkAdapter turret_breach_finish_init = new EntThinkAdapter() {
public String getID() { return "turret_breach_finish_init"; } public String getID() { return "turret_breach_finish_init"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
// get and save info for muzzle location // get and save info for muzzle location
@@ -328,7 +328,7 @@ public class GameTurret {
* turret_breach. * turret_breach.
*/ */
static EntDieAdapter turret_driver_die = new EntDieAdapter() { static EntDieAdapter turret_driver_die = new EntDieAdapter() {
public String getID() { return "turret_driver_die"; } public String getID() { return "turret_driver_die"; }
public void die(edict_t self, edict_t inflictor, edict_t attacker, public void die(edict_t self, edict_t inflictor, edict_t attacker,
int damage, float[] point) { int damage, float[] point) {
@@ -352,7 +352,7 @@ public class GameTurret {
}; };
static EntThinkAdapter turret_driver_think = new EntThinkAdapter() { static EntThinkAdapter turret_driver_think = new EntThinkAdapter() {
public String getID() { return "turret_driver_think"; } public String getID() { return "turret_driver_think"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] target = { 0, 0, 0 }; float[] target = { 0, 0, 0 };
@@ -405,7 +405,7 @@ public class GameTurret {
}; };
public static EntThinkAdapter turret_driver_link = new EntThinkAdapter() { public static EntThinkAdapter turret_driver_link = new EntThinkAdapter() {
public String getID() { return "turret_driver_link"; } public String getID() { return "turret_driver_link"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] vec = { 0, 0, 0 }; float[] vec = { 0, 0, 0 };

View File

@@ -542,7 +542,7 @@ public class GameUtil {
} }
public static EntThinkAdapter Think_Delay = new EntThinkAdapter() { public static EntThinkAdapter Think_Delay = new EntThinkAdapter() {
public String getID() { return "Think_Delay"; } public String getID() { return "Think_Delay"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
G_UseTargets(ent, ent.activator); G_UseTargets(ent, ent.activator);
G_FreeEdict(ent); G_FreeEdict(ent);
@@ -551,7 +551,7 @@ public class GameUtil {
}; };
public static EntThinkAdapter G_FreeEdictA = new EntThinkAdapter() { public static EntThinkAdapter G_FreeEdictA = new EntThinkAdapter() {
public String getID() { return "G_FreeEdictA"; } public String getID() { return "G_FreeEdictA"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
G_FreeEdict(ent); G_FreeEdict(ent);
return false; return false;
@@ -559,7 +559,7 @@ public class GameUtil {
}; };
static EntThinkAdapter MegaHealth_think = new EntThinkAdapter() { static EntThinkAdapter MegaHealth_think = new EntThinkAdapter() {
public String getID() { return "MegaHealth_think"; } public String getID() { return "MegaHealth_think"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
if (self.owner.health > self.owner.max_health) { if (self.owner.health > self.owner.max_health) {
self.nextthink = GameBase.level.time + 1; self.nextthink = GameBase.level.time + 1;
@@ -579,7 +579,7 @@ public class GameUtil {
public static EntThinkAdapter M_CheckAttack = new EntThinkAdapter() { public static EntThinkAdapter M_CheckAttack = new EntThinkAdapter() {
public String getID() { return "M_CheckAttack"; } public String getID() { return "M_CheckAttack"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] spot1 = { 0, 0, 0 }; float[] spot1 = { 0, 0, 0 };
@@ -665,7 +665,7 @@ public class GameUtil {
}; };
static EntUseAdapter monster_use = new EntUseAdapter() { static EntUseAdapter monster_use = new EntUseAdapter() {
public String getID() { return "monster_use"; } public String getID() { return "monster_use"; }
public void use(edict_t self, edict_t other, edict_t activator) { public void use(edict_t self, edict_t other, edict_t activator) {
if (self.enemy != null) if (self.enemy != null)
return; return;

View File

@@ -26,7 +26,7 @@ import lwjake2.util.Math3D;
public class GameWeapon { public class GameWeapon {
static EntTouchAdapter blaster_touch = new EntTouchAdapter() { static EntTouchAdapter blaster_touch = new EntTouchAdapter() {
public String getID() { return "blaster_touch"; } public String getID() { return "blaster_touch"; }
public void touch(edict_t self, edict_t other, cplane_t plane, public void touch(edict_t self, edict_t other, cplane_t plane,
csurface_t surf) { csurface_t surf) {
@@ -77,7 +77,7 @@ public class GameWeapon {
}; };
static EntThinkAdapter Grenade_Explode = new EntThinkAdapter() { static EntThinkAdapter Grenade_Explode = new EntThinkAdapter() {
public String getID() { return "Grenade_Explode"; } public String getID() { return "Grenade_Explode"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
float[] origin = { 0, 0, 0 }; float[] origin = { 0, 0, 0 };
int mod; int mod;
@@ -137,7 +137,7 @@ public class GameWeapon {
} }
}; };
static EntTouchAdapter Grenade_Touch = new EntTouchAdapter() { static EntTouchAdapter Grenade_Touch = new EntTouchAdapter() {
public String getID() { return "Grenade_Touch"; } public String getID() { return "Grenade_Touch"; }
public void touch(edict_t ent, edict_t other, cplane_t plane, public void touch(edict_t ent, edict_t other, cplane_t plane,
csurface_t surf) { csurface_t surf) {
if (other == ent.owner) if (other == ent.owner)
@@ -177,7 +177,7 @@ public class GameWeapon {
* ================= * =================
*/ */
static EntTouchAdapter rocket_touch = new EntTouchAdapter() { static EntTouchAdapter rocket_touch = new EntTouchAdapter() {
public String getID() { return "rocket_touch"; } public String getID() { return "rocket_touch"; }
public void touch(edict_t ent, edict_t other, cplane_t plane, public void touch(edict_t ent, edict_t other, cplane_t plane,
csurface_t surf) { csurface_t surf) {
float[] origin = { 0, 0, 0 }; float[] origin = { 0, 0, 0 };
@@ -238,7 +238,7 @@ public class GameWeapon {
* ================= * =================
*/ */
static EntThinkAdapter bfg_explode = new EntThinkAdapter() { static EntThinkAdapter bfg_explode = new EntThinkAdapter() {
public String getID() { return "bfg_explode"; } public String getID() { return "bfg_explode"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
edict_t ent; edict_t ent;
float points; float points;
@@ -291,7 +291,7 @@ public class GameWeapon {
}; };
static EntTouchAdapter bfg_touch = new EntTouchAdapter() { static EntTouchAdapter bfg_touch = new EntTouchAdapter() {
public String getID() { return "bfg_touch"; } public String getID() { return "bfg_touch"; }
public void touch(edict_t self, edict_t other, cplane_t plane, public void touch(edict_t self, edict_t other, cplane_t plane,
csurface_t surf) { csurface_t surf) {
if (other == self.owner) if (other == self.owner)
@@ -338,7 +338,7 @@ public class GameWeapon {
}; };
static EntThinkAdapter bfg_think = new EntThinkAdapter() { static EntThinkAdapter bfg_think = new EntThinkAdapter() {
public String getID() { return "bfg_think"; } public String getID() { return "bfg_think"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
edict_t ent; edict_t ent;
edict_t ignore; edict_t ignore;

View File

@@ -25,9 +25,9 @@ import java.util.StringTokenizer;
public class Info { public class Info {
/** /**
* Returns a value for a key from an info string. * Returns a value for a key from an info string.
*/ */
public static String Info_ValueForKey(String s, String key) { public static String Info_ValueForKey(String s, String key) {
StringTokenizer tk = new StringTokenizer(s, "\\"); StringTokenizer tk = new StringTokenizer(s, "\\");

View File

@@ -19,6 +19,6 @@
package lwjake2.game; package lwjake2.game;
public abstract class ItemDropAdapter extends SuperAdapter { public abstract class ItemDropAdapter extends SuperAdapter {
public void drop(edict_t ent, gitem_t item) { public void drop(edict_t ent, gitem_t item) {
} }
} }

View File

@@ -19,6 +19,6 @@
package lwjake2.game; package lwjake2.game;
public abstract class ItemUseAdapter extends SuperAdapter { public abstract class ItemUseAdapter extends SuperAdapter {
public void use(edict_t ent, gitem_t item) { public void use(edict_t ent, gitem_t item) {
} }
} }

View File

@@ -27,9 +27,9 @@ import lwjake2.util.Math3D;
public class Monster { public class Monster {
// FIXME monsters should call these with a totally accurate direction // FIXME monsters should call these with a totally accurate direction
// and we can mess it up based on skill. Spread should be for normal // and we can mess it up based on skill. Spread should be for normal
// and we can tighten or loosen based on skill. We could muck with // and we can tighten or loosen based on skill. We could muck with
// the damages too, but I'm not sure that's such a good idea. // the damages too, but I'm not sure that's such a good idea.
public static void monster_fire_bullet(edict_t self, float[] start, public static void monster_fire_bullet(edict_t self, float[] start,
float[] dir, int damage, int kick, int hspread, int vspread, float[] dir, int damage, int kick, int hspread, int vspread,
int flashtype) { int flashtype) {
@@ -148,7 +148,7 @@ public class Monster {
&& 0 == (self.monsterinfo.aiflags & Defines.AI_GOOD_GUY)) { && 0 == (self.monsterinfo.aiflags & Defines.AI_GOOD_GUY)) {
self.spawnflags &= ~4; self.spawnflags &= ~4;
self.spawnflags |= 1; self.spawnflags |= 1;
// gi.dprintf("fixed spawnflags on %s at %s\n", self.classname, // gi.dprintf("fixed spawnflags on %s at %s\n", self.classname,
// vtos(self.s.origin)); // vtos(self.s.origin));
} }
@@ -328,7 +328,7 @@ public class Monster {
} }
}; };
// we have a one frame delay here so we don't telefrag the guy who activated // we have a one frame delay here so we don't telefrag the guy who activated
// us // us
public static EntUseAdapter monster_triggered_spawn_use = new EntUseAdapter() { public static EntUseAdapter monster_triggered_spawn_use = new EntUseAdapter() {
public String getID() { return "monster_trigger_spawn_use";} public String getID() { return "monster_trigger_spawn_use";}

View File

@@ -31,7 +31,7 @@ public class PlayerClient {
* player_die. * player_die.
*/ */
static EntDieAdapter player_die = new EntDieAdapter() { static EntDieAdapter player_die = new EntDieAdapter() {
public String getID() { return "player_die"; } public String getID() { return "player_die"; }
public void die(edict_t self, edict_t inflictor, edict_t attacker, public void die(edict_t self, edict_t inflictor, edict_t attacker,
int damage, float[] point) { int damage, float[] point) {
int n; int n;
@@ -129,7 +129,7 @@ public class PlayerClient {
} }
}; };
static EntThinkAdapter SP_FixCoopSpots = new EntThinkAdapter() { static EntThinkAdapter SP_FixCoopSpots = new EntThinkAdapter() {
public String getID() { return "SP_FixCoopSpots"; } public String getID() { return "SP_FixCoopSpots"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
edict_t spot; edict_t spot;
@@ -165,7 +165,7 @@ public class PlayerClient {
} }
}; };
static EntThinkAdapter SP_CreateCoopSpots = new EntThinkAdapter() { static EntThinkAdapter SP_CreateCoopSpots = new EntThinkAdapter() {
public String getID() { return "SP_CreateCoopSpots"; } public String getID() { return "SP_CreateCoopSpots"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
edict_t spot; edict_t spot;
@@ -200,12 +200,12 @@ public class PlayerClient {
}; };
// player pain is handled at the end of the frame in P_DamageFeedback // player pain is handled at the end of the frame in P_DamageFeedback
static EntPainAdapter player_pain = new EntPainAdapter() { static EntPainAdapter player_pain = new EntPainAdapter() {
public String getID() { return "player_pain"; } public String getID() { return "player_pain"; }
public void pain(edict_t self, edict_t other, float kick, int damage) { public void pain(edict_t self, edict_t other, float kick, int damage) {
} }
}; };
static EntDieAdapter body_die = new EntDieAdapter() { static EntDieAdapter body_die = new EntDieAdapter() {
public String getID() { return "body_die"; } public String getID() { return "body_die"; }
public void die(edict_t self, edict_t inflictor, edict_t attacker, public void die(edict_t self, edict_t inflictor, edict_t attacker,
int damage, float[] point) { int damage, float[] point) {
@@ -213,7 +213,7 @@ public class PlayerClient {
if (self.health < -40) { if (self.health < -40) {
GameBase.gi.sound(self, Defines.CHAN_BODY, GameBase.gi.sound(self, Defines.CHAN_BODY,
GameBase.gi.soundindex("misc/udeath.wav"), 1, Defines.ATTN_NORM, 0); GameBase.gi.soundindex("misc/udeath.wav"), 1, Defines.ATTN_NORM, 0);
for (n = 0; n < 4; n++) for (n = 0; n < 4; n++)
GameMisc.ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, GameMisc.ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage,
Defines.GIB_ORGANIC); Defines.GIB_ORGANIC);
@@ -658,7 +658,7 @@ public class PlayerClient {
} }
/** /**
* If turned on in the dmflags, select a spawn point far away from other players. * If turned on in the dmflags, select a spawn point far away from other players.
*/ */
static edict_t SelectFarthestDeathmatchSpawnPoint() { static edict_t SelectFarthestDeathmatchSpawnPoint() {
edict_t bestspot; edict_t bestspot;
@@ -1370,19 +1370,19 @@ public class PlayerClient {
/* /*
* static int CheckBlock(int c) * static int CheckBlock(int c)
* { * {
* int v, i; * int v, i;
* v = 0; * v = 0;
* for (i = 0; i < c; i++) * for (i = 0; i < c; i++)
* v += ((byte *) b)[i]; * v += ((byte *) b)[i];
* return v; * return v;
* } * }
* *
* public static void PrintPmove(pmove_t * pm) * public static void PrintPmove(pmove_t * pm)
* { * {
* unsigned c1, c2; * unsigned c1, c2;
* *
* c1 = CheckBlock(&pm.s, sizeof(pm.s)); * c1 = CheckBlock(&pm.s, sizeof(pm.s));
* c2 = CheckBlock(&pm.cmd, sizeof(pm.cmd)); * c2 = CheckBlock(&pm.cmd, sizeof(pm.cmd));
* Com_Printf("sv %3i:%i %i\n", pm.cmd.impulse, c1, c2); * Com_Printf("sv %3i:%i %i\n", pm.cmd.impulse, c1, c2);
* } * }
*/ */

View File

@@ -232,7 +232,7 @@ public class PlayerView {
ent.client.ps.viewangles[Defines.PITCH] = -15; ent.client.ps.viewangles[Defines.PITCH] = -15;
ent.client.ps.viewangles[Defines.YAW] = ent.client.killer_yaw; ent.client.ps.viewangles[Defines.YAW] = ent.client.killer_yaw;
} else { } else {
// add angles based on weapon kick // add angles based on weapon kick
Math3D.VectorCopy(ent.client.kick_angles, angles); Math3D.VectorCopy(ent.client.kick_angles, angles);
@@ -353,7 +353,7 @@ public class PlayerView {
// gun height // gun height
Math3D.VectorClear(ent.client.ps.gunoffset); Math3D.VectorClear(ent.client.ps.gunoffset);
// ent.ps.gunorigin[2] += bob; // ent.ps.gunorigin[2] += bob;
// gun_x / gun_y / gun_z are development tools // gun_x / gun_y / gun_z are development tools
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
@@ -411,14 +411,14 @@ public class PlayerView {
remaining = (int) (ent.client.quad_framenum - GameBase.level.framenum); remaining = (int) (ent.client.quad_framenum - GameBase.level.framenum);
if (remaining == 30) // beginning to fade if (remaining == 30) // beginning to fade
GameBase.gi.sound(ent, Defines.CHAN_ITEM, GameBase.gi.sound(ent, Defines.CHAN_ITEM,
GameBase.gi.soundindex("items/damage2.wav"), 1, Defines.ATTN_NORM, 0); GameBase.gi.soundindex("items/damage2.wav"), 1, Defines.ATTN_NORM, 0);
if (remaining > 30 || (remaining & 4) != 0) if (remaining > 30 || (remaining & 4) != 0)
SV_AddBlend(0, 0, 1, 0.08f, ent.client.ps.blend); SV_AddBlend(0, 0, 1, 0.08f, ent.client.ps.blend);
} else if (ent.client.invincible_framenum > GameBase.level.framenum) { } else if (ent.client.invincible_framenum > GameBase.level.framenum) {
remaining = (int) ent.client.invincible_framenum - GameBase.level.framenum; remaining = (int) ent.client.invincible_framenum - GameBase.level.framenum;
if (remaining == 30) // beginning to fade if (remaining == 30) // beginning to fade
GameBase.gi.sound(ent, Defines.CHAN_ITEM, GameBase.gi.sound(ent, Defines.CHAN_ITEM,
GameBase.gi.soundindex("items/protect2.wav"), 1, Defines.ATTN_NORM, 0); GameBase.gi.soundindex("items/protect2.wav"), 1, Defines.ATTN_NORM, 0);
if (remaining > 30 || (remaining & 4) != 0) if (remaining > 30 || (remaining & 4) != 0)
SV_AddBlend(1, 1, 0, 0.08f, ent.client.ps.blend); SV_AddBlend(1, 1, 0, 0.08f, ent.client.ps.blend);
} else if (ent.client.enviro_framenum > GameBase.level.framenum) { } else if (ent.client.enviro_framenum > GameBase.level.framenum) {
@@ -426,7 +426,7 @@ public class PlayerView {
- GameBase.level.framenum; - GameBase.level.framenum;
if (remaining == 30) // beginning to fade if (remaining == 30) // beginning to fade
GameBase.gi.sound(ent, Defines.CHAN_ITEM, GameBase.gi.sound(ent, Defines.CHAN_ITEM,
GameBase.gi.soundindex("items/airout.wav"), 1, Defines.ATTN_NORM, 0); GameBase.gi.soundindex("items/airout.wav"), 1, Defines.ATTN_NORM, 0);
if (remaining > 30 || (remaining & 4) != 0) if (remaining > 30 || (remaining & 4) != 0)
SV_AddBlend(0, 1, 0, 0.08f, ent.client.ps.blend); SV_AddBlend(0, 1, 0, 0.08f, ent.client.ps.blend);
} else if (ent.client.breather_framenum > GameBase.level.framenum) { } else if (ent.client.breather_framenum > GameBase.level.framenum) {

View File

@@ -27,7 +27,7 @@ import lwjake2.util.Math3D;
public class PlayerWeapon { public class PlayerWeapon {
public static EntThinkAdapter Weapon_Grenade = new EntThinkAdapter() { public static EntThinkAdapter Weapon_Grenade = new EntThinkAdapter() {
public String getID() { return "Weapon_Grenade"; } public String getID() { return "Weapon_Grenade"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
if ((ent.client.newweapon != null) if ((ent.client.newweapon != null)
@@ -139,7 +139,7 @@ public class PlayerWeapon {
*/ */
public static EntThinkAdapter weapon_grenadelauncher_fire = new EntThinkAdapter() { public static EntThinkAdapter weapon_grenadelauncher_fire = new EntThinkAdapter() {
public String getID() { return "weapon_grenadelauncher_fire"; } public String getID() { return "weapon_grenadelauncher_fire"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
float[] offset = { 0, 0, 0 }; float[] offset = { 0, 0, 0 };
@@ -179,7 +179,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Weapon_GrenadeLauncher = new EntThinkAdapter() { public static EntThinkAdapter Weapon_GrenadeLauncher = new EntThinkAdapter() {
public String getID() { return "Weapon_GrenadeLauncher"; } public String getID() { return "Weapon_GrenadeLauncher"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
@@ -201,7 +201,7 @@ public class PlayerWeapon {
*/ */
public static EntThinkAdapter Weapon_RocketLauncher_Fire = new EntThinkAdapter() { public static EntThinkAdapter Weapon_RocketLauncher_Fire = new EntThinkAdapter() {
public String getID() { return "Weapon_RocketLauncher_Fire"; } public String getID() { return "Weapon_RocketLauncher_Fire"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
@@ -249,7 +249,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Weapon_RocketLauncher = new EntThinkAdapter() { public static EntThinkAdapter Weapon_RocketLauncher = new EntThinkAdapter() {
public String getID() { return "Weapon_RocketLauncher"; } public String getID() { return "Weapon_RocketLauncher"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
@@ -263,7 +263,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Weapon_Blaster_Fire = new EntThinkAdapter() { public static EntThinkAdapter Weapon_Blaster_Fire = new EntThinkAdapter() {
public String getID() { return "Weapon_Blaster_Fire"; } public String getID() { return "Weapon_Blaster_Fire"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
@@ -281,7 +281,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Weapon_Blaster = new EntThinkAdapter() { public static EntThinkAdapter Weapon_Blaster = new EntThinkAdapter() {
public String getID() { return "Weapon_Blaster"; } public String getID() { return "Weapon_Blaster"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
@@ -295,7 +295,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Weapon_HyperBlaster_Fire = new EntThinkAdapter() { public static EntThinkAdapter Weapon_HyperBlaster_Fire = new EntThinkAdapter() {
public String getID() { return "Weapon_HyperBlaster_Fire"; } public String getID() { return "Weapon_HyperBlaster_Fire"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
float rotation; float rotation;
@@ -366,7 +366,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Weapon_HyperBlaster = new EntThinkAdapter() { public static EntThinkAdapter Weapon_HyperBlaster = new EntThinkAdapter() {
public String getID() { return "Weapon_HyperBlaster"; } public String getID() { return "Weapon_HyperBlaster"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
int pause_frames[] = { 0 }; int pause_frames[] = { 0 };
@@ -379,7 +379,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Weapon_Machinegun = new EntThinkAdapter() { public static EntThinkAdapter Weapon_Machinegun = new EntThinkAdapter() {
public String getID() { return "Weapon_Machinegun"; } public String getID() { return "Weapon_Machinegun"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
int pause_frames[] = { 23, 45, 0 }; int pause_frames[] = { 23, 45, 0 };
@@ -392,7 +392,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Weapon_Chaingun = new EntThinkAdapter() { public static EntThinkAdapter Weapon_Chaingun = new EntThinkAdapter() {
public String getID() { return "Weapon_Chaingun"; } public String getID() { return "Weapon_Chaingun"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
int pause_frames[] = { 38, 43, 51, 61, 0 }; int pause_frames[] = { 38, 43, 51, 61, 0 };
@@ -414,7 +414,7 @@ public class PlayerWeapon {
*/ */
public static EntThinkAdapter weapon_shotgun_fire = new EntThinkAdapter() { public static EntThinkAdapter weapon_shotgun_fire = new EntThinkAdapter() {
public String getID() { return "weapon_shotgun_fire"; } public String getID() { return "weapon_shotgun_fire"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
@@ -469,7 +469,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Weapon_Shotgun = new EntThinkAdapter() { public static EntThinkAdapter Weapon_Shotgun = new EntThinkAdapter() {
public String getID() { return "Weapon_Shotgun"; } public String getID() { return "Weapon_Shotgun"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
int pause_frames[] = { 22, 28, 34, 0 }; int pause_frames[] = { 22, 28, 34, 0 };
int fire_frames[] = { 8, 9, 0 }; int fire_frames[] = { 8, 9, 0 };
@@ -481,7 +481,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter weapon_supershotgun_fire = new EntThinkAdapter() { public static EntThinkAdapter weapon_supershotgun_fire = new EntThinkAdapter() {
public String getID() { return "weapon_supershotgun_fire"; } public String getID() { return "weapon_supershotgun_fire"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
@@ -539,7 +539,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Weapon_SuperShotgun = new EntThinkAdapter() { public static EntThinkAdapter Weapon_SuperShotgun = new EntThinkAdapter() {
public String getID() { return "Weapon_SuperShotgun"; } public String getID() { return "Weapon_SuperShotgun"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
int pause_frames[] = { 29, 42, 57, 0 }; int pause_frames[] = { 29, 42, 57, 0 };
@@ -559,7 +559,7 @@ public class PlayerWeapon {
* ====================================================================== * ======================================================================
*/ */
public static EntThinkAdapter weapon_railgun_fire = new EntThinkAdapter() { public static EntThinkAdapter weapon_railgun_fire = new EntThinkAdapter() {
public String getID() { return "weapon_railgun_fire"; } public String getID() { return "weapon_railgun_fire"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
@@ -611,7 +611,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Weapon_Railgun = new EntThinkAdapter() { public static EntThinkAdapter Weapon_Railgun = new EntThinkAdapter() {
public String getID() { return "Weapon_Railgun"; } public String getID() { return "Weapon_Railgun"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
@@ -632,7 +632,7 @@ public class PlayerWeapon {
*/ */
public static EntThinkAdapter weapon_bfg_fire = new EntThinkAdapter() { public static EntThinkAdapter weapon_bfg_fire = new EntThinkAdapter() {
public String getID() { return "weapon_bfg_fire"; } public String getID() { return "weapon_bfg_fire"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
@@ -696,7 +696,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Weapon_BFG = new EntThinkAdapter() { public static EntThinkAdapter Weapon_BFG = new EntThinkAdapter() {
public String getID() { return "Weapon_BFG"; } public String getID() { return "Weapon_BFG"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
Weapon_Generic(ent, 8, 32, 55, 58, pause_frames, fire_frames, Weapon_Generic(ent, 8, 32, 55, 58, pause_frames, fire_frames,
@@ -718,7 +718,7 @@ public class PlayerWeapon {
* ================ * ================
*/ */
public static ItemUseAdapter Use_Weapon = new ItemUseAdapter() { public static ItemUseAdapter Use_Weapon = new ItemUseAdapter() {
public String getID() { return "Use_Weapon"; } public String getID() { return "Use_Weapon"; }
public void use(edict_t ent, gitem_t item) { public void use(edict_t ent, gitem_t item) {
int ammo_index; int ammo_index;
@@ -761,7 +761,7 @@ public class PlayerWeapon {
*/ */
public static ItemDropAdapter Drop_Weapon = new ItemDropAdapter() { public static ItemDropAdapter Drop_Weapon = new ItemDropAdapter() {
public String getID() { return "Drop_Weapon"; } public String getID() { return "Drop_Weapon"; }
public void drop(edict_t ent, gitem_t item) { public void drop(edict_t ent, gitem_t item) {
int index; int index;
@@ -791,7 +791,7 @@ public class PlayerWeapon {
*/ */
public static EntThinkAdapter Machinegun_Fire = new EntThinkAdapter() { public static EntThinkAdapter Machinegun_Fire = new EntThinkAdapter() {
public String getID() { return "Machinegun_Fire"; } public String getID() { return "Machinegun_Fire"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
@@ -883,7 +883,7 @@ public class PlayerWeapon {
}; };
public static EntThinkAdapter Chaingun_Fire = new EntThinkAdapter() { public static EntThinkAdapter Chaingun_Fire = new EntThinkAdapter() {
public String getID() { return "Chaingun_Fire"; } public String getID() { return "Chaingun_Fire"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
@@ -1010,7 +1010,7 @@ public class PlayerWeapon {
public static int fire_frames[] = { 9, 17, 0 }; public static int fire_frames[] = { 9, 17, 0 };
public static EntInteractAdapter Pickup_Weapon = new EntInteractAdapter() { public static EntInteractAdapter Pickup_Weapon = new EntInteractAdapter() {
public String getID() { return "Pickup_Weapon"; } public String getID() { return "Pickup_Weapon"; }
public boolean interact(edict_t ent, edict_t other) { public boolean interact(edict_t ent, edict_t other) {
int index; int index;
gitem_t ammo; gitem_t ammo;

View File

@@ -24,31 +24,31 @@ import java.util.Hashtable;
public abstract class SuperAdapter { public abstract class SuperAdapter {
/** Constructor, does the adapter registration. */ /** Constructor, does the adapter registration. */
public SuperAdapter() { public SuperAdapter() {
register(this, getID()); register(this, getID());
} }
/** Adapter registration. */ /** Adapter registration. */
private static void register(SuperAdapter sa, String id) { private static void register(SuperAdapter sa, String id) {
adapters.put(id, sa); adapters.put(id, sa);
} }
/** Adapter repository. */ /** Adapter repository. */
private static Hashtable<String, SuperAdapter> adapters= new Hashtable<String, SuperAdapter>(); private static Hashtable<String, SuperAdapter> adapters= new Hashtable<String, SuperAdapter>();
/** Returns the adapter from the repository given by its ID. */ /** Returns the adapter from the repository given by its ID. */
public static SuperAdapter getFromID(String key) { public static SuperAdapter getFromID(String key) {
SuperAdapter sa= (SuperAdapter) adapters.get(key); SuperAdapter sa= (SuperAdapter) adapters.get(key);
// try to create the adapter // try to create the adapter
if (sa == null) { if (sa == null) {
Com.DPrintf("SuperAdapter.getFromID():adapter not found->" + key + "\n"); Com.DPrintf("SuperAdapter.getFromID():adapter not found->" + key + "\n");
} }
return sa; return sa;
} }
/** Returns the Adapter-ID. */ /** Returns the Adapter-ID. */
public abstract String getID(); public abstract String getID();
} }

View File

@@ -25,132 +25,132 @@ import java.io.IOException;
public class client_persistant_t { public class client_persistant_t {
public void set(client_persistant_t from) { public void set(client_persistant_t from) {
userinfo= from.userinfo; userinfo= from.userinfo;
netname= from.netname; netname= from.netname;
hand= from.hand; hand= from.hand;
connected= from.connected; connected= from.connected;
health= from.health; health= from.health;
max_health= from.max_health; max_health= from.max_health;
savedFlags= from.savedFlags; savedFlags= from.savedFlags;
selected_item= from.selected_item; selected_item= from.selected_item;
System.arraycopy(from.inventory, 0, inventory, 0, inventory.length); System.arraycopy(from.inventory, 0, inventory, 0, inventory.length);
max_bullets= from.max_bullets; max_bullets= from.max_bullets;
max_shells= from.max_shells; max_shells= from.max_shells;
max_rockets= from.max_rockets; max_rockets= from.max_rockets;
max_grenades= from.max_grenades; max_grenades= from.max_grenades;
max_cells= from.max_cells; max_cells= from.max_cells;
max_slugs= from.max_slugs; max_slugs= from.max_slugs;
weapon= from.weapon; weapon= from.weapon;
lastweapon= from.lastweapon; lastweapon= from.lastweapon;
power_cubes= from.power_cubes; power_cubes= from.power_cubes;
score= from.score; score= from.score;
game_helpchanged= from.game_helpchanged; game_helpchanged= from.game_helpchanged;
helpchanged= from.helpchanged; helpchanged= from.helpchanged;
spectator= from.spectator; spectator= from.spectator;
} }
// client data that stays across multiple level loads // client data that stays across multiple level loads
String userinfo= ""; String userinfo= "";
String netname= ""; String netname= "";
int hand; int hand;
boolean connected; // a loadgame will leave valid entities that boolean connected; // a loadgame will leave valid entities that
// just don't have a connection yet // just don't have a connection yet
// values saved and restored from edicts when changing levels // values saved and restored from edicts when changing levels
int health; int health;
int max_health; int max_health;
int savedFlags; int savedFlags;
int selected_item; int selected_item;
int inventory[]= new int[Defines.MAX_ITEMS]; int inventory[]= new int[Defines.MAX_ITEMS];
// ammo capacities // ammo capacities
public int max_bullets; public int max_bullets;
public int max_shells; public int max_shells;
public int max_rockets; public int max_rockets;
public int max_grenades; public int max_grenades;
public int max_cells; public int max_cells;
public int max_slugs; public int max_slugs;
//pointer //pointer
gitem_t weapon; gitem_t weapon;
//pointer //pointer
gitem_t lastweapon; gitem_t lastweapon;
int power_cubes; // used for tracking the cubes in coop games int power_cubes; // used for tracking the cubes in coop games
int score; // for calculating total unit score in coop games int score; // for calculating total unit score in coop games
int game_helpchanged; int game_helpchanged;
int helpchanged; int helpchanged;
boolean spectator; // client is a spectator boolean spectator; // client is a spectator
/** Reads a client_persistant structure from a file. */ /** Reads a client_persistant structure from a file. */
public void read(QuakeFile f) throws IOException { public void read(QuakeFile f) throws IOException {
userinfo= f.readString(); userinfo= f.readString();
netname= f.readString(); netname= f.readString();
hand= f.readInt(); hand= f.readInt();
connected= f.readInt() != 0; connected= f.readInt() != 0;
health= f.readInt(); health= f.readInt();
max_health= f.readInt(); max_health= f.readInt();
savedFlags= f.readInt(); savedFlags= f.readInt();
selected_item= f.readInt(); selected_item= f.readInt();
for (int n= 0; n < Defines.MAX_ITEMS; n++) for (int n= 0; n < Defines.MAX_ITEMS; n++)
inventory[n]= f.readInt(); inventory[n]= f.readInt();
max_bullets= f.readInt(); max_bullets= f.readInt();
max_shells= f.readInt(); max_shells= f.readInt();
max_rockets= f.readInt(); max_rockets= f.readInt();
max_grenades= f.readInt(); max_grenades= f.readInt();
max_cells= f.readInt(); max_cells= f.readInt();
max_slugs= f.readInt(); max_slugs= f.readInt();
weapon= f.readItem(); weapon= f.readItem();
lastweapon= f.readItem(); lastweapon= f.readItem();
power_cubes= f.readInt(); power_cubes= f.readInt();
score= f.readInt(); score= f.readInt();
game_helpchanged= f.readInt(); game_helpchanged= f.readInt();
helpchanged= f.readInt(); helpchanged= f.readInt();
spectator= f.readInt() != 0; spectator= f.readInt() != 0;
} }
/** Writes a client_persistant structure to a file. */ /** Writes a client_persistant structure to a file. */
public void write(QuakeFile f) throws IOException { public void write(QuakeFile f) throws IOException {
// client persistant_t // client persistant_t
f.writeString(userinfo); f.writeString(userinfo);
f.writeString(netname); f.writeString(netname);
f.writeInt(hand); f.writeInt(hand);
f.writeInt(connected ? 1 : 0); f.writeInt(connected ? 1 : 0);
f.writeInt(health); f.writeInt(health);
f.writeInt(max_health); f.writeInt(max_health);
f.writeInt(savedFlags); f.writeInt(savedFlags);
f.writeInt(selected_item); f.writeInt(selected_item);
for (int n= 0; n < Defines.MAX_ITEMS; n++) for (int n= 0; n < Defines.MAX_ITEMS; n++)
f.writeInt(inventory[n]); f.writeInt(inventory[n]);
f.writeInt(max_bullets); f.writeInt(max_bullets);
f.writeInt(max_shells); f.writeInt(max_shells);
f.writeInt(max_rockets); f.writeInt(max_rockets);
f.writeInt(max_grenades); f.writeInt(max_grenades);
f.writeInt(max_cells); f.writeInt(max_cells);
f.writeInt(max_slugs); f.writeInt(max_slugs);
f.writeItem(weapon); f.writeItem(weapon);
f.writeItem(lastweapon); f.writeItem(lastweapon);
f.writeInt(power_cubes); f.writeInt(power_cubes);
f.writeInt(score); f.writeInt(score);
f.writeInt(game_helpchanged); f.writeInt(game_helpchanged);
f.writeInt(helpchanged); f.writeInt(helpchanged);
f.writeInt(spectator ? 1 : 0); f.writeInt(spectator ? 1 : 0);
} }
} }

View File

@@ -26,63 +26,63 @@ import java.io.IOException;
/** Client data that stays across deathmatch respawns. */ /** Client data that stays across deathmatch respawns. */
public class client_respawn_t public class client_respawn_t
{ {
/** What to set client->pers to on a respawn */ /** What to set client->pers to on a respawn */
protected client_persistant_t coop_respawn = new client_persistant_t(); protected client_persistant_t coop_respawn = new client_persistant_t();
/** Level.framenum the client entered the game. */ /** Level.framenum the client entered the game. */
protected int enterframe; protected int enterframe;
/** frags, etc. */ /** frags, etc. */
protected int score; protected int score;
/** angles sent over in the last command. */ /** angles sent over in the last command. */
protected float cmd_angles[] = { 0, 0, 0 }; protected float cmd_angles[] = { 0, 0, 0 };
/** client is a spectator. */ /** client is a spectator. */
protected boolean spectator; protected boolean spectator;
/** Copies the client respawn data. */ /** Copies the client respawn data. */
public void set(client_respawn_t from) public void set(client_respawn_t from)
{ {
coop_respawn.set(from.coop_respawn); coop_respawn.set(from.coop_respawn);
enterframe = from.enterframe; enterframe = from.enterframe;
score = from.score; score = from.score;
Math3D.VectorCopy(from.cmd_angles, cmd_angles); Math3D.VectorCopy(from.cmd_angles, cmd_angles);
spectator = from.spectator; spectator = from.spectator;
} }
/** Clears the client reaspawn informations. */ /** Clears the client reaspawn informations. */
public void clear() public void clear()
{ {
coop_respawn = new client_persistant_t(); coop_respawn = new client_persistant_t();
enterframe = 0; enterframe = 0;
score = 0; score = 0;
Math3D.VectorClear(cmd_angles); Math3D.VectorClear(cmd_angles);
spectator = false; spectator = false;
} }
/** Reads a client_respawn from a file. */ /** Reads a client_respawn from a file. */
public void read(QuakeFile f) throws IOException public void read(QuakeFile f) throws IOException
{ {
coop_respawn.read(f); coop_respawn.read(f);
enterframe = f.readInt(); enterframe = f.readInt();
score = f.readInt(); score = f.readInt();
cmd_angles[0] = f.readFloat(); cmd_angles[0] = f.readFloat();
cmd_angles[1] = f.readFloat(); cmd_angles[1] = f.readFloat();
cmd_angles[2] = f.readFloat(); cmd_angles[2] = f.readFloat();
spectator = f.readInt() != 0; spectator = f.readInt() != 0;
} }
/** Writes a client_respawn to a file. */ /** Writes a client_respawn to a file. */
public void write(QuakeFile f) throws IOException public void write(QuakeFile f) throws IOException
{ {
coop_respawn.write(f); coop_respawn.write(f);
f.writeInt(enterframe); f.writeInt(enterframe);
f.writeInt(score); f.writeInt(score);
f.writeFloat(cmd_angles[0]); f.writeFloat(cmd_angles[0]);
f.writeFloat(cmd_angles[1]); f.writeFloat(cmd_angles[1]);
f.writeFloat(cmd_angles[2]); f.writeFloat(cmd_angles[2]);
f.writeInt(spectator?1:0); f.writeInt(spectator?1:0);
} }
} }

View File

@@ -20,7 +20,7 @@ package lwjake2.game;
public final class cmdalias_t public final class cmdalias_t
{ {
public cmdalias_t next; public cmdalias_t next;
public String name = ""; public String name = "";
public String value; public String value;
} }

View File

@@ -20,8 +20,8 @@ package lwjake2.game;
public class cmodel_t public class cmodel_t
{ {
public float[] mins = { 0, 0, 0 }; public float[] mins = { 0, 0, 0 };
public float[] maxs = { 0, 0, 0 }; public float[] maxs = { 0, 0, 0 };
public float[] origin = { 0, 0, 0 }; // for sounds or lights public float[] origin = { 0, 0, 0 }; // for sounds or lights
public int headnode; public int headnode;
} }

View File

@@ -22,29 +22,29 @@ import lwjake2.util.Math3D;
public class cplane_t public class cplane_t
{ {
public float normal[] = new float[3]; public float normal[] = new float[3];
public float dist; public float dist;
/** This is for fast side tests, 0=xplane, 1=yplane, 2=zplane and 3=arbitrary. */ /** This is for fast side tests, 0=xplane, 1=yplane, 2=zplane and 3=arbitrary. */
public byte type; public byte type;
/** This represents signx + (signy<<1) + (signz << 1). */ /** This represents signx + (signy<<1) + (signz << 1). */
public byte signbits; // signx + (signy<<1) + (signz<<1) public byte signbits; // signx + (signy<<1) + (signz<<1)
public byte pad[] = { 0, 0 }; public byte pad[] = { 0, 0 };
public void set(cplane_t c) { public void set(cplane_t c) {
Math3D.set(normal, c.normal); Math3D.set(normal, c.normal);
dist = c.dist; dist = c.dist;
type = c.type; type = c.type;
signbits = c.signbits; signbits = c.signbits;
pad[0] = c.pad[0]; pad[0] = c.pad[0];
pad[1] = c.pad[1]; pad[1] = c.pad[1];
} }
public void clear() { public void clear() {
Math3D.VectorClear(normal); Math3D.VectorClear(normal);
dist = 0; dist = 0;
type = 0; type = 0;
signbits = 0; signbits = 0;
pad[0] = 0; pad[0] = 0;
pad[1] = 0; pad[1] = 0;
} }
} }

View File

@@ -20,7 +20,7 @@ package lwjake2.game;
public class csurface_t public class csurface_t
{ {
public String name = ""; public String name = "";
public int flags; public int flags;
public int value; public int value;
} }

View File

@@ -23,11 +23,11 @@ package lwjake2.game;
*/ */
public final class cvar_t public final class cvar_t
{ {
public String name; public String name;
public String string; public String string;
public String latched_string; public String latched_string;
public int flags = 0; public int flags = 0;
public boolean modified = false; public boolean modified = false;
public float value = 0.0f; public float value = 0.0f;
public cvar_t next = null; public cvar_t next = null;
} }

View File

@@ -25,140 +25,140 @@ import lwjake2.util.QuakeFile;
public class entity_state_t implements Cloneable public class entity_state_t implements Cloneable
{ {
/** entity_state_t is the information conveyed from the server /** entity_state_t is the information conveyed from the server
in an update message about entities that the client will in an update message about entities that the client will
need to render in some way. */ need to render in some way. */
public entity_state_t(edict_t ent) public entity_state_t(edict_t ent)
{ {
this.surrounding_ent = ent; this.surrounding_ent = ent;
if (ent != null) if (ent != null)
number = ent.index; number = ent.index;
} }
/** edict index. TODO: this is critical. The index has to be proper managed. */ /** edict index. TODO: this is critical. The index has to be proper managed. */
public int number = 0; public int number = 0;
// TODO: why was this introduced? // TODO: why was this introduced?
public edict_t surrounding_ent = null; public edict_t surrounding_ent = null;
public float[] origin = { 0, 0, 0 }; public float[] origin = { 0, 0, 0 };
public float[] angles = { 0, 0, 0 }; public float[] angles = { 0, 0, 0 };
/** for lerping. */ /** for lerping. */
public float[] old_origin = { 0, 0, 0 }; public float[] old_origin = { 0, 0, 0 };
public int modelindex; public int modelindex;
/** weapons, CTF flags, etc. */ /** weapons, CTF flags, etc. */
public int modelindex2, modelindex3, modelindex4; public int modelindex2, modelindex3, modelindex4;
public int frame; public int frame;
public int skinnum; public int skinnum;
/** PGM - we're filling it, so it needs to be unsigned. */ /** PGM - we're filling it, so it needs to be unsigned. */
public int effects; public int effects;
public int renderfx; public int renderfx;
public int solid; public int solid;
// for client side prediction, 8*(bits 0-4) is x/y radius // for client side prediction, 8*(bits 0-4) is x/y radius
// 8*(bits 5-9) is z down distance, 8(bits10-15) is z up // 8*(bits 5-9) is z down distance, 8(bits10-15) is z up
// gi.linkentity sets this properly // gi.linkentity sets this properly
public int sound; // for looping sounds, to guarantee shutoff public int sound; // for looping sounds, to guarantee shutoff
public int event; // impulse events -- muzzle flashes, footsteps, etc public int event; // impulse events -- muzzle flashes, footsteps, etc
// events only go out for a single frame, they // events only go out for a single frame, they
// are automatically cleared each frame // are automatically cleared each frame
/** Writes the entity state to the file. */ /** Writes the entity state to the file. */
public void write(QuakeFile f) throws IOException public void write(QuakeFile f) throws IOException
{ {
f.writeEdictRef(surrounding_ent); f.writeEdictRef(surrounding_ent);
f.writeVector(origin); f.writeVector(origin);
f.writeVector(angles); f.writeVector(angles);
f.writeVector(old_origin); f.writeVector(old_origin);
f.writeInt(modelindex); f.writeInt(modelindex);
f.writeInt(modelindex2); f.writeInt(modelindex2);
f.writeInt(modelindex3); f.writeInt(modelindex3);
f.writeInt(modelindex4); f.writeInt(modelindex4);
f.writeInt(frame); f.writeInt(frame);
f.writeInt(skinnum); f.writeInt(skinnum);
f.writeInt(effects); f.writeInt(effects);
f.writeInt(renderfx); f.writeInt(renderfx);
f.writeInt(solid); f.writeInt(solid);
f.writeInt(sound); f.writeInt(sound);
f.writeInt(event); f.writeInt(event);
} }
/** Reads the entity state from the file. */ /** Reads the entity state from the file. */
public void read(QuakeFile f) throws IOException public void read(QuakeFile f) throws IOException
{ {
surrounding_ent = f.readEdictRef(); surrounding_ent = f.readEdictRef();
origin = f.readVector(); origin = f.readVector();
angles = f.readVector(); angles = f.readVector();
old_origin = f.readVector(); old_origin = f.readVector();
modelindex = f.readInt(); modelindex = f.readInt();
modelindex2= f.readInt(); modelindex2= f.readInt();
modelindex3= f.readInt(); modelindex3= f.readInt();
modelindex4= f.readInt(); modelindex4= f.readInt();
frame = f.readInt(); frame = f.readInt();
skinnum = f.readInt(); skinnum = f.readInt();
effects = f.readInt(); effects = f.readInt();
renderfx = f.readInt(); renderfx = f.readInt();
solid = f.readInt(); solid = f.readInt();
sound = f.readInt(); sound = f.readInt();
event = f.readInt(); event = f.readInt();
} }
public entity_state_t getClone() public entity_state_t getClone()
{ {
entity_state_t out = new entity_state_t(this.surrounding_ent); entity_state_t out = new entity_state_t(this.surrounding_ent);
out.set(this); out.set(this);
return out; return out;
} }
public void set(entity_state_t from) public void set(entity_state_t from)
{ {
number = from.number; number = from.number;
Math3D.VectorCopy(from.origin, origin); Math3D.VectorCopy(from.origin, origin);
Math3D.VectorCopy(from.angles, angles); Math3D.VectorCopy(from.angles, angles);
Math3D.VectorCopy(from.old_origin, old_origin); Math3D.VectorCopy(from.old_origin, old_origin);
modelindex = from.modelindex; modelindex = from.modelindex;
modelindex2 = from.modelindex2; modelindex2 = from.modelindex2;
modelindex3 = from.modelindex3; modelindex3 = from.modelindex3;
modelindex4 = from.modelindex4; modelindex4 = from.modelindex4;
frame = from.frame; frame = from.frame;
skinnum = from.skinnum; skinnum = from.skinnum;
effects = from.effects; effects = from.effects;
renderfx = from.renderfx; renderfx = from.renderfx;
solid = from.solid; solid = from.solid;
sound = from.sound; sound = from.sound;
event = from.event; event = from.event;
} }
public void clear() public void clear()
{ {
//TODO: this is critical. The index has to be proper managed. //TODO: this is critical. The index has to be proper managed.
number = 0; number = 0;
surrounding_ent = null; surrounding_ent = null;
Math3D.VectorClear(origin); Math3D.VectorClear(origin);
Math3D.VectorClear(angles); Math3D.VectorClear(angles);
Math3D.VectorClear(old_origin); Math3D.VectorClear(old_origin);
modelindex = 0; modelindex = 0;
modelindex2 = modelindex3 = modelindex4 = 0; modelindex2 = modelindex3 = modelindex4 = 0;
frame = 0; frame = 0;
skinnum = 0; skinnum = 0;
effects = 0; effects = 0;
renderfx = 0; renderfx = 0;
solid = 0; solid = 0;
sound = 0; sound = 0;
event = 0; event = 0;
} }
} }

View File

@@ -30,7 +30,7 @@ import lwjake2.server.SV_SEND;
import lwjake2.server.SV_WORLD; import lwjake2.server.SV_WORLD;
// //
// collection of functions provided by the main engine // collection of functions provided by the main engine
// //
public class game_import_t { public class game_import_t {
// special messages // special messages

View File

@@ -27,9 +27,9 @@ import java.util.Date;
public class game_locals_t { public class game_locals_t {
// //
// this structure is left intact through an entire game // this structure is left intact through an entire game
// it should be initialized at dll load time, and read/written to // it should be initialized at dll load time, and read/written to
// the server.ssv file for savegames // the server.ssv file for savegames
// //
public String helpmessage1 = ""; public String helpmessage1 = "";

View File

@@ -25,396 +25,396 @@ import java.io.IOException;
@Slf4j @Slf4j
public class gclient_t { public class gclient_t {
public gclient_t(int index) public gclient_t(int index)
{ {
this.index = index; this.index = index;
} }
// this structure is cleared on each PutClientInServer(), // this structure is cleared on each PutClientInServer(),
// except for 'client->pers' // except for 'client->pers'
// known to server // known to server
public player_state_t ps = new player_state_t(); // communicated by server to clients public player_state_t ps = new player_state_t(); // communicated by server to clients
public int ping; public int ping;
// private to game // private to game
public client_persistant_t pers = new client_persistant_t(); public client_persistant_t pers = new client_persistant_t();
public client_respawn_t resp = new client_respawn_t(); public client_respawn_t resp = new client_respawn_t();
public pmove_state_t old_pmove = new pmove_state_t(); // for detecting out-of-pmove changes public pmove_state_t old_pmove = new pmove_state_t(); // for detecting out-of-pmove changes
public boolean showscores; // set layout stat public boolean showscores; // set layout stat
public boolean showinventory; // set layout stat public boolean showinventory; // set layout stat
public boolean showhelp; public boolean showhelp;
public boolean showhelpicon; public boolean showhelpicon;
public int ammo_index; public int ammo_index;
public int buttons; public int buttons;
public int oldbuttons; public int oldbuttons;
public int latched_buttons; public int latched_buttons;
public boolean weapon_thunk; public boolean weapon_thunk;
public gitem_t newweapon; public gitem_t newweapon;
// sum up damage over an entire frame, so // sum up damage over an entire frame, so
// shotgun blasts give a single big kick // shotgun blasts give a single big kick
public int damage_armor; // damage absorbed by armor public int damage_armor; // damage absorbed by armor
public int damage_parmor; // damage absorbed by power armor public int damage_parmor; // damage absorbed by power armor
public int damage_blood; // damage taken out of health public int damage_blood; // damage taken out of health
public int damage_knockback; // impact damage public int damage_knockback; // impact damage
public float[] damage_from = { 0, 0, 0 }; // origin for vector calculation public float[] damage_from = { 0, 0, 0 }; // origin for vector calculation
public float killer_yaw; // when dead, look at killer public float killer_yaw; // when dead, look at killer
public int weaponstate; public int weaponstate;
public float[] kick_angles = { 0, 0, 0 }; // weapon kicks public float[] kick_angles = { 0, 0, 0 }; // weapon kicks
public float[] kick_origin = { 0, 0, 0 }; public float[] kick_origin = { 0, 0, 0 };
public float v_dmg_roll, v_dmg_pitch, v_dmg_time; // damage kicks public float v_dmg_roll, v_dmg_pitch, v_dmg_time; // damage kicks
public float fall_time, fall_value; // for view drop on fall public float fall_time, fall_value; // for view drop on fall
public float damage_alpha; public float damage_alpha;
public float bonus_alpha; public float bonus_alpha;
public float[] damage_blend = { 0, 0, 0 }; public float[] damage_blend = { 0, 0, 0 };
public float[] v_angle = { 0, 0, 0 }; // aiming direction public float[] v_angle = { 0, 0, 0 }; // aiming direction
public float bobtime; // so off-ground doesn't change it public float bobtime; // so off-ground doesn't change it
public float[] oldviewangles = { 0, 0, 0 }; public float[] oldviewangles = { 0, 0, 0 };
public float[] oldvelocity = { 0, 0, 0 }; public float[] oldvelocity = { 0, 0, 0 };
public float next_drown_time; public float next_drown_time;
public int old_waterlevel; public int old_waterlevel;
public int breather_sound; public int breather_sound;
public int machinegun_shots; // for weapon raising public int machinegun_shots; // for weapon raising
// animation vars // animation vars
public int anim_end; public int anim_end;
public int anim_priority; public int anim_priority;
public boolean anim_duck; public boolean anim_duck;
public boolean anim_run; public boolean anim_run;
// powerup timers // powerup timers
public float quad_framenum; public float quad_framenum;
public float invincible_framenum; public float invincible_framenum;
public float breather_framenum; public float breather_framenum;
public float enviro_framenum; public float enviro_framenum;
public boolean grenade_blew_up; public boolean grenade_blew_up;
public float grenade_time; public float grenade_time;
public int silencer_shots; public int silencer_shots;
public int weapon_sound; public int weapon_sound;
public float pickup_msg_time; public float pickup_msg_time;
public float flood_locktill; // locked from talking public float flood_locktill; // locked from talking
public float flood_when[] = new float[10]; // when messages were said public float flood_when[] = new float[10]; // when messages were said
public int flood_whenhead; // head pointer for when said public int flood_whenhead; // head pointer for when said
public float respawn_time; // can respawn when time > this public float respawn_time; // can respawn when time > this
public edict_t chase_target; // player we are chasing public edict_t chase_target; // player we are chasing
public boolean update_chase; // need to update chase info? public boolean update_chase; // need to update chase info?
public int index; public int index;
/** Clears the game client structure. */ /** Clears the game client structure. */
public void clear() public void clear()
{ {
ping =0; ping =0;
pers = new client_persistant_t(); pers = new client_persistant_t();
resp = new client_respawn_t(); resp = new client_respawn_t();
old_pmove = new pmove_state_t(); old_pmove = new pmove_state_t();
showscores = false; // set layout stat showscores = false; // set layout stat
showinventory = false; // set layout stat showinventory = false; // set layout stat
showhelp = false; showhelp = false;
showhelpicon = false; showhelpicon = false;
ammo_index = 0; ammo_index = 0;
buttons = oldbuttons = latched_buttons = 0; buttons = oldbuttons = latched_buttons = 0;
weapon_thunk = false; weapon_thunk = false;
newweapon = null; newweapon = null;
damage_armor = 0; damage_armor = 0;
damage_parmor = 0; damage_parmor = 0;
damage_blood = 0; damage_blood = 0;
damage_knockback = 0; damage_knockback = 0;
killer_yaw = 0; killer_yaw = 0;
damage_from = new float[3]; damage_from = new float[3];
weaponstate = 0; weaponstate = 0;
kick_angles = new float[3]; kick_angles = new float[3];
kick_origin = new float[3]; kick_origin = new float[3];
v_dmg_roll = v_dmg_pitch = v_dmg_time = 0; v_dmg_roll = v_dmg_pitch = v_dmg_time = 0;
fall_time = fall_value = 0; fall_time = fall_value = 0;
damage_alpha = 0; damage_alpha = 0;
bonus_alpha = 0; bonus_alpha = 0;
damage_blend = new float[3]; damage_blend = new float[3];
v_angle = new float[3]; v_angle = new float[3];
bobtime = 0; bobtime = 0;
oldviewangles = new float[3]; oldviewangles = new float[3];
oldvelocity = new float[3]; oldvelocity = new float[3];
next_drown_time = 0; next_drown_time = 0;
old_waterlevel = 0; old_waterlevel = 0;
breather_sound = 0; breather_sound = 0;
machinegun_shots = 0; machinegun_shots = 0;
anim_end = 0; anim_end = 0;
anim_priority = 0; anim_priority = 0;
anim_duck = false; anim_duck = false;
anim_run = false; anim_run = false;
// powerup timers // powerup timers
quad_framenum = 0; quad_framenum = 0;
invincible_framenum = 0; invincible_framenum = 0;
breather_framenum = 0; breather_framenum = 0;
enviro_framenum = 0; enviro_framenum = 0;
grenade_blew_up = false; grenade_blew_up = false;
grenade_time = 0; grenade_time = 0;
silencer_shots = 0; silencer_shots = 0;
weapon_sound = 0; weapon_sound = 0;
pickup_msg_time = 0; pickup_msg_time = 0;
flood_locktill = 0; // locked from talking flood_locktill = 0; // locked from talking
flood_when = new float[10]; // when messages were said flood_when = new float[10]; // when messages were said
flood_whenhead = 0; // head pointer for when said flood_whenhead = 0; // head pointer for when said
respawn_time = 0; // can respawn when time > this respawn_time = 0; // can respawn when time > this
chase_target = null; // player we are chasing chase_target = null; // player we are chasing
update_chase = false; // need to update chase info? update_chase = false; // need to update chase info?
} }
/** Reads a game client from the file. */ /** Reads a game client from the file. */
public void read(QuakeFile f) throws IOException public void read(QuakeFile f) throws IOException
{ {
ps.load(f); ps.load(f);
ping = f.readInt(); ping = f.readInt();
pers.read(f); pers.read(f);
resp.read(f); resp.read(f);
old_pmove.load(f); old_pmove.load(f);
showscores = f.readInt() != 0; showscores = f.readInt() != 0;
showinventory = f.readInt() != 0; showinventory = f.readInt() != 0;
showhelp = f.readInt() != 0; showhelp = f.readInt() != 0;
showhelpicon = f.readInt() != 0; showhelpicon = f.readInt() != 0;
ammo_index = f.readInt(); ammo_index = f.readInt();
buttons = f.readInt(); buttons = f.readInt();
oldbuttons = f.readInt(); oldbuttons = f.readInt();
latched_buttons = f.readInt(); latched_buttons = f.readInt();
weapon_thunk=f.readInt()!=0; weapon_thunk=f.readInt()!=0;
newweapon=f.readItem(); newweapon=f.readItem();
damage_armor = f.readInt(); damage_armor = f.readInt();
damage_parmor = f.readInt(); damage_parmor = f.readInt();
damage_blood = f.readInt(); damage_blood = f.readInt();
damage_knockback = f.readInt(); damage_knockback = f.readInt();
damage_from[0] = f.readFloat(); damage_from[0] = f.readFloat();
damage_from[1] = f.readFloat(); damage_from[1] = f.readFloat();
damage_from[2] = f.readFloat(); damage_from[2] = f.readFloat();
killer_yaw = f.readFloat(); killer_yaw = f.readFloat();
weaponstate = f.readInt(); weaponstate = f.readInt();
kick_angles[0] = f.readFloat(); kick_angles[0] = f.readFloat();
kick_angles[1] = f.readFloat(); kick_angles[1] = f.readFloat();
kick_angles[2] = f.readFloat(); kick_angles[2] = f.readFloat();
kick_origin[0] = f.readFloat(); kick_origin[0] = f.readFloat();
kick_origin[1] = f.readFloat(); kick_origin[1] = f.readFloat();
kick_origin[2] = f.readFloat(); kick_origin[2] = f.readFloat();
v_dmg_roll = f.readFloat(); v_dmg_roll = f.readFloat();
v_dmg_pitch = f.readFloat(); v_dmg_pitch = f.readFloat();
v_dmg_time = f.readFloat(); v_dmg_time = f.readFloat();
fall_time = f.readFloat(); fall_time = f.readFloat();
fall_value = f.readFloat(); fall_value = f.readFloat();
damage_alpha = f.readFloat(); damage_alpha = f.readFloat();
bonus_alpha = f.readFloat(); bonus_alpha = f.readFloat();
damage_blend[0] = f.readFloat(); damage_blend[0] = f.readFloat();
damage_blend[1] = f.readFloat(); damage_blend[1] = f.readFloat();
damage_blend[2] = f.readFloat(); damage_blend[2] = f.readFloat();
v_angle[0] = f.readFloat(); v_angle[0] = f.readFloat();
v_angle[1] = f.readFloat(); v_angle[1] = f.readFloat();
v_angle[2] = f.readFloat(); v_angle[2] = f.readFloat();
bobtime = f.readFloat(); bobtime = f.readFloat();
oldviewangles[0] = f.readFloat(); oldviewangles[0] = f.readFloat();
oldviewangles[1] = f.readFloat(); oldviewangles[1] = f.readFloat();
oldviewangles[2] = f.readFloat(); oldviewangles[2] = f.readFloat();
oldvelocity[0] = f.readFloat(); oldvelocity[0] = f.readFloat();
oldvelocity[1] = f.readFloat(); oldvelocity[1] = f.readFloat();
oldvelocity[2] = f.readFloat(); oldvelocity[2] = f.readFloat();
next_drown_time = f.readFloat(); next_drown_time = f.readFloat();
old_waterlevel = f.readInt(); old_waterlevel = f.readInt();
breather_sound = f.readInt(); breather_sound = f.readInt();
machinegun_shots = f.readInt(); machinegun_shots = f.readInt();
anim_end = f.readInt(); anim_end = f.readInt();
anim_priority = f.readInt(); anim_priority = f.readInt();
anim_duck = f.readInt() != 0; anim_duck = f.readInt() != 0;
anim_run = f.readInt() != 0; anim_run = f.readInt() != 0;
quad_framenum = f.readFloat(); quad_framenum = f.readFloat();
invincible_framenum = f.readFloat(); invincible_framenum = f.readFloat();
breather_framenum = f.readFloat(); breather_framenum = f.readFloat();
enviro_framenum = f.readFloat(); enviro_framenum = f.readFloat();
grenade_blew_up = f.readInt() != 0; grenade_blew_up = f.readInt() != 0;
grenade_time = f.readFloat(); grenade_time = f.readFloat();
silencer_shots = f.readInt(); silencer_shots = f.readInt();
weapon_sound = f.readInt(); weapon_sound = f.readInt();
pickup_msg_time = f.readFloat(); pickup_msg_time = f.readFloat();
flood_locktill = f.readFloat(); flood_locktill = f.readFloat();
flood_when[0] = f.readFloat(); flood_when[0] = f.readFloat();
flood_when[1] = f.readFloat(); flood_when[1] = f.readFloat();
flood_when[2] = f.readFloat(); flood_when[2] = f.readFloat();
flood_when[3] = f.readFloat(); flood_when[3] = f.readFloat();
flood_when[4] = f.readFloat(); flood_when[4] = f.readFloat();
flood_when[5] = f.readFloat(); flood_when[5] = f.readFloat();
flood_when[6] = f.readFloat(); flood_when[6] = f.readFloat();
flood_when[7] = f.readFloat(); flood_when[7] = f.readFloat();
flood_when[8] = f.readFloat(); flood_when[8] = f.readFloat();
flood_when[9] = f.readFloat(); flood_when[9] = f.readFloat();
flood_whenhead = f.readInt(); flood_whenhead = f.readInt();
respawn_time = f.readFloat(); respawn_time = f.readFloat();
chase_target = f.readEdictRef(); chase_target = f.readEdictRef();
update_chase = f.readInt() != 0; update_chase = f.readInt() != 0;
if (f.readInt() != 8765) if (f.readInt() != 8765)
log.error("game client load failed for num={}", index); log.error("game client load failed for num={}", index);
} }
/** Writes a game_client_t (a player) to a file. */ /** Writes a game_client_t (a player) to a file. */
public void write(QuakeFile f) throws IOException public void write(QuakeFile f) throws IOException
{ {
ps.write(f); ps.write(f);
f.writeInt(ping); f.writeInt(ping);
pers.write(f); pers.write(f);
resp.write(f); resp.write(f);
old_pmove.write(f); old_pmove.write(f);
f.writeInt(showscores?1:0); f.writeInt(showscores?1:0);
f.writeInt(showinventory?1:0); f.writeInt(showinventory?1:0);
f.writeInt(showhelp?1:0); f.writeInt(showhelp?1:0);
f.writeInt(showhelpicon?1:0); f.writeInt(showhelpicon?1:0);
f.writeInt(ammo_index); f.writeInt(ammo_index);
f.writeInt(buttons); f.writeInt(buttons);
f.writeInt(oldbuttons); f.writeInt(oldbuttons);
f.writeInt(latched_buttons); f.writeInt(latched_buttons);
f.writeInt(weapon_thunk?1:0); f.writeInt(weapon_thunk?1:0);
f.writeItem(newweapon); f.writeItem(newweapon);
f.writeInt(damage_armor); f.writeInt(damage_armor);
f.writeInt(damage_parmor); f.writeInt(damage_parmor);
f.writeInt(damage_blood); f.writeInt(damage_blood);
f.writeInt(damage_knockback); f.writeInt(damage_knockback);
f.writeFloat(damage_from[0]); f.writeFloat(damage_from[0]);
f.writeFloat(damage_from[1]); f.writeFloat(damage_from[1]);
f.writeFloat(damage_from[2]); f.writeFloat(damage_from[2]);
f.writeFloat(killer_yaw); f.writeFloat(killer_yaw);
f.writeInt(weaponstate); f.writeInt(weaponstate);
f.writeFloat(kick_angles[0]); f.writeFloat(kick_angles[0]);
f.writeFloat(kick_angles[1]); f.writeFloat(kick_angles[1]);
f.writeFloat(kick_angles[2]); f.writeFloat(kick_angles[2]);
f.writeFloat(kick_origin[0]); f.writeFloat(kick_origin[0]);
f.writeFloat(kick_origin[1]); f.writeFloat(kick_origin[1]);
f.writeFloat(kick_origin[2]); f.writeFloat(kick_origin[2]);
f.writeFloat(v_dmg_roll); f.writeFloat(v_dmg_roll);
f.writeFloat(v_dmg_pitch); f.writeFloat(v_dmg_pitch);
f.writeFloat(v_dmg_time); f.writeFloat(v_dmg_time);
f.writeFloat(fall_time); f.writeFloat(fall_time);
f.writeFloat(fall_value); f.writeFloat(fall_value);
f.writeFloat(damage_alpha); f.writeFloat(damage_alpha);
f.writeFloat(bonus_alpha); f.writeFloat(bonus_alpha);
f.writeFloat(damage_blend[0]); f.writeFloat(damage_blend[0]);
f.writeFloat(damage_blend[1]); f.writeFloat(damage_blend[1]);
f.writeFloat(damage_blend[2]); f.writeFloat(damage_blend[2]);
f.writeFloat(v_angle[0]); f.writeFloat(v_angle[0]);
f.writeFloat(v_angle[1]); f.writeFloat(v_angle[1]);
f.writeFloat(v_angle[2]); f.writeFloat(v_angle[2]);
f.writeFloat(bobtime); f.writeFloat(bobtime);
f.writeFloat(oldviewangles[0]); f.writeFloat(oldviewangles[0]);
f.writeFloat(oldviewangles[1]); f.writeFloat(oldviewangles[1]);
f.writeFloat(oldviewangles[2]); f.writeFloat(oldviewangles[2]);
f.writeFloat(oldvelocity[0]); f.writeFloat(oldvelocity[0]);
f.writeFloat(oldvelocity[1]); f.writeFloat(oldvelocity[1]);
f.writeFloat(oldvelocity[2]); f.writeFloat(oldvelocity[2]);
f.writeFloat(next_drown_time); f.writeFloat(next_drown_time);
f.writeInt(old_waterlevel); f.writeInt(old_waterlevel);
f.writeInt(breather_sound); f.writeInt(breather_sound);
f.writeInt(machinegun_shots); f.writeInt(machinegun_shots);
f.writeInt(anim_end); f.writeInt(anim_end);
f.writeInt(anim_priority); f.writeInt(anim_priority);
f.writeInt(anim_duck?1:0); f.writeInt(anim_duck?1:0);
f.writeInt(anim_run?1:0); f.writeInt(anim_run?1:0);
f.writeFloat(quad_framenum); f.writeFloat(quad_framenum);
f.writeFloat(invincible_framenum); f.writeFloat(invincible_framenum);
f.writeFloat(breather_framenum); f.writeFloat(breather_framenum);
f.writeFloat(enviro_framenum); f.writeFloat(enviro_framenum);
f.writeInt(grenade_blew_up?1:0); f.writeInt(grenade_blew_up?1:0);
f.writeFloat(grenade_time); f.writeFloat(grenade_time);
f.writeInt(silencer_shots); f.writeInt(silencer_shots);
f.writeInt(weapon_sound); f.writeInt(weapon_sound);
f.writeFloat(pickup_msg_time); f.writeFloat(pickup_msg_time);
f.writeFloat(flood_locktill); f.writeFloat(flood_locktill);
f.writeFloat(flood_when[0]); f.writeFloat(flood_when[0]);
f.writeFloat(flood_when[1]); f.writeFloat(flood_when[1]);
f.writeFloat(flood_when[2]); f.writeFloat(flood_when[2]);
f.writeFloat(flood_when[3]); f.writeFloat(flood_when[3]);
f.writeFloat(flood_when[4]); f.writeFloat(flood_when[4]);
f.writeFloat(flood_when[5]); f.writeFloat(flood_when[5]);
f.writeFloat(flood_when[6]); f.writeFloat(flood_when[6]);
f.writeFloat(flood_when[7]); f.writeFloat(flood_when[7]);
f.writeFloat(flood_when[8]); f.writeFloat(flood_when[8]);
f.writeFloat(flood_when[9]); f.writeFloat(flood_when[9]);
f.writeInt(flood_whenhead); f.writeInt(flood_whenhead);
f.writeFloat(respawn_time); f.writeFloat(respawn_time);
f.writeEdictRef(chase_target); f.writeEdictRef(chase_target);
f.writeInt(update_chase?1:0); f.writeInt(update_chase?1:0);
f.writeInt(8765); f.writeInt(8765);
} }
} }

View File

@@ -19,23 +19,23 @@
package lwjake2.game; package lwjake2.game;
public class gitem_armor_t { public class gitem_armor_t {
public gitem_armor_t( public gitem_armor_t(
int base_count, int base_count,
int max_count, int max_count,
float normal_protection, float normal_protection,
float energy_protection, float energy_protection,
int armor) { int armor) {
this.base_count= base_count; this.base_count= base_count;
this.max_count= max_count; this.max_count= max_count;
this.normal_protection= normal_protection; this.normal_protection= normal_protection;
this.energy_protection= energy_protection; this.energy_protection= energy_protection;
this.armor= armor; this.armor= armor;
} }
int base_count; int base_count;
int max_count; int max_count;
float normal_protection; float normal_protection;
float energy_protection; float energy_protection;
int armor; int armor;
} }

View File

@@ -25,130 +25,130 @@ import java.io.IOException;
@Slf4j @Slf4j
public class level_locals_t { public class level_locals_t {
// this structure is cleared as each map is entered // this structure is cleared as each map is entered
// it is read/written to the level.sav file for savegames // it is read/written to the level.sav file for savegames
// //
public int framenum; public int framenum;
public float time; public float time;
public String level_name= ""; // the descriptive name (Outer Base, etc) public String level_name= ""; // the descriptive name (Outer Base, etc)
public String mapname= ""; // the server name (base1, etc) public String mapname= ""; // the server name (base1, etc)
public String nextmap= ""; // go here when fraglimit is hit public String nextmap= ""; // go here when fraglimit is hit
// intermission state // intermission state
public float intermissiontime; // time the intermission was started public float intermissiontime; // time the intermission was started
public String changemap; public String changemap;
public boolean exitintermission; public boolean exitintermission;
public float[] intermission_origin= { 0, 0, 0 }; public float[] intermission_origin= { 0, 0, 0 };
public float[] intermission_angle= { 0, 0, 0 }; public float[] intermission_angle= { 0, 0, 0 };
public edict_t sight_client; // changed once each frame for coop games public edict_t sight_client; // changed once each frame for coop games
public edict_t sight_entity; public edict_t sight_entity;
public int sight_entity_framenum; public int sight_entity_framenum;
public edict_t sound_entity; public edict_t sound_entity;
public int sound_entity_framenum; public int sound_entity_framenum;
public edict_t sound2_entity; public edict_t sound2_entity;
public int sound2_entity_framenum; public int sound2_entity_framenum;
public int pic_health; public int pic_health;
public int total_secrets; public int total_secrets;
public int found_secrets; public int found_secrets;
public int total_goals; public int total_goals;
public int found_goals; public int found_goals;
public int total_monsters; public int total_monsters;
public int killed_monsters; public int killed_monsters;
public edict_t current_entity; // entity running from G_RunFrame public edict_t current_entity; // entity running from G_RunFrame
public int body_que; // dead bodies public int body_que; // dead bodies
public int power_cubes; // ugly necessity for coop public int power_cubes; // ugly necessity for coop
/** Writes the levellocales to the file. */ /** Writes the levellocales to the file. */
public void write(QuakeFile f) throws IOException public void write(QuakeFile f) throws IOException
{ {
f.writeInt(framenum); f.writeInt(framenum);
f.writeFloat(time); f.writeFloat(time);
f.writeString(level_name); f.writeString(level_name);
f.writeString(mapname); f.writeString(mapname);
f.writeString(nextmap); f.writeString(nextmap);
f.writeFloat(intermissiontime); f.writeFloat(intermissiontime);
f.writeString(changemap); f.writeString(changemap);
f.writeBoolean(exitintermission); f.writeBoolean(exitintermission);
f.writeVector(intermission_origin); f.writeVector(intermission_origin);
f.writeVector(intermission_angle); f.writeVector(intermission_angle);
f.writeEdictRef(sight_client); f.writeEdictRef(sight_client);
f.writeEdictRef(sight_entity); f.writeEdictRef(sight_entity);
f.writeInt(sight_entity_framenum); f.writeInt(sight_entity_framenum);
f.writeEdictRef(sound_entity); f.writeEdictRef(sound_entity);
f.writeInt(sound_entity_framenum); f.writeInt(sound_entity_framenum);
f.writeEdictRef(sound2_entity); f.writeEdictRef(sound2_entity);
f.writeInt(sound2_entity_framenum); f.writeInt(sound2_entity_framenum);
f.writeInt(pic_health); f.writeInt(pic_health);
f.writeInt(total_secrets); f.writeInt(total_secrets);
f.writeInt(found_secrets); f.writeInt(found_secrets);
f.writeInt(total_goals); f.writeInt(total_goals);
f.writeInt(found_goals); f.writeInt(found_goals);
f.writeInt(total_monsters); f.writeInt(total_monsters);
f.writeInt(killed_monsters); f.writeInt(killed_monsters);
f.writeEdictRef(current_entity); f.writeEdictRef(current_entity);
f.writeInt(body_que); // dead bodies f.writeInt(body_que); // dead bodies
f.writeInt(power_cubes); // ugly necessity for coop f.writeInt(power_cubes); // ugly necessity for coop
// rst's checker :-) // rst's checker :-)
f.writeInt(4711); f.writeInt(4711);
} }
/** Reads the level locals from the file. */ /** Reads the level locals from the file. */
public void read(QuakeFile f) throws IOException public void read(QuakeFile f) throws IOException
{ {
framenum = f.readInt(); framenum = f.readInt();
time = f.readFloat(); time = f.readFloat();
level_name = f.readString(); level_name = f.readString();
mapname = f.readString(); mapname = f.readString();
nextmap = f.readString(); nextmap = f.readString();
intermissiontime = f.readFloat(); intermissiontime = f.readFloat();
changemap = f.readString(); changemap = f.readString();
exitintermission = f.readBoolean(); exitintermission = f.readBoolean();
intermission_origin = f.readVector(); intermission_origin = f.readVector();
intermission_angle = f.readVector(); intermission_angle = f.readVector();
sight_client = f.readEdictRef(); sight_client = f.readEdictRef();
sight_entity = f.readEdictRef(); sight_entity = f.readEdictRef();
sight_entity_framenum = f.readInt(); sight_entity_framenum = f.readInt();
sound_entity = f.readEdictRef(); sound_entity = f.readEdictRef();
sound_entity_framenum = f.readInt(); sound_entity_framenum = f.readInt();
sound2_entity = f.readEdictRef(); sound2_entity = f.readEdictRef();
sound2_entity_framenum = f.readInt(); sound2_entity_framenum = f.readInt();
pic_health = f.readInt(); pic_health = f.readInt();
total_secrets = f.readInt(); total_secrets = f.readInt();
found_secrets = f.readInt(); found_secrets = f.readInt();
total_goals = f.readInt(); total_goals = f.readInt();
found_goals = f.readInt(); found_goals = f.readInt();
total_monsters = f.readInt(); total_monsters = f.readInt();
killed_monsters = f.readInt(); killed_monsters = f.readInt();
current_entity = f.readEdictRef(); current_entity = f.readEdictRef();
body_que = f.readInt(); // dead bodies body_que = f.readInt(); // dead bodies
power_cubes = f.readInt(); // ugly necessity for coop power_cubes = f.readInt(); // ugly necessity for coop
// rst's checker :-) // rst's checker :-)
if (f.readInt()!= 4711) if (f.readInt()!= 4711)
log.error("error in reading level_locals."); log.error("error in reading level_locals.");
} }
} }

View File

@@ -19,9 +19,9 @@
package lwjake2.game; package lwjake2.game;
public class link_t { public class link_t {
public link_t(Object o) { public link_t(Object o) {
this.o = o; this.o = o;
} }
public link_t prev, next; public link_t prev, next;
public Object o; public Object o;
} }

View File

@@ -19,6 +19,6 @@
package lwjake2.game; package lwjake2.game;
public class mapsurface_t { public class mapsurface_t {
public csurface_t c = new csurface_t(); public csurface_t c = new csurface_t();
public String rname; public String rname;
} }

View File

@@ -24,32 +24,32 @@ import java.io.IOException;
public class mframe_t public class mframe_t
{ {
public mframe_t(AIAdapter ai, float dist, EntThinkAdapter think) public mframe_t(AIAdapter ai, float dist, EntThinkAdapter think)
{ {
this.ai= ai; this.ai= ai;
this.dist= dist; this.dist= dist;
this.think= think; this.think= think;
} }
/** Empty constructor. */ /** Empty constructor. */
public mframe_t() public mframe_t()
{} {}
public AIAdapter ai; public AIAdapter ai;
public float dist; public float dist;
public EntThinkAdapter think; public EntThinkAdapter think;
public void write(QuakeFile f) throws IOException public void write(QuakeFile f) throws IOException
{ {
f.writeAdapter(ai); f.writeAdapter(ai);
f.writeFloat(dist); f.writeFloat(dist);
f.writeAdapter(think); f.writeAdapter(think);
} }
public void read(QuakeFile f) throws IOException public void read(QuakeFile f) throws IOException
{ {
ai= (AIAdapter) f.readAdapter(); ai= (AIAdapter) f.readAdapter();
dist= f.readFloat(); dist= f.readFloat();
think= (EntThinkAdapter) f.readAdapter(); think= (EntThinkAdapter) f.readAdapter();
} }
} }

View File

@@ -23,53 +23,53 @@ import lwjake2.util.QuakeFile;
import java.io.IOException; import java.io.IOException;
public class mmove_t { public class mmove_t {
public mmove_t(int firstframe, int lastframe, mframe_t frame[], EntThinkAdapter endfunc) { public mmove_t(int firstframe, int lastframe, mframe_t frame[], EntThinkAdapter endfunc) {
this.firstframe= firstframe; this.firstframe= firstframe;
this.lastframe= lastframe; this.lastframe= lastframe;
this.frame= frame; this.frame= frame;
this.endfunc= endfunc; this.endfunc= endfunc;
} }
public mmove_t() public mmove_t()
{} {}
public int firstframe; public int firstframe;
public int lastframe; public int lastframe;
public mframe_t frame[]; //ptr public mframe_t frame[]; //ptr
public EntThinkAdapter endfunc; public EntThinkAdapter endfunc;
/** Writes the structure to a random acccess file. */ /** Writes the structure to a random acccess file. */
public void write(QuakeFile f) throws IOException public void write(QuakeFile f) throws IOException
{ {
f.writeInt(firstframe); f.writeInt(firstframe);
f.writeInt(lastframe); f.writeInt(lastframe);
if (frame == null) if (frame == null)
f.writeInt(-1); f.writeInt(-1);
else else
{ {
f. writeInt(frame.length); f. writeInt(frame.length);
for (int n=0; n < frame.length; n++) for (int n=0; n < frame.length; n++)
frame[n].write(f); frame[n].write(f);
} }
f.writeAdapter(endfunc); f.writeAdapter(endfunc);
} }
/** Read the mmove_t from the RandomAccessFile. */ /** Read the mmove_t from the RandomAccessFile. */
public void read(QuakeFile f) throws IOException public void read(QuakeFile f) throws IOException
{ {
firstframe = f.readInt(); firstframe = f.readInt();
lastframe = f.readInt(); lastframe = f.readInt();
int len = f.readInt(); int len = f.readInt();
frame = new mframe_t[len]; frame = new mframe_t[len];
for (int n=0; n < len ; n++) for (int n=0; n < len ; n++)
{ {
frame[n] = new mframe_t(); frame[n] = new mframe_t();
frame[n].read(f); frame[n].read(f);
} }
endfunc = (EntThinkAdapter) f.readAdapter(); endfunc = (EntThinkAdapter) f.readAdapter();
} }
} }

View File

@@ -24,133 +24,133 @@ import java.io.IOException;
public class monsterinfo_t { public class monsterinfo_t {
public mmove_t currentmove; public mmove_t currentmove;
public int aiflags; public int aiflags;
public int nextframe; public int nextframe;
public float scale; public float scale;
public EntThinkAdapter stand; public EntThinkAdapter stand;
public EntThinkAdapter idle; public EntThinkAdapter idle;
public EntThinkAdapter search; public EntThinkAdapter search;
public EntThinkAdapter walk; public EntThinkAdapter walk;
public EntThinkAdapter run; public EntThinkAdapter run;
public EntDodgeAdapter dodge; public EntDodgeAdapter dodge;
public EntThinkAdapter attack; public EntThinkAdapter attack;
public EntThinkAdapter melee; public EntThinkAdapter melee;
public EntInteractAdapter sight; public EntInteractAdapter sight;
public EntThinkAdapter checkattack; public EntThinkAdapter checkattack;
public float pausetime; public float pausetime;
public float attack_finished; public float attack_finished;
public float[] saved_goal= { 0, 0, 0 }; public float[] saved_goal= { 0, 0, 0 };
public float search_time; public float search_time;
public float trail_time; public float trail_time;
public float[] last_sighting= { 0, 0, 0 }; public float[] last_sighting= { 0, 0, 0 };
public int attack_state; public int attack_state;
public int lefty; public int lefty;
public float idle_time; public float idle_time;
public int linkcount; public int linkcount;
public int power_armor_type; public int power_armor_type;
public int power_armor_power; public int power_armor_power;
/** Writes the monsterinfo to the file. */ /** Writes the monsterinfo to the file. */
public void write(QuakeFile f) throws IOException public void write(QuakeFile f) throws IOException
{ {
f.writeBoolean(currentmove != null); f.writeBoolean(currentmove != null);
if (currentmove != null) if (currentmove != null)
currentmove.write(f); currentmove.write(f);
f.writeInt(aiflags); f.writeInt(aiflags);
f.writeInt(nextframe); f.writeInt(nextframe);
f.writeFloat(scale); f.writeFloat(scale);
f.writeAdapter(stand); f.writeAdapter(stand);
f.writeAdapter(idle); f.writeAdapter(idle);
f.writeAdapter(search); f.writeAdapter(search);
f.writeAdapter(walk); f.writeAdapter(walk);
f.writeAdapter(run); f.writeAdapter(run);
f.writeAdapter(dodge); f.writeAdapter(dodge);
f.writeAdapter(attack); f.writeAdapter(attack);
f.writeAdapter(melee); f.writeAdapter(melee);
f.writeAdapter(sight); f.writeAdapter(sight);
f.writeAdapter(checkattack); f.writeAdapter(checkattack);
f.writeFloat(pausetime); f.writeFloat(pausetime);
f.writeFloat(attack_finished); f.writeFloat(attack_finished);
f.writeVector(saved_goal); f.writeVector(saved_goal);
f.writeFloat(search_time); f.writeFloat(search_time);
f.writeFloat(trail_time); f.writeFloat(trail_time);
f.writeVector(last_sighting); f.writeVector(last_sighting);
f.writeInt(attack_state); f.writeInt(attack_state);
f.writeInt(lefty); f.writeInt(lefty);
f.writeFloat(idle_time); f.writeFloat(idle_time);
f.writeInt(linkcount); f.writeInt(linkcount);
f.writeInt(power_armor_power); f.writeInt(power_armor_power);
f.writeInt(power_armor_type); f.writeInt(power_armor_type);
} }
/** Writes the monsterinfo to the file. */ /** Writes the monsterinfo to the file. */
public void read(QuakeFile f) throws IOException public void read(QuakeFile f) throws IOException
{ {
if (f.readBoolean()) if (f.readBoolean())
{ {
currentmove= new mmove_t(); currentmove= new mmove_t();
currentmove.read(f); currentmove.read(f);
} }
else else
currentmove= null; currentmove= null;
aiflags = f.readInt(); aiflags = f.readInt();
nextframe = f.readInt(); nextframe = f.readInt();
scale = f.readFloat(); scale = f.readFloat();
stand = (EntThinkAdapter) f.readAdapter(); stand = (EntThinkAdapter) f.readAdapter();
idle = (EntThinkAdapter) f.readAdapter(); idle = (EntThinkAdapter) f.readAdapter();
search = (EntThinkAdapter) f.readAdapter(); search = (EntThinkAdapter) f.readAdapter();
walk = (EntThinkAdapter) f.readAdapter(); walk = (EntThinkAdapter) f.readAdapter();
run = (EntThinkAdapter) f.readAdapter(); run = (EntThinkAdapter) f.readAdapter();
dodge = (EntDodgeAdapter) f.readAdapter(); dodge = (EntDodgeAdapter) f.readAdapter();
attack = (EntThinkAdapter) f.readAdapter(); attack = (EntThinkAdapter) f.readAdapter();
melee = (EntThinkAdapter) f.readAdapter(); melee = (EntThinkAdapter) f.readAdapter();
sight = (EntInteractAdapter) f.readAdapter(); sight = (EntInteractAdapter) f.readAdapter();
checkattack = (EntThinkAdapter) f.readAdapter(); checkattack = (EntThinkAdapter) f.readAdapter();
pausetime = f.readFloat(); pausetime = f.readFloat();
attack_finished = f.readFloat(); attack_finished = f.readFloat();
saved_goal = f.readVector(); saved_goal = f.readVector();
search_time = f.readFloat(); search_time = f.readFloat();
trail_time = f.readFloat(); trail_time = f.readFloat();
last_sighting = f.readVector(); last_sighting = f.readVector();
attack_state = f.readInt(); attack_state = f.readInt();
lefty = f.readInt(); lefty = f.readInt();
idle_time = f.readFloat(); idle_time = f.readFloat();
linkcount = f.readInt(); linkcount = f.readInt();
power_armor_power = f.readInt(); power_armor_power = f.readInt();
power_armor_type = f.readInt(); power_armor_type = f.readInt();
} }
} }

View File

@@ -38,7 +38,7 @@ import lwjake2.util.Lib;
import lwjake2.util.Math3D; import lwjake2.util.Math3D;
public class M_Actor { public class M_Actor {
// This file generated by ModelGen - Do NOT Modify // This file generated by ModelGen - Do NOT Modify
public final static int FRAME_attak01 = 0; public final static int FRAME_attak01 = 0;
@@ -1295,9 +1295,9 @@ public class M_Actor {
int damage, float[] point) { int damage, float[] point) {
int n; int n;
// check for gib // check for gib
if (self.health <= -80) { if (self.health <= -80) {
// gi.sound (self, CHAN_VOICE, actor.sound_gib, 1, ATTN_NORM, // gi.sound (self, CHAN_VOICE, actor.sound_gib, 1, ATTN_NORM,
// 0); // 0);
for (n = 0; n < 2; n++) for (n = 0; n < 2; n++)
GameMisc.ThrowGib(self, "models/objects/gibs/bone/tris.md2", GameMisc.ThrowGib(self, "models/objects/gibs/bone/tris.md2",
@@ -1315,8 +1315,8 @@ public class M_Actor {
if (self.deadflag == Defines.DEAD_DEAD) if (self.deadflag == Defines.DEAD_DEAD)
return; return;
// regular death // regular death
// gi.sound (self, CHAN_VOICE, actor.sound_die, 1, ATTN_NORM, 0); // gi.sound (self, CHAN_VOICE, actor.sound_die, 1, ATTN_NORM, 0);
self.deadflag = Defines.DEAD_DEAD; self.deadflag = Defines.DEAD_DEAD;
self.takedamage = Defines.DAMAGE_YES; self.takedamage = Defines.DAMAGE_YES;

View File

@@ -690,7 +690,7 @@ public class M_Berserk {
float[] aim = { Defines.MELEE_DISTANCE, 0f, -24f }; float[] aim = { Defines.MELEE_DISTANCE, 0f, -24f };
GameWeapon.fire_hit(self, aim, (15 + (Lib.rand() % 6)), 400); GameWeapon.fire_hit(self, aim, (15 + (Lib.rand() % 6)), 400);
// Faster attack -- upwards and backwards // Faster attack -- upwards and backwards
return true; return true;
} }

View File

@@ -410,7 +410,7 @@ public class M_Boss2 {
static int sound_search1; static int sound_search1;
static EntThinkAdapter boss2_stand = new EntThinkAdapter() { static EntThinkAdapter boss2_stand = new EntThinkAdapter() {
public String getID() { return "boss2_stand"; } public String getID() { return "boss2_stand"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
self.monsterinfo.currentmove = boss2_move_stand; self.monsterinfo.currentmove = boss2_move_stand;
return true; return true;
@@ -418,7 +418,7 @@ public class M_Boss2 {
}; };
static EntThinkAdapter boss2_run = new EntThinkAdapter() { static EntThinkAdapter boss2_run = new EntThinkAdapter() {
public String getID() { return "boss2_run"; } public String getID() { return "boss2_run"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0) if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0)
self.monsterinfo.currentmove = boss2_move_stand; self.monsterinfo.currentmove = boss2_move_stand;
@@ -429,7 +429,7 @@ public class M_Boss2 {
}; };
static EntThinkAdapter boss2_walk = new EntThinkAdapter() { static EntThinkAdapter boss2_walk = new EntThinkAdapter() {
public String getID() { return "boss2_walk"; } public String getID() { return "boss2_walk"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
self.monsterinfo.currentmove = boss2_move_stand; self.monsterinfo.currentmove = boss2_move_stand;
@@ -439,7 +439,7 @@ public class M_Boss2 {
}; };
static EntThinkAdapter boss2_attack = new EntThinkAdapter() { static EntThinkAdapter boss2_attack = new EntThinkAdapter() {
public String getID() { return "boss2_attack"; } public String getID() { return "boss2_attack"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] vec = { 0, 0, 0 }; float[] vec = { 0, 0, 0 };
@@ -461,7 +461,7 @@ public class M_Boss2 {
}; };
static EntThinkAdapter boss2_attack_mg = new EntThinkAdapter() { static EntThinkAdapter boss2_attack_mg = new EntThinkAdapter() {
public String getID() { return "boss2_attack_mg"; } public String getID() { return "boss2_attack_mg"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
self.monsterinfo.currentmove = boss2_move_attack_mg; self.monsterinfo.currentmove = boss2_move_attack_mg;
return true; return true;
@@ -469,7 +469,7 @@ public class M_Boss2 {
}; };
static EntThinkAdapter boss2_reattack_mg = new EntThinkAdapter() { static EntThinkAdapter boss2_reattack_mg = new EntThinkAdapter() {
public String getID() { return "boss2_reattack_mg"; } public String getID() { return "boss2_reattack_mg"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
if (GameUtil.infront(self, self.enemy)) if (GameUtil.infront(self, self.enemy))
if (Lib.random() <= 0.7) if (Lib.random() <= 0.7)
@@ -483,7 +483,7 @@ public class M_Boss2 {
}; };
static EntPainAdapter boss2_pain = new EntPainAdapter() { static EntPainAdapter boss2_pain = new EntPainAdapter() {
public String getID() { return "boss2_pain"; } public String getID() { return "boss2_pain"; }
public void pain(edict_t self, edict_t other, float kick, int damage) { public void pain(edict_t self, edict_t other, float kick, int damage) {
if (self.health < (self.max_health / 2)) if (self.health < (self.max_health / 2))
self.s.skinnum = 1; self.s.skinnum = 1;
@@ -492,7 +492,7 @@ public class M_Boss2 {
return; return;
self.pain_debounce_time = GameBase.level.time + 3; self.pain_debounce_time = GameBase.level.time + 3;
// American wanted these at no attenuation // American wanted these at no attenuation
if (damage < 10) { if (damage < 10) {
GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain3, 1, GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain3, 1,
Defines.ATTN_NONE, 0); Defines.ATTN_NONE, 0);
@@ -510,7 +510,7 @@ public class M_Boss2 {
}; };
static EntThinkAdapter boss2_dead = new EntThinkAdapter() { static EntThinkAdapter boss2_dead = new EntThinkAdapter() {
public String getID() { return "boss2_dead"; } public String getID() { return "boss2_dead"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
Math3D.VectorSet(self.mins, -56, -56, 0); Math3D.VectorSet(self.mins, -56, -56, 0);
Math3D.VectorSet(self.maxs, 56, 56, 80); Math3D.VectorSet(self.maxs, 56, 56, 80);
@@ -523,7 +523,7 @@ public class M_Boss2 {
}; };
static EntDieAdapter boss2_die = new EntDieAdapter() { static EntDieAdapter boss2_die = new EntDieAdapter() {
public String getID() { return "boss2_die"; } public String getID() { return "boss2_die"; }
public void die(edict_t self, edict_t inflictor, edict_t attacker, public void die(edict_t self, edict_t inflictor, edict_t attacker,
int damage, float[] point) { int damage, float[] point) {
GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_death, 1, GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_death, 1,
@@ -537,7 +537,7 @@ public class M_Boss2 {
}; };
static EntThinkAdapter Boss2_CheckAttack = new EntThinkAdapter() { static EntThinkAdapter Boss2_CheckAttack = new EntThinkAdapter() {
public String getID() { return "Boss2_CheckAttack"; } public String getID() { return "Boss2_CheckAttack"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] spot1 = { 0, 0, 0 }, spot2 = { 0, 0, 0 }; float[] spot1 = { 0, 0, 0 }, spot2 = { 0, 0, 0 };
float[] temp = { 0, 0, 0 }; float[] temp = { 0, 0, 0 };
@@ -578,7 +578,7 @@ public class M_Boss2 {
return true; return true;
} }
// missile attack // missile attack
if (self.monsterinfo.attack == null) if (self.monsterinfo.attack == null)
return false; return false;
@@ -617,7 +617,7 @@ public class M_Boss2 {
}; };
static EntThinkAdapter boss2_search = new EntThinkAdapter() { static EntThinkAdapter boss2_search = new EntThinkAdapter() {
public String getID() { return "boss2_search"; } public String getID() { return "boss2_search"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
if (Lib.random() < 0.5) if (Lib.random() < 0.5)
GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_search1, 1, GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_search1, 1,
@@ -627,7 +627,7 @@ public class M_Boss2 {
}; };
static EntThinkAdapter Boss2Rocket = new EntThinkAdapter() { static EntThinkAdapter Boss2Rocket = new EntThinkAdapter() {
public String getID() { return "Boss2Rocket"; } public String getID() { return "Boss2Rocket"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }; float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 };
float[] start = { 0, 0, 0 }; float[] start = { 0, 0, 0 };
@@ -636,7 +636,7 @@ public class M_Boss2 {
Math3D.AngleVectors(self.s.angles, forward, right, null); Math3D.AngleVectors(self.s.angles, forward, right, null);
// 1 // 1
Math3D.G_ProjectSource(self.s.origin, Math3D.G_ProjectSource(self.s.origin,
M_Flash.monster_flash_offset[Defines.MZ2_BOSS2_ROCKET_1], M_Flash.monster_flash_offset[Defines.MZ2_BOSS2_ROCKET_1],
forward, right, start); forward, right, start);
@@ -647,7 +647,7 @@ public class M_Boss2 {
Monster.monster_fire_rocket(self, start, dir, 50, 500, Monster.monster_fire_rocket(self, start, dir, 50, 500,
Defines.MZ2_BOSS2_ROCKET_1); Defines.MZ2_BOSS2_ROCKET_1);
// 2 // 2
Math3D.G_ProjectSource(self.s.origin, Math3D.G_ProjectSource(self.s.origin,
M_Flash.monster_flash_offset[Defines.MZ2_BOSS2_ROCKET_2], M_Flash.monster_flash_offset[Defines.MZ2_BOSS2_ROCKET_2],
forward, right, start); forward, right, start);
@@ -658,7 +658,7 @@ public class M_Boss2 {
Monster.monster_fire_rocket(self, start, dir, 50, 500, Monster.monster_fire_rocket(self, start, dir, 50, 500,
Defines.MZ2_BOSS2_ROCKET_2); Defines.MZ2_BOSS2_ROCKET_2);
// 3 // 3
Math3D.G_ProjectSource(self.s.origin, Math3D.G_ProjectSource(self.s.origin,
M_Flash.monster_flash_offset[Defines.MZ2_BOSS2_ROCKET_3], M_Flash.monster_flash_offset[Defines.MZ2_BOSS2_ROCKET_3],
forward, right, start); forward, right, start);
@@ -669,7 +669,7 @@ public class M_Boss2 {
Monster.monster_fire_rocket(self, start, dir, 50, 500, Monster.monster_fire_rocket(self, start, dir, 50, 500,
Defines.MZ2_BOSS2_ROCKET_3); Defines.MZ2_BOSS2_ROCKET_3);
// 4 // 4
Math3D.G_ProjectSource(self.s.origin, Math3D.G_ProjectSource(self.s.origin,
M_Flash.monster_flash_offset[Defines.MZ2_BOSS2_ROCKET_4], M_Flash.monster_flash_offset[Defines.MZ2_BOSS2_ROCKET_4],
forward, right, start); forward, right, start);
@@ -684,7 +684,7 @@ public class M_Boss2 {
}; };
static EntThinkAdapter boss2_firebullet_right = new EntThinkAdapter() { static EntThinkAdapter boss2_firebullet_right = new EntThinkAdapter() {
public String getID() { return "boss2_firebullet_right"; } public String getID() { return "boss2_firebullet_right"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }, target = { 0, float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }, target = { 0,
0, 0 }; 0, 0 };
@@ -713,7 +713,7 @@ public class M_Boss2 {
}; };
static EntThinkAdapter boss2_firebullet_left = new EntThinkAdapter() { static EntThinkAdapter boss2_firebullet_left = new EntThinkAdapter() {
public String getID() { return "boss2_firebullet_left"; } public String getID() { return "boss2_firebullet_left"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }, target = { 0, float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }, target = { 0,
0, 0 }; 0, 0 };
@@ -743,7 +743,7 @@ public class M_Boss2 {
}; };
static EntThinkAdapter Boss2MachineGun = new EntThinkAdapter() { static EntThinkAdapter Boss2MachineGun = new EntThinkAdapter() {
public String getID() { return "Boss2MachineGun"; } public String getID() { return "Boss2MachineGun"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
/* /*
* RST: this was disabled ! float[] forward={0,0,0}, right={0,0,0}; * RST: this was disabled ! float[] forward={0,0,0}, right={0,0,0};
@@ -892,7 +892,7 @@ public class M_Boss2 {
static mmove_t boss2_move_attack_pre_mg = new mmove_t(FRAME_attack1, static mmove_t boss2_move_attack_pre_mg = new mmove_t(FRAME_attack1,
FRAME_attack9, boss2_frames_attack_pre_mg, null); FRAME_attack9, boss2_frames_attack_pre_mg, null);
// Loop this // Loop this
static mframe_t boss2_frames_attack_mg[] = new mframe_t[] { static mframe_t boss2_frames_attack_mg[] = new mframe_t[] {
new mframe_t(GameAI.ai_charge, 1, Boss2MachineGun), new mframe_t(GameAI.ai_charge, 1, Boss2MachineGun),
new mframe_t(GameAI.ai_charge, 1, Boss2MachineGun), new mframe_t(GameAI.ai_charge, 1, Boss2MachineGun),

View File

@@ -29,7 +29,7 @@ import lwjake2.util.Math3D;
public class M_Boss3 { public class M_Boss3 {
static EntUseAdapter Use_Boss3 = new EntUseAdapter() { static EntUseAdapter Use_Boss3 = new EntUseAdapter() {
public String getID() { return "Use_Boss3"; } public String getID() { return "Use_Boss3"; }
public void use(edict_t ent, edict_t other, edict_t activator) { public void use(edict_t ent, edict_t other, edict_t activator) {
GameBase.gi.WriteByte(Defines.svc_temp_entity); GameBase.gi.WriteByte(Defines.svc_temp_entity);
GameBase.gi.WriteByte(Defines.TE_BOSSTPORT); GameBase.gi.WriteByte(Defines.TE_BOSSTPORT);
@@ -40,7 +40,7 @@ public class M_Boss3 {
}; };
static EntThinkAdapter Think_Boss3Stand = new EntThinkAdapter() { static EntThinkAdapter Think_Boss3Stand = new EntThinkAdapter() {
public String getID() { return "Think_Boss3Stand"; } public String getID() { return "Think_Boss3Stand"; }
public boolean think(edict_t ent) { public boolean think(edict_t ent) {
if (ent.s.frame == M_Boss32.FRAME_stand260) if (ent.s.frame == M_Boss32.FRAME_stand260)
ent.s.frame = M_Boss32.FRAME_stand201; ent.s.frame = M_Boss32.FRAME_stand201;

View File

@@ -455,7 +455,7 @@ public class M_Boss31 {
*/ */
static EntThinkAdapter jorg_search = new EntThinkAdapter() { static EntThinkAdapter jorg_search = new EntThinkAdapter() {
public String getID() { return "jorg_search"; } public String getID() { return "jorg_search"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float r; float r;
@@ -475,7 +475,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorg_idle = new EntThinkAdapter() { static EntThinkAdapter jorg_idle = new EntThinkAdapter() {
public String getID() { return "jorg_idle"; } public String getID() { return "jorg_idle"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_idle, 1, GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_idle, 1,
Defines.ATTN_NORM, 0); Defines.ATTN_NORM, 0);
@@ -484,7 +484,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorg_death_hit = new EntThinkAdapter() { static EntThinkAdapter jorg_death_hit = new EntThinkAdapter() {
public String getID() { return "jorg_death_hit"; } public String getID() { return "jorg_death_hit"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
GameBase.gi.sound(self, Defines.CHAN_BODY, sound_death_hit, 1, GameBase.gi.sound(self, Defines.CHAN_BODY, sound_death_hit, 1,
Defines.ATTN_NORM, 0); Defines.ATTN_NORM, 0);
@@ -493,7 +493,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorg_step_left = new EntThinkAdapter() { static EntThinkAdapter jorg_step_left = new EntThinkAdapter() {
public String getID() { return "jorg_step_left"; } public String getID() { return "jorg_step_left"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
GameBase.gi.sound(self, Defines.CHAN_BODY, sound_step_left, 1, GameBase.gi.sound(self, Defines.CHAN_BODY, sound_step_left, 1,
Defines.ATTN_NORM, 0); Defines.ATTN_NORM, 0);
@@ -502,7 +502,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorg_step_right = new EntThinkAdapter() { static EntThinkAdapter jorg_step_right = new EntThinkAdapter() {
public String getID() { return "jorg_step_right"; } public String getID() { return "jorg_step_right"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
GameBase.gi.sound(self, Defines.CHAN_BODY, sound_step_right, 1, GameBase.gi.sound(self, Defines.CHAN_BODY, sound_step_right, 1,
Defines.ATTN_NORM, 0); Defines.ATTN_NORM, 0);
@@ -511,7 +511,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorg_stand = new EntThinkAdapter() { static EntThinkAdapter jorg_stand = new EntThinkAdapter() {
public String getID() { return "jorg_stand"; } public String getID() { return "jorg_stand"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
self.monsterinfo.currentmove = jorg_move_stand; self.monsterinfo.currentmove = jorg_move_stand;
return true; return true;
@@ -519,7 +519,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorg_reattack1 = new EntThinkAdapter() { static EntThinkAdapter jorg_reattack1 = new EntThinkAdapter() {
public String getID() { return "jorg_reattack1"; } public String getID() { return "jorg_reattack1"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
if (GameUtil.visible(self, self.enemy)) if (GameUtil.visible(self, self.enemy))
if (Lib.random() < 0.9) if (Lib.random() < 0.9)
@@ -537,7 +537,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorg_attack1 = new EntThinkAdapter() { static EntThinkAdapter jorg_attack1 = new EntThinkAdapter() {
public String getID() { return "jorg_attack1"; } public String getID() { return "jorg_attack1"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
self.monsterinfo.currentmove = jorg_move_attack1; self.monsterinfo.currentmove = jorg_move_attack1;
return true; return true;
@@ -545,7 +545,7 @@ public class M_Boss31 {
}; };
static EntPainAdapter jorg_pain = new EntPainAdapter() { static EntPainAdapter jorg_pain = new EntPainAdapter() {
public String getID() { return "jorg_pain"; } public String getID() { return "jorg_pain"; }
public void pain(edict_t self, edict_t other, float kick, int damage) { public void pain(edict_t self, edict_t other, float kick, int damage) {
if (self.health < (self.max_health / 2)) if (self.health < (self.max_health / 2))
self.s.skinnum = 1; self.s.skinnum = 1;
@@ -605,7 +605,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorgBFG = new EntThinkAdapter() { static EntThinkAdapter jorgBFG = new EntThinkAdapter() {
public String getID() { return "jorgBFG"; } public String getID() { return "jorgBFG"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }; float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 };
@@ -636,7 +636,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorg_firebullet_right = new EntThinkAdapter() { static EntThinkAdapter jorg_firebullet_right = new EntThinkAdapter() {
public String getID() { return "jorg_firebullet_right"; } public String getID() { return "jorg_firebullet_right"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }, target = { 0, float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }, target = { 0,
0, 0 }; 0, 0 };
@@ -664,7 +664,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorg_firebullet_left = new EntThinkAdapter() { static EntThinkAdapter jorg_firebullet_left = new EntThinkAdapter() {
public String getID() { return "jorg_firebullet_left"; } public String getID() { return "jorg_firebullet_left"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }, target = { 0, float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }, target = { 0,
0, 0 }; 0, 0 };
@@ -692,7 +692,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorg_firebullet = new EntThinkAdapter() { static EntThinkAdapter jorg_firebullet = new EntThinkAdapter() {
public String getID() { return "jorg_firebullet"; } public String getID() { return "jorg_firebullet"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
jorg_firebullet_left.think(self); jorg_firebullet_left.think(self);
jorg_firebullet_right.think(self); jorg_firebullet_right.think(self);
@@ -701,7 +701,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorg_attack = new EntThinkAdapter() { static EntThinkAdapter jorg_attack = new EntThinkAdapter() {
public String getID() { return "jorg_attack"; } public String getID() { return "jorg_attack"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] vec = { 0, 0, 0 }; float[] vec = { 0, 0, 0 };
@@ -723,7 +723,7 @@ public class M_Boss31 {
/** Was disabled. RST. */ /** Was disabled. RST. */
static EntThinkAdapter jorg_dead = new EntThinkAdapter() { static EntThinkAdapter jorg_dead = new EntThinkAdapter() {
public String getID() { return "jorg_dead"; } public String getID() { return "jorg_dead"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
/* /*
* edict_t tempent; * edict_t tempent;
@@ -746,7 +746,7 @@ public class M_Boss31 {
}; };
static EntDieAdapter jorg_die = new EntDieAdapter() { static EntDieAdapter jorg_die = new EntDieAdapter() {
public String getID() { return "jorg_die"; } public String getID() { return "jorg_die"; }
public void die(edict_t self, edict_t inflictor, edict_t attacker, public void die(edict_t self, edict_t inflictor, edict_t attacker,
int damage, float[] point) { int damage, float[] point) {
GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_death, 1, GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_death, 1,
@@ -761,7 +761,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter Jorg_CheckAttack = new EntThinkAdapter() { static EntThinkAdapter Jorg_CheckAttack = new EntThinkAdapter() {
public String getID() { return "Jorg_CheckAttack"; } public String getID() { return "Jorg_CheckAttack"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
float[] spot1 = { 0, 0, 0 }, spot2 = { 0, 0, 0 }; float[] spot1 = { 0, 0, 0 }, spot2 = { 0, 0, 0 };
float[] temp = { 0, 0, 0 }; float[] temp = { 0, 0, 0 };
@@ -802,7 +802,7 @@ public class M_Boss31 {
return true; return true;
} }
// missile attack ? // missile attack ?
if (self.monsterinfo.attack == null) if (self.monsterinfo.attack == null)
return false; return false;
@@ -841,7 +841,7 @@ public class M_Boss31 {
}; };
// //
// stand // stand
// //
static mframe_t jorg_frames_stand[] = new mframe_t[] { static mframe_t jorg_frames_stand[] = new mframe_t[] {
@@ -926,7 +926,7 @@ public class M_Boss31 {
jorg_frames_run, null); jorg_frames_run, null);
// //
// walk // walk
// //
static mframe_t jorg_frames_start_walk[] = new mframe_t[] { static mframe_t jorg_frames_start_walk[] = new mframe_t[] {
@@ -970,7 +970,7 @@ public class M_Boss31 {
jorg_frames_end_walk, null); jorg_frames_end_walk, null);
static EntThinkAdapter jorg_walk = new EntThinkAdapter() { static EntThinkAdapter jorg_walk = new EntThinkAdapter() {
public String getID() { return "jorg_walk"; } public String getID() { return "jorg_walk"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
self.monsterinfo.currentmove = jorg_move_walk; self.monsterinfo.currentmove = jorg_move_walk;
return true; return true;
@@ -978,7 +978,7 @@ public class M_Boss31 {
}; };
static EntThinkAdapter jorg_run = new EntThinkAdapter() { static EntThinkAdapter jorg_run = new EntThinkAdapter() {
public String getID() { return "jorg_run"; } public String getID() { return "jorg_run"; }
public boolean think(edict_t self) { public boolean think(edict_t self) {
if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0) if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0)
self.monsterinfo.currentmove = jorg_move_stand; self.monsterinfo.currentmove = jorg_move_stand;

Some files were not shown because too many files have changed in this diff Show More