fix
This commit is contained in:
parent
9fe97a996a
commit
b1545f05b3
53 changed files with 701 additions and 699 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
*.o
|
||||||
|
/mwquake
|
||||||
|
|
@ -24,17 +24,17 @@ typedef unsigned char byte;
|
||||||
#define BYTE_DEFINED 1
|
#define BYTE_DEFINED 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef true
|
#undef qtrue
|
||||||
#undef false
|
#undef qfalse
|
||||||
|
|
||||||
typedef enum {false, true} qboolean;
|
typedef enum {qfalse, qtrue} qboolean;
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
typedef struct sizebuf_s
|
typedef struct sizebuf_s
|
||||||
{
|
{
|
||||||
qboolean allowoverflow; // if false, do a Sys_Error
|
qboolean allowoverflow; // if qfalse, do a Sys_Error
|
||||||
qboolean overflowed; // set to true if the buffer size failed
|
qboolean overflowed; // set to qtrue if the buffer size failed
|
||||||
byte *data;
|
byte *data;
|
||||||
int maxsize;
|
int maxsize;
|
||||||
int cursize;
|
int cursize;
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@ cvar_t variables are used to hold scalar or string variables that can be changed
|
||||||
in C code.
|
in C code.
|
||||||
|
|
||||||
it is sufficient to initialize a cvar_t with just the first two fields, or
|
it is sufficient to initialize a cvar_t with just the first two fields, or
|
||||||
you can add a ,true flag for variables that you want saved to the configuration
|
you can add a ,qtrue flag for variables that you want saved to the configuration
|
||||||
file when the game is quit:
|
file when the game is quit:
|
||||||
|
|
||||||
cvar_t r_draworder = {"r_draworder","1"};
|
cvar_t r_draworder = {"r_draworder","1"};
|
||||||
cvar_t scr_screensize = {"screensize","1",true};
|
cvar_t scr_screensize = {"screensize","1",qtrue};
|
||||||
|
|
||||||
Cvars must be registered before use, or they will have a 0 value instead of the float interpretation of the string. Generally, all cvar_t declarations should be registered in the apropriate init function before any console commands are executed:
|
Cvars must be registered before use, or they will have a 0 value instead of the float interpretation of the string. Generally, all cvar_t declarations should be registered in the apropriate init function before any console commands are executed:
|
||||||
Cvar_RegisterVariable (&host_framerate);
|
Cvar_RegisterVariable (&host_framerate);
|
||||||
|
|
@ -57,7 +57,7 @@ typedef struct cvar_s
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
char *string;
|
char *string;
|
||||||
qboolean archive; // set to true to cause it to be saved to vars.rc
|
qboolean archive; // set to qtrue to cause it to be saved to vars.rc
|
||||||
qboolean server; // notifies players when changed
|
qboolean server; // notifies players when changed
|
||||||
float value;
|
float value;
|
||||||
struct cvar_s *next;
|
struct cvar_s *next;
|
||||||
|
|
@ -85,12 +85,12 @@ char *Cvar_CompleteVariable (char *partial);
|
||||||
|
|
||||||
qboolean Cvar_Command (void);
|
qboolean Cvar_Command (void);
|
||||||
// called by Cmd_ExecuteString when Cmd_Argv(0) doesn't match a known
|
// called by Cmd_ExecuteString when Cmd_Argv(0) doesn't match a known
|
||||||
// command. Returns true if the command was a variable reference that
|
// command. Returns qtrue if the command was a variable reference that
|
||||||
// was handled. (print or change)
|
// was handled. (print or change)
|
||||||
|
|
||||||
void Cvar_WriteVariables (FILE *f);
|
void Cvar_WriteVariables (FILE *f);
|
||||||
// Writes lines containing "set variable value" for all variables
|
// Writes lines containing "set variable value" for all variables
|
||||||
// with the archive flag set to true.
|
// with the archive flag set to qtrue.
|
||||||
|
|
||||||
cvar_t *Cvar_FindVar (char *var_name);
|
cvar_t *Cvar_FindVar (char *var_name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ extern qboolean r_drawculledpolys; // 1 if driver wants clipped polygons that
|
||||||
extern qboolean r_worldpolysbacktofront; // 1 if driver wants polygons
|
extern qboolean r_worldpolysbacktofront; // 1 if driver wants polygons
|
||||||
// delivered back to front rather
|
// delivered back to front rather
|
||||||
// than front to back
|
// than front to back
|
||||||
extern qboolean r_recursiveaffinetriangles; // true if a driver wants to use
|
extern qboolean r_recursiveaffinetriangles; // qtrue if a driver wants to use
|
||||||
// recursive triangular subdivison
|
// recursive triangular subdivison
|
||||||
// and vertex drawing via
|
// and vertex drawing via
|
||||||
// D_PolysetDrawFinalVerts() past
|
// D_PolysetDrawFinalVerts() past
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ typedef struct msurface_s
|
||||||
int lightmaptexturenum;
|
int lightmaptexturenum;
|
||||||
byte styles[MAXLIGHTMAPS];
|
byte styles[MAXLIGHTMAPS];
|
||||||
int cached_light[MAXLIGHTMAPS]; // values currently used in lightmap
|
int cached_light[MAXLIGHTMAPS]; // values currently used in lightmap
|
||||||
qboolean cached_dlight; // true if dynamic light in cache
|
qboolean cached_dlight; // qtrue if dynamic light in cache
|
||||||
byte *samples; // [numstyles*surfsize]
|
byte *samples; // [numstyles*surfsize]
|
||||||
} msurface_t;
|
} msurface_t;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -495,9 +495,9 @@ your entitlements.xcent file:
|
||||||
|
|
||||||
```
|
```
|
||||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||||
<true/>
|
<qtrue/>
|
||||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||||
<true/>
|
<qtrue/>
|
||||||
```
|
```
|
||||||
|
|
||||||
See this discussion for more info: https://github.com/mackron/miniaudio/issues/203.
|
See this discussion for more info: https://github.com/mackron/miniaudio/issues/203.
|
||||||
|
|
@ -1485,7 +1485,7 @@ Whether or not a sound should loop can be controlled with `ma_sound_set_looping(
|
||||||
be looping by default. Use `ma_sound_is_looping()` to determine whether or not a sound is looping.
|
be looping by default. Use `ma_sound_is_looping()` to determine whether or not a sound is looping.
|
||||||
|
|
||||||
Use `ma_sound_at_end()` to determine whether or not a sound is currently at the end. For a looping
|
Use `ma_sound_at_end()` to determine whether or not a sound is currently at the end. For a looping
|
||||||
sound this should never return true. Alternatively, you can configure a callback that will be fired
|
sound this should never return qtrue. Alternatively, you can configure a callback that will be fired
|
||||||
when the sound reaches the end. Note that the callback is fired from the audio thread which means
|
when the sound reaches the end. Note that the callback is fired from the audio thread which means
|
||||||
you cannot be uninitializing sound from the callback. To set the callback you can use
|
you cannot be uninitializing sound from the callback. To set the callback you can use
|
||||||
`ma_sound_set_end_callback()`. Alternatively, if you're using `ma_sound_init_ex()`, you can pass it
|
`ma_sound_set_end_callback()`. Alternatively, if you're using `ma_sound_init_ex()`, you can pass it
|
||||||
|
|
@ -2531,7 +2531,7 @@ an example for loading a decoder from a file:
|
||||||
ma_decoder decoder;
|
ma_decoder decoder;
|
||||||
ma_result result = ma_decoder_init_file("MySong.mp3", NULL, &decoder);
|
ma_result result = ma_decoder_init_file("MySong.mp3", NULL, &decoder);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
return false; // An error occurred.
|
return qfalse; // An error occurred.
|
||||||
}
|
}
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
@ -2566,7 +2566,7 @@ You can also seek to a specific frame like so:
|
||||||
```c
|
```c
|
||||||
ma_result result = ma_decoder_seek_to_pcm_frame(pDecoder, targetFrame);
|
ma_result result = ma_decoder_seek_to_pcm_frame(pDecoder, targetFrame);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
return false; // An error occurred.
|
return qfalse; // An error occurred.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -3419,7 +3419,7 @@ The amplitude and seed can be changed dynamically with `ma_noise_set_amplitude()
|
||||||
|
|
||||||
By default, the noise API will use different values for different channels. So, for example, the
|
By default, the noise API will use different values for different channels. So, for example, the
|
||||||
left side in a stereo stream will be different to the right side. To instead have each channel use
|
left side in a stereo stream will be different to the right side. To instead have each channel use
|
||||||
the same random value, set the `duplicateChannels` member of the noise config to true, like so:
|
the same random value, set the `duplicateChannels` member of the noise config to qtrue, like so:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
config.duplicateChannels = MA_TRUE;
|
config.duplicateChannels = MA_TRUE;
|
||||||
|
|
@ -3501,7 +3501,7 @@ An audio buffer has a playback cursor just like a decoder. As you read frames fr
|
||||||
cursor moves forward. The last parameter (`loop`) can be used to determine if the buffer should
|
cursor moves forward. The last parameter (`loop`) can be used to determine if the buffer should
|
||||||
loop. The return value is the number of frames actually read. If this is less than the number of
|
loop. The return value is the number of frames actually read. If this is less than the number of
|
||||||
frames requested it means the end has been reached. This should never happen if the `loop`
|
frames requested it means the end has been reached. This should never happen if the `loop`
|
||||||
parameter is set to true. If you want to manually loop back to the start, you can do so with with
|
parameter is set to qtrue. If you want to manually loop back to the start, you can do so with with
|
||||||
`ma_audio_buffer_seek_to_pcm_frame(pAudioBuffer, 0)`. Below is an example for reading data from an
|
`ma_audio_buffer_seek_to_pcm_frame(pAudioBuffer, 0)`. Below is an example for reading data from an
|
||||||
audio buffer.
|
audio buffer.
|
||||||
|
|
||||||
|
|
@ -3643,7 +3643,7 @@ Some backends have some nuance details you may want to be aware of.
|
||||||
------------
|
------------
|
||||||
- Low-latency shared mode will be disabled when using an application-defined sample rate which is
|
- Low-latency shared mode will be disabled when using an application-defined sample rate which is
|
||||||
different to the device's native sample rate. To work around this, set `wasapi.noAutoConvertSRC`
|
different to the device's native sample rate. To work around this, set `wasapi.noAutoConvertSRC`
|
||||||
to true in the device config. This is due to IAudioClient3_InitializeSharedAudioStream() failing
|
to qtrue in the device config. This is due to IAudioClient3_InitializeSharedAudioStream() failing
|
||||||
when the `AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM` flag is specified. Setting wasapi.noAutoConvertSRC
|
when the `AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM` flag is specified. Setting wasapi.noAutoConvertSRC
|
||||||
will result in miniaudio's internal resampler being used instead which will in turn enable the
|
will result in miniaudio's internal resampler being used instead which will in turn enable the
|
||||||
use of low-latency shared mode.
|
use of low-latency shared mode.
|
||||||
|
|
@ -3709,11 +3709,11 @@ See below for some tips on improving performance.
|
||||||
16.1. Low Level API
|
16.1. Low Level API
|
||||||
-------------------
|
-------------------
|
||||||
- In the data callback, if your data is already clipped prior to copying it into the output buffer,
|
- In the data callback, if your data is already clipped prior to copying it into the output buffer,
|
||||||
set the `noClip` config option in the device config to true. This will disable miniaudio's built
|
set the `noClip` config option in the device config to qtrue. This will disable miniaudio's built
|
||||||
in clipping function.
|
in clipping function.
|
||||||
- By default, miniaudio will pre-silence the data callback's output buffer. If you know that you
|
- By default, miniaudio will pre-silence the data callback's output buffer. If you know that you
|
||||||
will always write valid data to the output buffer you can disable pre-silencing by setting the
|
will always write valid data to the output buffer you can disable pre-silencing by setting the
|
||||||
`noPreSilence` config option in the device config to true.
|
`noPreSilence` config option in the device config to qtrue.
|
||||||
|
|
||||||
16.2. High Level API
|
16.2. High Level API
|
||||||
--------------------
|
--------------------
|
||||||
|
|
@ -4976,7 +4976,7 @@ typedef struct
|
||||||
ma_uint32 channels;
|
ma_uint32 channels;
|
||||||
ma_uint32 sampleRate;
|
ma_uint32 sampleRate;
|
||||||
ma_uint32 delayInFrames;
|
ma_uint32 delayInFrames;
|
||||||
ma_bool32 delayStart; /* Set to true to delay the start of the output; false otherwise. */
|
ma_bool32 delayStart; /* Set to qtrue to delay the start of the output; qfalse otherwise. */
|
||||||
float wet; /* 0..1. Default = 1. */
|
float wet; /* 0..1. Default = 1. */
|
||||||
float dry; /* 0..1. Default = 1. */
|
float dry; /* 0..1. Default = 1. */
|
||||||
float decay; /* 0..1. Default = 0 (no feedback). Feedback decay. Use this for echo. */
|
float decay; /* 0..1. Default = 0 (no feedback). Feedback decay. Use this for echo. */
|
||||||
|
|
@ -5043,7 +5043,7 @@ MA_API ma_result ma_gainer_get_master_volume(const ma_gainer* pGainer, float* pV
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
ma_pan_mode_balance = 0, /* Does not blend one side with the other. Technically just a balance. Compatible with other popular audio engines and therefore the default. */
|
ma_pan_mode_balance = 0, /* Does not blend one side with the other. Technically just a balance. Compatible with other popular audio engines and therefore the default. */
|
||||||
ma_pan_mode_pan /* A true pan. The sound from one side will "move" to the other side and blend with it. */
|
ma_pan_mode_pan /* A qtrue pan. The sound from one side will "move" to the other side and blend with it. */
|
||||||
} ma_pan_mode;
|
} ma_pan_mode;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
@ -5519,7 +5519,7 @@ typedef struct
|
||||||
const ma_channel* pChannelMapIn;
|
const ma_channel* pChannelMapIn;
|
||||||
const ma_channel* pChannelMapOut;
|
const ma_channel* pChannelMapOut;
|
||||||
ma_channel_mix_mode mixingMode;
|
ma_channel_mix_mode mixingMode;
|
||||||
ma_bool32 calculateLFEFromSpatialChannels; /* When an output LFE channel is present, but no input LFE, set to true to set the output LFE to the average of all spatial channels (LR, FR, etc.). Ignored when an input LFE is present. */
|
ma_bool32 calculateLFEFromSpatialChannels; /* When an output LFE channel is present, but no input LFE, set to qtrue to set the output LFE to the average of all spatial channels (LR, FR, etc.). Ignored when an input LFE is present. */
|
||||||
float** ppWeights; /* [in][out]. Only used when mixingMode is set to ma_channel_mix_mode_custom_weights. */
|
float** ppWeights; /* [in][out]. Only used when mixingMode is set to ma_channel_mix_mode_custom_weights. */
|
||||||
} ma_channel_converter_config;
|
} ma_channel_converter_config;
|
||||||
|
|
||||||
|
|
@ -5572,7 +5572,7 @@ typedef struct
|
||||||
ma_channel* pChannelMapOut;
|
ma_channel* pChannelMapOut;
|
||||||
ma_dither_mode ditherMode;
|
ma_dither_mode ditherMode;
|
||||||
ma_channel_mix_mode channelMixMode;
|
ma_channel_mix_mode channelMixMode;
|
||||||
ma_bool32 calculateLFEFromSpatialChannels; /* When an output LFE channel is present, but no input LFE, set to true to set the output LFE to the average of all spatial channels (LR, FR, etc.). Ignored when an input LFE is present. */
|
ma_bool32 calculateLFEFromSpatialChannels; /* When an output LFE channel is present, but no input LFE, set to qtrue to set the output LFE to the average of all spatial channels (LR, FR, etc.). Ignored when an input LFE is present. */
|
||||||
float** ppChannelWeights; /* [in][out]. Only used when mixingMode is set to ma_channel_mix_mode_custom_weights. */
|
float** ppChannelWeights; /* [in][out]. Only used when mixingMode is set to ma_channel_mix_mode_custom_weights. */
|
||||||
ma_bool32 allowDynamicSampleRate;
|
ma_bool32 allowDynamicSampleRate;
|
||||||
ma_resampler_config resampling;
|
ma_resampler_config resampling;
|
||||||
|
|
@ -5905,7 +5905,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
ma_audio_buffer_ref ref;
|
ma_audio_buffer_ref ref;
|
||||||
ma_allocation_callbacks allocationCallbacks;
|
ma_allocation_callbacks allocationCallbacks;
|
||||||
ma_bool32 ownsData; /* Used to control whether or not miniaudio owns the data buffer. If set to true, pData will be freed in ma_audio_buffer_uninit(). */
|
ma_bool32 ownsData; /* Used to control whether or not miniaudio owns the data buffer. If set to qtrue, pData will be freed in ma_audio_buffer_uninit(). */
|
||||||
ma_uint8 _pExtraData[1]; /* For allocating a buffer with the memory located directly after the other memory of the structure. */
|
ma_uint8 _pExtraData[1]; /* For allocating a buffer with the memory located directly after the other memory of the structure. */
|
||||||
} ma_audio_buffer;
|
} ma_audio_buffer;
|
||||||
|
|
||||||
|
|
@ -6722,7 +6722,7 @@ ma_device_job_thread_post(). The thread will do the processing of the job.
|
||||||
*/
|
*/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
ma_bool32 noThread; /* Set this to true if you want to process jobs yourself. */
|
ma_bool32 noThread; /* Set this to qtrue if you want to process jobs yourself. */
|
||||||
ma_uint32 jobQueueCapacity;
|
ma_uint32 jobQueueCapacity;
|
||||||
ma_uint32 jobQueueFlags;
|
ma_uint32 jobQueueFlags;
|
||||||
} ma_device_job_thread_config;
|
} ma_device_job_thread_config;
|
||||||
|
|
@ -7078,10 +7078,10 @@ struct ma_device_config
|
||||||
ma_uint32 periodSizeInMilliseconds;
|
ma_uint32 periodSizeInMilliseconds;
|
||||||
ma_uint32 periods;
|
ma_uint32 periods;
|
||||||
ma_performance_profile performanceProfile;
|
ma_performance_profile performanceProfile;
|
||||||
ma_bool8 noPreSilencedOutputBuffer; /* When set to true, the contents of the output buffer passed into the data callback will be left undefined rather than initialized to silence. */
|
ma_bool8 noPreSilencedOutputBuffer; /* When set to qtrue, the contents of the output buffer passed into the data callback will be left undefined rather than initialized to silence. */
|
||||||
ma_bool8 noClip; /* When set to true, the contents of the output buffer passed into the data callback will not be clipped after returning. Only applies when the playback sample format is f32. */
|
ma_bool8 noClip; /* When set to qtrue, the contents of the output buffer passed into the data callback will not be clipped after returning. Only applies when the playback sample format is f32. */
|
||||||
ma_bool8 noDisableDenormals; /* Do not disable denormals when firing the data callback. */
|
ma_bool8 noDisableDenormals; /* Do not disable denormals when firing the data callback. */
|
||||||
ma_bool8 noFixedSizedCallback; /* Disables strict fixed-sized data callbacks. Setting this to true will result in the period size being treated only as a hint to the backend. This is an optimization for those who don't need fixed sized callbacks. */
|
ma_bool8 noFixedSizedCallback; /* Disables strict fixed-sized data callbacks. Setting this to qtrue will result in the period size being treated only as a hint to the backend. This is an optimization for those who don't need fixed sized callbacks. */
|
||||||
ma_device_data_proc dataCallback;
|
ma_device_data_proc dataCallback;
|
||||||
ma_device_notification_proc notificationCallback;
|
ma_device_notification_proc notificationCallback;
|
||||||
ma_stop_proc stopCallback;
|
ma_stop_proc stopCallback;
|
||||||
|
|
@ -7094,7 +7094,7 @@ struct ma_device_config
|
||||||
ma_uint32 channels;
|
ma_uint32 channels;
|
||||||
ma_channel* pChannelMap;
|
ma_channel* pChannelMap;
|
||||||
ma_channel_mix_mode channelMixMode;
|
ma_channel_mix_mode channelMixMode;
|
||||||
ma_bool32 calculateLFEFromSpatialChannels; /* When an output LFE channel is present, but no input LFE, set to true to set the output LFE to the average of all spatial channels (LR, FR, etc.). Ignored when an input LFE is present. */
|
ma_bool32 calculateLFEFromSpatialChannels; /* When an output LFE channel is present, but no input LFE, set to qtrue to set the output LFE to the average of all spatial channels (LR, FR, etc.). Ignored when an input LFE is present. */
|
||||||
ma_share_mode shareMode;
|
ma_share_mode shareMode;
|
||||||
} playback;
|
} playback;
|
||||||
struct
|
struct
|
||||||
|
|
@ -7104,19 +7104,19 @@ struct ma_device_config
|
||||||
ma_uint32 channels;
|
ma_uint32 channels;
|
||||||
ma_channel* pChannelMap;
|
ma_channel* pChannelMap;
|
||||||
ma_channel_mix_mode channelMixMode;
|
ma_channel_mix_mode channelMixMode;
|
||||||
ma_bool32 calculateLFEFromSpatialChannels; /* When an output LFE channel is present, but no input LFE, set to true to set the output LFE to the average of all spatial channels (LR, FR, etc.). Ignored when an input LFE is present. */
|
ma_bool32 calculateLFEFromSpatialChannels; /* When an output LFE channel is present, but no input LFE, set to qtrue to set the output LFE to the average of all spatial channels (LR, FR, etc.). Ignored when an input LFE is present. */
|
||||||
ma_share_mode shareMode;
|
ma_share_mode shareMode;
|
||||||
} capture;
|
} capture;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
ma_wasapi_usage usage; /* When configured, uses Avrt APIs to set the thread characteristics. */
|
ma_wasapi_usage usage; /* When configured, uses Avrt APIs to set the thread characteristics. */
|
||||||
ma_bool8 noAutoConvertSRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */
|
ma_bool8 noAutoConvertSRC; /* When set to qtrue, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */
|
||||||
ma_bool8 noDefaultQualitySRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */
|
ma_bool8 noDefaultQualitySRC; /* When set to qtrue, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */
|
||||||
ma_bool8 noAutoStreamRouting; /* Disables automatic stream routing. */
|
ma_bool8 noAutoStreamRouting; /* Disables automatic stream routing. */
|
||||||
ma_bool8 noHardwareOffloading; /* Disables WASAPI's hardware offloading feature. */
|
ma_bool8 noHardwareOffloading; /* Disables WASAPI's hardware offloading feature. */
|
||||||
ma_uint32 loopbackProcessID; /* The process ID to include or exclude for loopback mode. Set to 0 to capture audio from all processes. Ignored when an explicit device ID is specified. */
|
ma_uint32 loopbackProcessID; /* The process ID to include or exclude for loopback mode. Set to 0 to capture audio from all processes. Ignored when an explicit device ID is specified. */
|
||||||
ma_bool8 loopbackProcessExclude; /* When set to true, excludes the process specified by loopbackProcessID. By default, the process will be included. */
|
ma_bool8 loopbackProcessExclude; /* When set to qtrue, excludes the process specified by loopbackProcessID. By default, the process will be included. */
|
||||||
} wasapi;
|
} wasapi;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|
@ -7230,7 +7230,7 @@ internally by miniaudio.
|
||||||
|
|
||||||
On input, if the sample format is set to `ma_format_unknown`, the backend is free to use whatever sample format it desires, so long as it's
|
On input, if the sample format is set to `ma_format_unknown`, the backend is free to use whatever sample format it desires, so long as it's
|
||||||
supported by miniaudio. When the channel count is set to 0, the backend should use the device's native channel count. The same applies for
|
supported by miniaudio. When the channel count is set to 0, the backend should use the device's native channel count. The same applies for
|
||||||
sample rate. For the channel map, the default should be used when `ma_channel_map_is_blank()` returns true (all channels set to
|
sample rate. For the channel map, the default should be used when `ma_channel_map_is_blank()` returns qtrue (all channels set to
|
||||||
`MA_CHANNEL_NONE`). On input, the `periodSizeInFrames` or `periodSizeInMilliseconds` option should always be set. The backend should
|
`MA_CHANNEL_NONE`). On input, the `periodSizeInFrames` or `periodSizeInMilliseconds` option should always be set. The backend should
|
||||||
inspect both of these variables. If `periodSizeInFrames` is set, it should take priority, otherwise it needs to be derived from the period
|
inspect both of these variables. If `periodSizeInFrames` is set, it should take priority, otherwise it needs to be derived from the period
|
||||||
size in milliseconds (`periodSizeInMilliseconds`) and the sample rate, keeping in mind that the sample rate may be 0, in which case the
|
size in milliseconds (`periodSizeInMilliseconds`) and the sample rate, keeping in mind that the sample rate may be 0, in which case the
|
||||||
|
|
@ -7303,8 +7303,8 @@ struct ma_context_config
|
||||||
{
|
{
|
||||||
ma_ios_session_category sessionCategory;
|
ma_ios_session_category sessionCategory;
|
||||||
ma_uint32 sessionCategoryOptions;
|
ma_uint32 sessionCategoryOptions;
|
||||||
ma_bool32 noAudioSessionActivate; /* iOS only. When set to true, does not perform an explicit [[AVAudioSession sharedInstace] setActive:true] on initialization. */
|
ma_bool32 noAudioSessionActivate; /* iOS only. When set to qtrue, does not perform an explicit [[AVAudioSession sharedInstace] setActive:qtrue] on initialization. */
|
||||||
ma_bool32 noAudioSessionDeactivate; /* iOS only. When set to true, does not perform an explicit [[AVAudioSession sharedInstace] setActive:false] on uninitialization. */
|
ma_bool32 noAudioSessionDeactivate; /* iOS only. When set to qtrue, does not perform an explicit [[AVAudioSession sharedInstace] setActive:qfalse] on uninitialization. */
|
||||||
} coreaudio;
|
} coreaudio;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|
@ -7764,7 +7764,7 @@ struct ma_device
|
||||||
ma_event stopEvent;
|
ma_event stopEvent;
|
||||||
ma_thread thread;
|
ma_thread thread;
|
||||||
ma_result workResult; /* This is set by the worker thread after it's finished doing a job. */
|
ma_result workResult; /* This is set by the worker thread after it's finished doing a job. */
|
||||||
ma_bool8 isOwnerOfContext; /* When set to true, uninitializing the device will also uninitialize the context. Set to true when NULL is passed into ma_device_init(). */
|
ma_bool8 isOwnerOfContext; /* When set to qtrue, uninitializing the device will also uninitialize the context. Set to qtrue when NULL is passed into ma_device_init(). */
|
||||||
ma_bool8 noPreSilencedOutputBuffer;
|
ma_bool8 noPreSilencedOutputBuffer;
|
||||||
ma_bool8 noClip;
|
ma_bool8 noClip;
|
||||||
ma_bool8 noDisableDenormals;
|
ma_bool8 noDisableDenormals;
|
||||||
|
|
@ -7861,8 +7861,8 @@ struct ma_device
|
||||||
ma_atomic_bool32 isStartedPlayback; /* Can be read and written simultaneously across different threads. Must be used atomically, and must be 32-bit. */
|
ma_atomic_bool32 isStartedPlayback; /* Can be read and written simultaneously across different threads. Must be used atomically, and must be 32-bit. */
|
||||||
ma_uint32 loopbackProcessID;
|
ma_uint32 loopbackProcessID;
|
||||||
ma_bool8 loopbackProcessExclude;
|
ma_bool8 loopbackProcessExclude;
|
||||||
ma_bool8 noAutoConvertSRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */
|
ma_bool8 noAutoConvertSRC; /* When set to qtrue, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */
|
||||||
ma_bool8 noDefaultQualitySRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */
|
ma_bool8 noDefaultQualitySRC; /* When set to qtrue, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */
|
||||||
ma_bool8 noHardwareOffloading;
|
ma_bool8 noHardwareOffloading;
|
||||||
ma_bool8 allowCaptureAutoStreamRouting;
|
ma_bool8 allowCaptureAutoStreamRouting;
|
||||||
ma_bool8 allowPlaybackAutoStreamRouting;
|
ma_bool8 allowPlaybackAutoStreamRouting;
|
||||||
|
|
@ -7952,8 +7952,8 @@ struct ma_device
|
||||||
ma_performance_profile originalPerformanceProfile;
|
ma_performance_profile originalPerformanceProfile;
|
||||||
ma_bool32 isDefaultPlaybackDevice;
|
ma_bool32 isDefaultPlaybackDevice;
|
||||||
ma_bool32 isDefaultCaptureDevice;
|
ma_bool32 isDefaultCaptureDevice;
|
||||||
ma_bool32 isSwitchingPlaybackDevice; /* <-- Set to true when the default device has changed and miniaudio is in the process of switching. */
|
ma_bool32 isSwitchingPlaybackDevice; /* <-- Set to qtrue when the default device has changed and miniaudio is in the process of switching. */
|
||||||
ma_bool32 isSwitchingCaptureDevice; /* <-- Set to true when the default device has changed and miniaudio is in the process of switching. */
|
ma_bool32 isSwitchingCaptureDevice; /* <-- Set to qtrue when the default device has changed and miniaudio is in the process of switching. */
|
||||||
void* pNotificationHandler; /* Only used on mobile platforms. Obj-C object for handling route changes. */
|
void* pNotificationHandler; /* Only used on mobile platforms. Obj-C object for handling route changes. */
|
||||||
} coreaudio;
|
} coreaudio;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -8164,7 +8164,7 @@ can then be set directly on the structure. Below are the members of the `ma_cont
|
||||||
alsa.useVerboseDeviceEnumeration
|
alsa.useVerboseDeviceEnumeration
|
||||||
ALSA will typically enumerate many different devices which can be intrusive and not user-friendly. To combat this, miniaudio will enumerate only unique
|
ALSA will typically enumerate many different devices which can be intrusive and not user-friendly. To combat this, miniaudio will enumerate only unique
|
||||||
card/device pairs by default. The problem with this is that you lose a bit of flexibility and control. Setting alsa.useVerboseDeviceEnumeration makes
|
card/device pairs by default. The problem with this is that you lose a bit of flexibility and control. Setting alsa.useVerboseDeviceEnumeration makes
|
||||||
it so the ALSA backend includes all devices. Defaults to false.
|
it so the ALSA backend includes all devices. Defaults to qfalse.
|
||||||
|
|
||||||
pulse.pApplicationName
|
pulse.pApplicationName
|
||||||
PulseAudio only. The application name to use when initializing the PulseAudio context with `pa_context_new()`.
|
PulseAudio only. The application name to use when initializing the PulseAudio context with `pa_context_new()`.
|
||||||
|
|
@ -8173,7 +8173,7 @@ can then be set directly on the structure. Below are the members of the `ma_cont
|
||||||
PulseAudio only. The name of the server to connect to with `pa_context_connect()`.
|
PulseAudio only. The name of the server to connect to with `pa_context_connect()`.
|
||||||
|
|
||||||
pulse.tryAutoSpawn
|
pulse.tryAutoSpawn
|
||||||
PulseAudio only. Whether or not to try automatically starting the PulseAudio daemon. Defaults to false. If you set this to true, keep in mind that
|
PulseAudio only. Whether or not to try automatically starting the PulseAudio daemon. Defaults to qfalse. If you set this to qtrue, keep in mind that
|
||||||
miniaudio uses a trial and error method to find the most appropriate backend, and this will result in the PulseAudio daemon starting which may be
|
miniaudio uses a trial and error method to find the most appropriate backend, and this will result in the PulseAudio daemon starting which may be
|
||||||
intrusive for the end user.
|
intrusive for the end user.
|
||||||
|
|
||||||
|
|
@ -8209,16 +8209,16 @@ can then be set directly on the structure. Below are the members of the `ma_cont
|
||||||
|---------------------------------------------------------------------------|------------------------------------------------------------------|
|
|---------------------------------------------------------------------------|------------------------------------------------------------------|
|
||||||
|
|
||||||
coreaudio.noAudioSessionActivate
|
coreaudio.noAudioSessionActivate
|
||||||
iOS only. When set to true, does not perform an explicit [[AVAudioSession sharedInstace] setActive:true] on initialization.
|
iOS only. When set to qtrue, does not perform an explicit [[AVAudioSession sharedInstace] setActive:qtrue] on initialization.
|
||||||
|
|
||||||
coreaudio.noAudioSessionDeactivate
|
coreaudio.noAudioSessionDeactivate
|
||||||
iOS only. When set to true, does not perform an explicit [[AVAudioSession sharedInstace] setActive:false] on uninitialization.
|
iOS only. When set to qtrue, does not perform an explicit [[AVAudioSession sharedInstace] setActive:qfalse] on uninitialization.
|
||||||
|
|
||||||
jack.pClientName
|
jack.pClientName
|
||||||
The name of the client to pass to `jack_client_open()`.
|
The name of the client to pass to `jack_client_open()`.
|
||||||
|
|
||||||
jack.tryStartServer
|
jack.tryStartServer
|
||||||
Whether or not to try auto-starting the JACK server. Defaults to false.
|
Whether or not to try auto-starting the JACK server. Defaults to qfalse.
|
||||||
|
|
||||||
|
|
||||||
It is recommended that only a single context is active at any given time because it's a bulky data structure which performs run-time linking for the
|
It is recommended that only a single context is active at any given time because it's a bulky data structure which performs run-time linking for the
|
||||||
|
|
@ -8346,7 +8346,7 @@ Note that this only retrieves the ID and name/description of the device. The rea
|
||||||
opening the backend device in order to probe it for more detailed information which can be inefficient. Consider using `ma_context_get_device_info()` for this,
|
opening the backend device in order to probe it for more detailed information which can be inefficient. Consider using `ma_context_get_device_info()` for this,
|
||||||
but don't call it from within the enumeration callback.
|
but don't call it from within the enumeration callback.
|
||||||
|
|
||||||
Returning false from the callback will stop enumeration. Returning true will continue enumeration.
|
Returning qfalse from the callback will stop enumeration. Returning qtrue will continue enumeration.
|
||||||
|
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
|
|
@ -8670,21 +8670,21 @@ then be set directly on the structure. Below are the members of the `ma_device_c
|
||||||
`ma_performance_profile_conservative`. This mainly affects the size of default buffers and can usually be left at its default value.
|
`ma_performance_profile_conservative`. This mainly affects the size of default buffers and can usually be left at its default value.
|
||||||
|
|
||||||
noPreSilencedOutputBuffer
|
noPreSilencedOutputBuffer
|
||||||
When set to true, the contents of the output buffer passed into the data callback will be left undefined. When set to false (default), the contents of
|
When set to qtrue, the contents of the output buffer passed into the data callback will be left undefined. When set to qfalse (default), the contents of
|
||||||
the output buffer will be cleared the zero. You can use this to avoid the overhead of zeroing out the buffer if you can guarantee that your data
|
the output buffer will be cleared the zero. You can use this to avoid the overhead of zeroing out the buffer if you can guarantee that your data
|
||||||
callback will write to every sample in the output buffer, or if you are doing your own clearing.
|
callback will write to every sample in the output buffer, or if you are doing your own clearing.
|
||||||
|
|
||||||
noClip
|
noClip
|
||||||
When set to true, the contents of the output buffer are left alone after returning and it will be left up to the backend itself to decide whether or
|
When set to qtrue, the contents of the output buffer are left alone after returning and it will be left up to the backend itself to decide whether or
|
||||||
not to clip. When set to false (default), the contents of the output buffer passed into the data callback will be clipped after returning. This only
|
not to clip. When set to qfalse (default), the contents of the output buffer passed into the data callback will be clipped after returning. This only
|
||||||
applies when the playback sample format is f32.
|
applies when the playback sample format is f32.
|
||||||
|
|
||||||
noDisableDenormals
|
noDisableDenormals
|
||||||
By default, miniaudio will disable denormals when the data callback is called. Setting this to true will prevent the disabling of denormals.
|
By default, miniaudio will disable denormals when the data callback is called. Setting this to qtrue will prevent the disabling of denormals.
|
||||||
|
|
||||||
noFixedSizedCallback
|
noFixedSizedCallback
|
||||||
Allows miniaudio to fire the data callback with any frame count. When this is set to false (the default), the data callback will be fired with a
|
Allows miniaudio to fire the data callback with any frame count. When this is set to qfalse (the default), the data callback will be fired with a
|
||||||
consistent frame count as specified by `periodSizeInFrames` or `periodSizeInMilliseconds`. When set to true, miniaudio will fire the callback with
|
consistent frame count as specified by `periodSizeInFrames` or `periodSizeInMilliseconds`. When set to qtrue, miniaudio will fire the callback with
|
||||||
whatever the backend requests, which could be anything.
|
whatever the backend requests, which could be anything.
|
||||||
|
|
||||||
dataCallback
|
dataCallback
|
||||||
|
|
@ -8754,29 +8754,29 @@ then be set directly on the structure. Below are the members of the `ma_device_c
|
||||||
ma_share_mode_shared and reinitializing.
|
ma_share_mode_shared and reinitializing.
|
||||||
|
|
||||||
wasapi.noAutoConvertSRC
|
wasapi.noAutoConvertSRC
|
||||||
WASAPI only. When set to true, disables WASAPI's automatic resampling and forces the use of miniaudio's resampler. Defaults to false.
|
WASAPI only. When set to qtrue, disables WASAPI's automatic resampling and forces the use of miniaudio's resampler. Defaults to qfalse.
|
||||||
|
|
||||||
wasapi.noDefaultQualitySRC
|
wasapi.noDefaultQualitySRC
|
||||||
WASAPI only. Only used when `wasapi.noAutoConvertSRC` is set to false. When set to true, disables the use of `AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY`.
|
WASAPI only. Only used when `wasapi.noAutoConvertSRC` is set to qfalse. When set to qtrue, disables the use of `AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY`.
|
||||||
You should usually leave this set to false, which is the default.
|
You should usually leave this set to qfalse, which is the default.
|
||||||
|
|
||||||
wasapi.noAutoStreamRouting
|
wasapi.noAutoStreamRouting
|
||||||
WASAPI only. When set to true, disables automatic stream routing on the WASAPI backend. Defaults to false.
|
WASAPI only. When set to qtrue, disables automatic stream routing on the WASAPI backend. Defaults to qfalse.
|
||||||
|
|
||||||
wasapi.noHardwareOffloading
|
wasapi.noHardwareOffloading
|
||||||
WASAPI only. When set to true, disables the use of WASAPI's hardware offloading feature. Defaults to false.
|
WASAPI only. When set to qtrue, disables the use of WASAPI's hardware offloading feature. Defaults to qfalse.
|
||||||
|
|
||||||
alsa.noMMap
|
alsa.noMMap
|
||||||
ALSA only. When set to true, disables MMap mode. Defaults to false.
|
ALSA only. When set to qtrue, disables MMap mode. Defaults to qfalse.
|
||||||
|
|
||||||
alsa.noAutoFormat
|
alsa.noAutoFormat
|
||||||
ALSA only. When set to true, disables ALSA's automatic format conversion by including the SND_PCM_NO_AUTO_FORMAT flag. Defaults to false.
|
ALSA only. When set to qtrue, disables ALSA's automatic format conversion by including the SND_PCM_NO_AUTO_FORMAT flag. Defaults to qfalse.
|
||||||
|
|
||||||
alsa.noAutoChannels
|
alsa.noAutoChannels
|
||||||
ALSA only. When set to true, disables ALSA's automatic channel conversion by including the SND_PCM_NO_AUTO_CHANNELS flag. Defaults to false.
|
ALSA only. When set to qtrue, disables ALSA's automatic channel conversion by including the SND_PCM_NO_AUTO_CHANNELS flag. Defaults to qfalse.
|
||||||
|
|
||||||
alsa.noAutoResample
|
alsa.noAutoResample
|
||||||
ALSA only. When set to true, disables ALSA's automatic resampling by including the SND_PCM_NO_AUTO_RESAMPLE flag. Defaults to false.
|
ALSA only. When set to qtrue, disables ALSA's automatic resampling by including the SND_PCM_NO_AUTO_RESAMPLE flag. Defaults to qfalse.
|
||||||
|
|
||||||
pulse.pStreamNamePlayback
|
pulse.pStreamNamePlayback
|
||||||
PulseAudio only. Sets the stream name for playback.
|
PulseAudio only. Sets the stream name for playback.
|
||||||
|
|
@ -8790,9 +8790,9 @@ then be set directly on the structure. Below are the members of the `ma_device_c
|
||||||
coreaudio.allowNominalSampleRateChange
|
coreaudio.allowNominalSampleRateChange
|
||||||
Core Audio only. Desktop only. When enabled, allows the sample rate of the device to be changed at the operating system level. This
|
Core Audio only. Desktop only. When enabled, allows the sample rate of the device to be changed at the operating system level. This
|
||||||
is disabled by default in order to prevent intrusive changes to the user's system. This is useful if you want to use a sample rate
|
is disabled by default in order to prevent intrusive changes to the user's system. This is useful if you want to use a sample rate
|
||||||
that is known to be natively supported by the hardware thereby avoiding the cost of resampling. When set to true, miniaudio will
|
that is known to be natively supported by the hardware thereby avoiding the cost of resampling. When set to qtrue, miniaudio will
|
||||||
find the closest match between the sample rate requested in the device config and the sample rates natively supported by the
|
find the closest match between the sample rate requested in the device config and the sample rates natively supported by the
|
||||||
hardware. When set to false, the sample rate currently set by the operating system will always be used.
|
hardware. When set to qfalse, the sample rate currently set by the operating system will always be used.
|
||||||
|
|
||||||
opensl.streamType
|
opensl.streamType
|
||||||
OpenSL only. Explicitly sets the stream type. If left unset (`ma_opensl_stream_type_default`), the
|
OpenSL only. Explicitly sets the stream type. If left unset (`ma_opensl_stream_type_default`), the
|
||||||
|
|
@ -8815,7 +8815,7 @@ then be set directly on the structure. Below are the members of the `ma_device_c
|
||||||
|
|
||||||
aaudio.noAutoStartAfterReroute
|
aaudio.noAutoStartAfterReroute
|
||||||
AAudio only. Controls whether or not the device should be automatically restarted after a
|
AAudio only. Controls whether or not the device should be automatically restarted after a
|
||||||
stream reroute. When set to false (default) the device will be restarted automatically;
|
stream reroute. When set to qfalse (default) the device will be restarted automatically;
|
||||||
otherwise the device will be stopped.
|
otherwise the device will be stopped.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -9211,7 +9211,7 @@ pDevice (in)
|
||||||
|
|
||||||
Return Value
|
Return Value
|
||||||
------------
|
------------
|
||||||
True if the device is started, false otherwise.
|
True if the device is started, qfalse otherwise.
|
||||||
|
|
||||||
|
|
||||||
Thread Safety
|
Thread Safety
|
||||||
|
|
@ -10405,7 +10405,7 @@ struct ma_resource_manager_data_buffer_node
|
||||||
MA_ATOMIC(4, ma_result) result; /* Result from asynchronous loading. When loading set to MA_BUSY. When fully loaded set to MA_SUCCESS. When deleting set to MA_UNAVAILABLE. */
|
MA_ATOMIC(4, ma_result) result; /* Result from asynchronous loading. When loading set to MA_BUSY. When fully loaded set to MA_SUCCESS. When deleting set to MA_UNAVAILABLE. */
|
||||||
MA_ATOMIC(4, ma_uint32) executionCounter; /* For allocating execution orders for jobs. */
|
MA_ATOMIC(4, ma_uint32) executionCounter; /* For allocating execution orders for jobs. */
|
||||||
MA_ATOMIC(4, ma_uint32) executionPointer; /* For managing the order of execution for asynchronous jobs relating to this object. Incremented as jobs complete processing. */
|
MA_ATOMIC(4, ma_uint32) executionPointer; /* For managing the order of execution for asynchronous jobs relating to this object. Incremented as jobs complete processing. */
|
||||||
ma_bool32 isDataOwnedByResourceManager; /* Set to true when the underlying data buffer was allocated the resource manager. Set to false if it is owned by the application (via ma_resource_manager_register_*()). */
|
ma_bool32 isDataOwnedByResourceManager; /* Set to qtrue when the underlying data buffer was allocated the resource manager. Set to qfalse if it is owned by the application (via ma_resource_manager_register_*()). */
|
||||||
ma_resource_manager_data_supply data;
|
ma_resource_manager_data_supply data;
|
||||||
ma_resource_manager_data_buffer_node* pParent;
|
ma_resource_manager_data_buffer_node* pParent;
|
||||||
ma_resource_manager_data_buffer_node* pChildLo;
|
ma_resource_manager_data_buffer_node* pChildLo;
|
||||||
|
|
@ -10457,7 +10457,7 @@ struct ma_resource_manager_data_stream
|
||||||
/* Written and read by both the public API and the job thread. These must be atomic. */
|
/* Written and read by both the public API and the job thread. These must be atomic. */
|
||||||
MA_ATOMIC(4, ma_result) result; /* Result from asynchronous loading. When loading set to MA_BUSY. When initialized set to MA_SUCCESS. When deleting set to MA_UNAVAILABLE. If an error occurs when loading, set to an error code. */
|
MA_ATOMIC(4, ma_result) result; /* Result from asynchronous loading. When loading set to MA_BUSY. When initialized set to MA_SUCCESS. When deleting set to MA_UNAVAILABLE. If an error occurs when loading, set to an error code. */
|
||||||
MA_ATOMIC(4, ma_bool32) isDecoderAtEnd; /* Whether or not the decoder has reached the end. */
|
MA_ATOMIC(4, ma_bool32) isDecoderAtEnd; /* Whether or not the decoder has reached the end. */
|
||||||
MA_ATOMIC(4, ma_bool32) isPageValid[2]; /* Booleans to indicate whether or not a page is valid. Set to false by the public API, set to true by the job thread. Set to false as the pages are consumed, true when they are filled. */
|
MA_ATOMIC(4, ma_bool32) isPageValid[2]; /* Booleans to indicate whether or not a page is valid. Set to qfalse by the public API, set to qtrue by the job thread. Set to qfalse as the pages are consumed, qtrue when they are filled. */
|
||||||
MA_ATOMIC(4, ma_bool32) seekCounter; /* When 0, no seeking is being performed. When > 0, a seek is being performed and reading should be delayed with MA_BUSY. */
|
MA_ATOMIC(4, ma_bool32) seekCounter; /* When 0, no seeking is being performed. When > 0, a seek is being performed and reading should be delayed with MA_BUSY. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -10756,7 +10756,7 @@ struct ma_node_base
|
||||||
ma_node_input_bus _inputBuses[MA_MAX_NODE_LOCAL_BUS_COUNT];
|
ma_node_input_bus _inputBuses[MA_MAX_NODE_LOCAL_BUS_COUNT];
|
||||||
ma_node_output_bus _outputBuses[MA_MAX_NODE_LOCAL_BUS_COUNT];
|
ma_node_output_bus _outputBuses[MA_MAX_NODE_LOCAL_BUS_COUNT];
|
||||||
void* _pHeap; /* A heap allocation for internal use only. pInputBuses and/or pOutputBuses will point to this if the bus count exceeds MA_MAX_NODE_LOCAL_BUS_COUNT. */
|
void* _pHeap; /* A heap allocation for internal use only. pInputBuses and/or pOutputBuses will point to this if the bus count exceeds MA_MAX_NODE_LOCAL_BUS_COUNT. */
|
||||||
ma_bool32 _ownsHeap; /* If set to true, the node owns the heap allocation and _pHeap will be freed in ma_node_uninit(). */
|
ma_bool32 _ownsHeap; /* If set to qtrue, the node owns the heap allocation and _pHeap will be freed in ma_node_uninit(). */
|
||||||
};
|
};
|
||||||
|
|
||||||
MA_API ma_result ma_node_get_heap_size(ma_node_graph* pNodeGraph, const ma_node_config* pConfig, size_t* pHeapSizeInBytes);
|
MA_API ma_result ma_node_get_heap_size(ma_node_graph* pNodeGraph, const ma_node_config* pConfig, size_t* pHeapSizeInBytes);
|
||||||
|
|
@ -11145,8 +11145,8 @@ typedef struct
|
||||||
MA_ATOMIC(4, float) pitch;
|
MA_ATOMIC(4, float) pitch;
|
||||||
float oldPitch; /* For determining whether or not the resampler needs to be updated to reflect the new pitch. The resampler will be updated on the mixing thread. */
|
float oldPitch; /* For determining whether or not the resampler needs to be updated to reflect the new pitch. The resampler will be updated on the mixing thread. */
|
||||||
float oldDopplerPitch; /* For determining whether or not the resampler needs to be updated to take a new doppler pitch into account. */
|
float oldDopplerPitch; /* For determining whether or not the resampler needs to be updated to take a new doppler pitch into account. */
|
||||||
MA_ATOMIC(4, ma_bool32) isPitchDisabled; /* When set to true, pitching will be disabled which will allow the resampler to be bypassed to save some computation. */
|
MA_ATOMIC(4, ma_bool32) isPitchDisabled; /* When set to qtrue, pitching will be disabled which will allow the resampler to be bypassed to save some computation. */
|
||||||
MA_ATOMIC(4, ma_bool32) isSpatializationDisabled; /* Set to false by default. When set to false, will not have spatialisation applied. */
|
MA_ATOMIC(4, ma_bool32) isSpatializationDisabled; /* Set to qfalse by default. When set to qfalse, will not have spatialisation applied. */
|
||||||
MA_ATOMIC(4, ma_uint32) pinnedListenerIndex; /* The index of the listener this node should always use for spatialization. If set to MA_LISTENER_INDEX_CLOSEST the engine will use the closest listener. */
|
MA_ATOMIC(4, ma_uint32) pinnedListenerIndex; /* The index of the listener this node should always use for spatialization. If set to MA_LISTENER_INDEX_CLOSEST the engine will use the closest listener. */
|
||||||
|
|
||||||
/* When setting a fade, it's not done immediately in ma_sound_set_fade(). It's deferred to the audio thread which means we need to store the settings here. */
|
/* When setting a fade, it's not done immediately in ma_sound_set_fade(). It's deferred to the audio thread which means we need to store the settings here. */
|
||||||
|
|
@ -11263,8 +11263,8 @@ typedef struct
|
||||||
ma_uint32 defaultVolumeSmoothTimeInPCMFrames; /* Defaults to 0. Controls the default amount of smoothing to apply to volume changes to sounds. High values means more smoothing at the expense of high latency (will take longer to reach the new volume). */
|
ma_uint32 defaultVolumeSmoothTimeInPCMFrames; /* Defaults to 0. Controls the default amount of smoothing to apply to volume changes to sounds. High values means more smoothing at the expense of high latency (will take longer to reach the new volume). */
|
||||||
ma_uint32 preMixStackSizeInBytes; /* A stack is used for internal processing in the node graph. This allows you to configure the size of this stack. Smaller values will reduce the maximum depth of your node graph. You should rarely need to modify this. */
|
ma_uint32 preMixStackSizeInBytes; /* A stack is used for internal processing in the node graph. This allows you to configure the size of this stack. Smaller values will reduce the maximum depth of your node graph. You should rarely need to modify this. */
|
||||||
ma_allocation_callbacks allocationCallbacks;
|
ma_allocation_callbacks allocationCallbacks;
|
||||||
ma_bool32 noAutoStart; /* When set to true, requires an explicit call to ma_engine_start(). This is false by default, meaning the engine will be started automatically in ma_engine_init(). */
|
ma_bool32 noAutoStart; /* When set to qtrue, requires an explicit call to ma_engine_start(). This is qfalse by default, meaning the engine will be started automatically in ma_engine_init(). */
|
||||||
ma_bool32 noDevice; /* When set to true, don't create a default device. ma_engine_read_pcm_frames() can be called manually to read data. */
|
ma_bool32 noDevice; /* When set to qtrue, don't create a default device. ma_engine_read_pcm_frames() can be called manually to read data. */
|
||||||
ma_mono_expansion_mode monoExpansionMode; /* Controls how the mono channel should be expanded to other channels when spatialization is disabled on a sound. */
|
ma_mono_expansion_mode monoExpansionMode; /* Controls how the mono channel should be expanded to other channels when spatialization is disabled on a sound. */
|
||||||
ma_vfs* pResourceManagerVFS; /* A pointer to a pre-allocated VFS object to use with the resource manager. This is ignored if pResourceManager is not NULL. */
|
ma_vfs* pResourceManagerVFS; /* A pointer to a pre-allocated VFS object to use with the resource manager. This is ignored if pResourceManager is not NULL. */
|
||||||
ma_engine_process_proc onProcess; /* Fired at the end of each call to ma_engine_read_pcm_frames(). For engine's that manage their own internal device (the default configuration), this will be fired from the audio thread, and you do not need to call ma_engine_read_pcm_frames() manually in order to trigger this. */
|
ma_engine_process_proc onProcess; /* Fired at the end of each call to ma_engine_read_pcm_frames(). For engine's that manage their own internal device (the default configuration), this will be fired from the audio thread, and you do not need to call ma_engine_read_pcm_frames() manually in order to trigger this. */
|
||||||
|
|
@ -17389,7 +17389,7 @@ MA_API ma_result ma_slot_allocator_free(ma_slot_allocator* pAllocator, ma_uint64
|
||||||
return MA_INVALID_ARGS;
|
return MA_INVALID_ARGS;
|
||||||
}
|
}
|
||||||
|
|
||||||
MA_ASSERT(iBit < 32); /* This must be true due to the logic we used to actually calculate it. */
|
MA_ASSERT(iBit < 32); /* This must be qtrue due to the logic we used to actually calculate it. */
|
||||||
|
|
||||||
while (ma_atomic_load_32(&pAllocator->count) > 0) {
|
while (ma_atomic_load_32(&pAllocator->count) > 0) {
|
||||||
/* CAS */
|
/* CAS */
|
||||||
|
|
@ -27127,14 +27127,14 @@ static ma_bool32 ma_is_device_name_in_hw_format__alsa(const char* hwid)
|
||||||
dev += 1; /* Skip past the ",". */
|
dev += 1; /* Skip past the ",". */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the part between the ":" and the "," contains only numbers. If not, return false. */
|
/* Check if the part between the ":" and the "," contains only numbers. If not, return qfalse. */
|
||||||
for (i = 0; i < commaPos; ++i) {
|
for (i = 0; i < commaPos; ++i) {
|
||||||
if (hwid[i] < '0' || hwid[i] > '9') {
|
if (hwid[i] < '0' || hwid[i] > '9') {
|
||||||
return MA_FALSE;
|
return MA_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if everything after the "," is numeric. If not, return false. */
|
/* Check if everything after the "," is numeric. If not, return qfalse. */
|
||||||
i = 0;
|
i = 0;
|
||||||
while (dev[i] != '\0') {
|
while (dev[i] != '\0') {
|
||||||
if (dev[i] < '0' || dev[i] > '9') {
|
if (dev[i] < '0' || dev[i] > '9') {
|
||||||
|
|
@ -27499,7 +27499,7 @@ static ma_result ma_context_enumerate_devices__alsa(ma_context* pContext, ma_enu
|
||||||
free(IOID);
|
free(IOID);
|
||||||
ppNextDeviceHint += 1;
|
ppNextDeviceHint += 1;
|
||||||
|
|
||||||
/* We need to stop enumeration if the callback returned false. */
|
/* We need to stop enumeration if the callback returned qfalse. */
|
||||||
if (stopEnumeration) {
|
if (stopEnumeration) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -34451,7 +34451,7 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev
|
||||||
Something that does seem to work, however, has been setting the nominal sample rate on the device object. The problem with
|
Something that does seem to work, however, has been setting the nominal sample rate on the device object. The problem with
|
||||||
this, however, is that it actually changes the sample rate at the operating system level and not just the application. This
|
this, however, is that it actually changes the sample rate at the operating system level and not just the application. This
|
||||||
could be intrusive to the user, however, so I don't think it's wise to make this the default. Instead I'm making this a
|
could be intrusive to the user, however, so I don't think it's wise to make this the default. Instead I'm making this a
|
||||||
configuration option. When the `coreaudio.allowNominalSampleRateChange` config option is set to true, changing the sample
|
configuration option. When the `coreaudio.allowNominalSampleRateChange` config option is set to qtrue, changing the sample
|
||||||
rate will be allowed. Otherwise it'll be fixed to the current sample rate. To check the system-defined sample rate, run
|
rate will be allowed. Otherwise it'll be fixed to the current sample rate. To check the system-defined sample rate, run
|
||||||
the Audio MIDI Setup program that comes installed on macOS and observe how the sample rate changes as the sample rate is
|
the Audio MIDI Setup program that comes installed on macOS and observe how the sample rate changes as the sample rate is
|
||||||
changed by miniaudio.
|
changed by miniaudio.
|
||||||
|
|
@ -34997,7 +34997,7 @@ static ma_result ma_context_uninit__coreaudio(ma_context* pContext)
|
||||||
|
|
||||||
#if defined(MA_APPLE_MOBILE)
|
#if defined(MA_APPLE_MOBILE)
|
||||||
if (!pContext->coreaudio.noAudioSessionDeactivate) {
|
if (!pContext->coreaudio.noAudioSessionDeactivate) {
|
||||||
if (![[AVAudioSession sharedInstance] setActive:false error:nil]) {
|
if (![[AVAudioSession sharedInstance] setActive:qfalse error:nil]) {
|
||||||
ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "Failed to deactivate audio session.");
|
ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "Failed to deactivate audio session.");
|
||||||
return MA_FAILED_TO_INIT_BACKEND;
|
return MA_FAILED_TO_INIT_BACKEND;
|
||||||
}
|
}
|
||||||
|
|
@ -35087,7 +35087,7 @@ static ma_result ma_context_init__coreaudio(ma_context* pContext, const ma_conte
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pConfig->coreaudio.noAudioSessionActivate) {
|
if (!pConfig->coreaudio.noAudioSessionActivate) {
|
||||||
if (![pAudioSession setActive:true error:nil]) {
|
if (![pAudioSession setActive:qtrue error:nil]) {
|
||||||
ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "Failed to activate audio session.");
|
ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "Failed to activate audio session.");
|
||||||
return MA_FAILED_TO_INIT_BACKEND;
|
return MA_FAILED_TO_INIT_BACKEND;
|
||||||
}
|
}
|
||||||
|
|
@ -40380,7 +40380,7 @@ static void ma_audio_worklet_processor_created__webaudio(EMSCRIPTEN_WEBAUDIO_T a
|
||||||
var audioWorklet = emscriptenGetAudioObject($0);
|
var audioWorklet = emscriptenGetAudioObject($0);
|
||||||
var audioContext = emscriptenGetAudioObject($1);
|
var audioContext = emscriptenGetAudioObject($1);
|
||||||
|
|
||||||
navigator.mediaDevices.getUserMedia({audio:true, video:false})
|
navigator.mediaDevices.getUserMedia({audio:qtrue, video:qfalse})
|
||||||
.then(function(stream) {
|
.then(function(stream) {
|
||||||
audioContext.streamNode = audioContext.createMediaStreamSource(stream);
|
audioContext.streamNode = audioContext.createMediaStreamSource(stream);
|
||||||
audioContext.streamNode.connect(audioWorklet);
|
audioContext.streamNode.connect(audioWorklet);
|
||||||
|
|
@ -40683,7 +40683,7 @@ static ma_result ma_device_init__webaudio(ma_device* pDevice, const ma_device_co
|
||||||
|
|
||||||
/* Now we need to connect our node to the graph. */
|
/* Now we need to connect our node to the graph. */
|
||||||
if (deviceType == window.miniaudio.device_type.capture || deviceType == window.miniaudio.device_type.duplex) {
|
if (deviceType == window.miniaudio.device_type.capture || deviceType == window.miniaudio.device_type.duplex) {
|
||||||
navigator.mediaDevices.getUserMedia({audio:true, video:false})
|
navigator.mediaDevices.getUserMedia({audio:qtrue, video:qfalse})
|
||||||
.then(function(stream) {
|
.then(function(stream) {
|
||||||
device.streamNode = device.webaudio.createMediaStreamSource(stream);
|
device.streamNode = device.webaudio.createMediaStreamSource(stream);
|
||||||
device.streamNode.connect(device.scriptNode);
|
device.streamNode.connect(device.scriptNode);
|
||||||
|
|
@ -40783,7 +40783,7 @@ static ma_result ma_context_uninit__webaudio(ma_context* pContext)
|
||||||
EM_ASM({
|
EM_ASM({
|
||||||
if (typeof(window.miniaudio) !== 'undefined') {
|
if (typeof(window.miniaudio) !== 'undefined') {
|
||||||
miniaudio.unlock_event_types.map(function(event_type) {
|
miniaudio.unlock_event_types.map(function(event_type) {
|
||||||
document.removeEventListener(event_type, miniaudio.unlock, true);
|
document.removeEventListener(event_type, miniaudio.unlock, qtrue);
|
||||||
});
|
});
|
||||||
|
|
||||||
window.miniaudio.referenceCount -= 1;
|
window.miniaudio.referenceCount -= 1;
|
||||||
|
|
@ -40889,12 +40889,12 @@ static ma_result ma_context_init__webaudio(ma_context* pContext, const ma_contex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
miniaudio.unlock_event_types.map(function(event_type) {
|
miniaudio.unlock_event_types.map(function(event_type) {
|
||||||
document.removeEventListener(event_type, miniaudio.unlock, true);
|
document.removeEventListener(event_type, miniaudio.unlock, qtrue);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
miniaudio.unlock_event_types.map(function(event_type) {
|
miniaudio.unlock_event_types.map(function(event_type) {
|
||||||
document.addEventListener(event_type, miniaudio.unlock, true);
|
document.addEventListener(event_type, miniaudio.unlock, qtrue);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -46479,7 +46479,7 @@ static ma_result ma_lpf_reinit__internal(const ma_lpf_config* pConfig, void* pHe
|
||||||
ma_uint32 lpf2Count;
|
ma_uint32 lpf2Count;
|
||||||
ma_uint32 ilpf1;
|
ma_uint32 ilpf1;
|
||||||
ma_uint32 ilpf2;
|
ma_uint32 ilpf2;
|
||||||
ma_lpf_heap_layout heapLayout; /* Only used if isNew is true. */
|
ma_lpf_heap_layout heapLayout; /* Only used if isNew is qtrue. */
|
||||||
|
|
||||||
if (pLPF == NULL || pConfig == NULL) {
|
if (pLPF == NULL || pConfig == NULL) {
|
||||||
return MA_INVALID_ARGS;
|
return MA_INVALID_ARGS;
|
||||||
|
|
@ -47341,7 +47341,7 @@ static ma_result ma_hpf_reinit__internal(const ma_hpf_config* pConfig, void* pHe
|
||||||
ma_uint32 hpf2Count;
|
ma_uint32 hpf2Count;
|
||||||
ma_uint32 ihpf1;
|
ma_uint32 ihpf1;
|
||||||
ma_uint32 ihpf2;
|
ma_uint32 ihpf2;
|
||||||
ma_hpf_heap_layout heapLayout; /* Only used if isNew is true. */
|
ma_hpf_heap_layout heapLayout; /* Only used if isNew is qtrue. */
|
||||||
|
|
||||||
if (pHPF == NULL || pConfig == NULL) {
|
if (pHPF == NULL || pConfig == NULL) {
|
||||||
return MA_INVALID_ARGS;
|
return MA_INVALID_ARGS;
|
||||||
|
|
@ -47887,7 +47887,7 @@ static ma_result ma_bpf_reinit__internal(const ma_bpf_config* pConfig, void* pHe
|
||||||
ma_result result;
|
ma_result result;
|
||||||
ma_uint32 bpf2Count;
|
ma_uint32 bpf2Count;
|
||||||
ma_uint32 ibpf2;
|
ma_uint32 ibpf2;
|
||||||
ma_bpf_heap_layout heapLayout; /* Only used if isNew is true. */
|
ma_bpf_heap_layout heapLayout; /* Only used if isNew is qtrue. */
|
||||||
|
|
||||||
if (pBPF == NULL || pConfig == NULL) {
|
if (pBPF == NULL || pConfig == NULL) {
|
||||||
return MA_INVALID_ARGS;
|
return MA_INVALID_ARGS;
|
||||||
|
|
@ -57818,7 +57818,7 @@ MA_API ma_result ma_data_source_read_pcm_frames(ma_data_source* pDataSource, voi
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Looping is a bit of a special case. When the `loop` argument is true, chaining will not work and
|
Looping is a bit of a special case. When the `loop` argument is qtrue, chaining will not work and
|
||||||
only the current data source will be read from.
|
only the current data source will be read from.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -61277,7 +61277,7 @@ static ma_result ma_decoder__init_data_converter(ma_decoder* pDecoder, const ma_
|
||||||
converterConfig.pChannelMapOut = pConfig->pChannelMap;
|
converterConfig.pChannelMapOut = pConfig->pChannelMap;
|
||||||
converterConfig.channelMixMode = pConfig->channelMixMode;
|
converterConfig.channelMixMode = pConfig->channelMixMode;
|
||||||
converterConfig.ditherMode = pConfig->ditherMode;
|
converterConfig.ditherMode = pConfig->ditherMode;
|
||||||
converterConfig.allowDynamicSampleRate = MA_FALSE; /* Never allow dynamic sample rate conversion. Setting this to true will disable passthrough optimizations. */
|
converterConfig.allowDynamicSampleRate = MA_FALSE; /* Never allow dynamic sample rate conversion. Setting this to qtrue will disable passthrough optimizations. */
|
||||||
converterConfig.resampling = pConfig->resampling;
|
converterConfig.resampling = pConfig->resampling;
|
||||||
|
|
||||||
result = ma_data_converter_init(&converterConfig, &pDecoder->allocationCallbacks, &pDecoder->converter);
|
result = ma_data_converter_init(&converterConfig, &pDecoder->allocationCallbacks, &pDecoder->converter);
|
||||||
|
|
@ -75195,7 +75195,7 @@ static void ma_engine_node_process_pcm_frames__sound(ma_node* pNode, const float
|
||||||
|
|
||||||
/* If we reached the end of the sound we'll want to mark it as at the end and stop it. This should never be returned for looping sounds. */
|
/* If we reached the end of the sound we'll want to mark it as at the end and stop it. This should never be returned for looping sounds. */
|
||||||
if (result == MA_AT_END) {
|
if (result == MA_AT_END) {
|
||||||
ma_sound_set_at_end(pSound, MA_TRUE); /* This will be set to false in ma_sound_start(). */
|
ma_sound_set_at_end(pSound, MA_TRUE); /* This will be set to qfalse in ma_sound_start(). */
|
||||||
}
|
}
|
||||||
|
|
||||||
pRunningFramesOut = ma_offset_pcm_frames_ptr_f32(ppFramesOut[0], totalFramesRead, ma_node_get_output_channels(pNode, 0));
|
pRunningFramesOut = ma_offset_pcm_frames_ptr_f32(ppFramesOut[0], totalFramesRead, ma_node_get_output_channels(pNode, 0));
|
||||||
|
|
@ -76472,7 +76472,7 @@ MA_API ma_result ma_engine_play_sound_ex(ma_engine* pEngine, const char* pFilePa
|
||||||
the implementation simple. Maybe this can be optimized later if there's enough demand, but
|
the implementation simple. Maybe this can be optimized later if there's enough demand, but
|
||||||
if this function is being used it probably means the caller doesn't really care too much.
|
if this function is being used it probably means the caller doesn't really care too much.
|
||||||
|
|
||||||
What we do is check the atEnd flag. When this is true, we can recycle the sound. Otherwise
|
What we do is check the atEnd flag. When this is qtrue, we can recycle the sound. Otherwise
|
||||||
we just keep iterating. If we reach the end without finding a sound to recycle we just
|
we just keep iterating. If we reach the end without finding a sound to recycle we just
|
||||||
allocate a new one. This doesn't scale well for a massive number of sounds being played
|
allocate a new one. This doesn't scale well for a massive number of sounds being played
|
||||||
simultaneously as we don't ever actually free the sound objects. Some kind of garbage
|
simultaneously as we don't ever actually free the sound objects. Some kind of garbage
|
||||||
|
|
|
||||||
|
|
@ -277,7 +277,7 @@ struct qsocket_s *NET_Connect (char *host);
|
||||||
// called by client to connect to a host. Returns -1 if not able to
|
// called by client to connect to a host. Returns -1 if not able to
|
||||||
|
|
||||||
qboolean NET_CanSendMessage (qsocket_t *sock);
|
qboolean NET_CanSendMessage (qsocket_t *sock);
|
||||||
// Returns true or false if the given qsocket can currently accept a
|
// Returns qtrue or qfalse if the given qsocket can currently accept a
|
||||||
// message to be transmitted.
|
// message to be transmitted.
|
||||||
|
|
||||||
int NET_GetMessage (struct qsocket_s *sock);
|
int NET_GetMessage (struct qsocket_s *sock);
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@ extern cvar_t sys_ticrate;
|
||||||
extern cvar_t sys_nostdout;
|
extern cvar_t sys_nostdout;
|
||||||
extern cvar_t developer;
|
extern cvar_t developer;
|
||||||
|
|
||||||
extern qboolean host_initialized; // true if into command execution
|
extern qboolean host_initialized; // qtrue if into command execution
|
||||||
extern double host_frametime;
|
extern double host_frametime;
|
||||||
extern byte *host_basepal;
|
extern byte *host_basepal;
|
||||||
extern byte *host_colormap;
|
extern byte *host_colormap;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ typedef enum {ss_loading, ss_active} server_state_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
qboolean active; // false if only a net client
|
qboolean active; // qfalse if only a net client
|
||||||
|
|
||||||
qboolean paused;
|
qboolean paused;
|
||||||
qboolean loadgame; // handle connections specially
|
qboolean loadgame; // handle connections specially
|
||||||
|
|
@ -77,8 +77,8 @@ typedef struct
|
||||||
|
|
||||||
typedef struct client_s
|
typedef struct client_s
|
||||||
{
|
{
|
||||||
qboolean active; // false = client is free
|
qboolean active; // qfalse = client is free
|
||||||
qboolean spawned; // false = don't send datagrams
|
qboolean spawned; // qfalse = don't send datagrams
|
||||||
qboolean dropasap; // has been told to go to another level
|
qboolean dropasap; // has been told to go to another level
|
||||||
qboolean privileged; // can execute any host command
|
qboolean privileged; // can execute any host command
|
||||||
qboolean sendsignon; // only valid before spawned
|
qboolean sendsignon; // only valid before spawned
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ typedef struct
|
||||||
unsigned height;
|
unsigned height;
|
||||||
float aspect; // width / height -- < 0 is taller than wide
|
float aspect; // width / height -- < 0 is taller than wide
|
||||||
int numpages;
|
int numpages;
|
||||||
int recalc_refdef; // if true, recalc vid-based stuff
|
int recalc_refdef; // if qtrue, recalc vid-based stuff
|
||||||
pixel_t *conbuffer;
|
pixel_t *conbuffer;
|
||||||
int conrowbytes;
|
int conrowbytes;
|
||||||
unsigned conwidth;
|
unsigned conwidth;
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ typedef struct
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
qboolean allsolid; // if true, plane is not valid
|
qboolean allsolid; // if qtrue, plane is not valid
|
||||||
qboolean startsolid; // if true, the initial point was in a solid area
|
qboolean startsolid; // if qtrue, the initial point was in a solid area
|
||||||
qboolean inopen, inwater;
|
qboolean inopen, inwater;
|
||||||
float fraction; // time completed, 1.0 = didn't hit anything
|
float fraction; // time completed, 1.0 = didn't hit anything
|
||||||
vec3_t endpos; // final position
|
vec3_t endpos; // final position
|
||||||
|
|
@ -62,7 +62,7 @@ int SV_PointContents (vec3_t p);
|
||||||
int SV_TruePointContents (vec3_t p);
|
int SV_TruePointContents (vec3_t p);
|
||||||
// returns the CONTENTS_* value from the world at the given point.
|
// returns the CONTENTS_* value from the world at the given point.
|
||||||
// does not check any entities at all
|
// does not check any entities at all
|
||||||
// the non-true version remaps the water current contents to content_water
|
// the non-qtrue version remaps the water current contents to content_water
|
||||||
|
|
||||||
edict_t *SV_TestEntityPosition (edict_t *ent);
|
edict_t *SV_TestEntityPosition (edict_t *ent);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ void CL_StopPlayback (void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fclose (cls.demofile);
|
fclose (cls.demofile);
|
||||||
cls.demoplayback = false;
|
cls.demoplayback = qfalse;
|
||||||
cls.demofile = NULL;
|
cls.demofile = NULL;
|
||||||
cls.state = ca_disconnected;
|
cls.state = ca_disconnected;
|
||||||
|
|
||||||
|
|
@ -182,7 +182,7 @@ void CL_Stop_f (void)
|
||||||
// finish up
|
// finish up
|
||||||
fclose (cls.demofile);
|
fclose (cls.demofile);
|
||||||
cls.demofile = NULL;
|
cls.demofile = NULL;
|
||||||
cls.demorecording = false;
|
cls.demorecording = qfalse;
|
||||||
Con_Printf ("Completed demo\n");
|
Con_Printf ("Completed demo\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -254,7 +254,7 @@ void CL_Record_f (void)
|
||||||
cls.forcetrack = track;
|
cls.forcetrack = track;
|
||||||
fprintf (cls.demofile, "%i\n", cls.forcetrack);
|
fprintf (cls.demofile, "%i\n", cls.forcetrack);
|
||||||
|
|
||||||
cls.demorecording = true;
|
cls.demorecording = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -269,7 +269,7 @@ void CL_PlayDemo_f (void)
|
||||||
{
|
{
|
||||||
char name[256];
|
char name[256];
|
||||||
int c;
|
int c;
|
||||||
qboolean neg = false;
|
qboolean neg = qfalse;
|
||||||
|
|
||||||
if (cmd_source != src_command)
|
if (cmd_source != src_command)
|
||||||
return;
|
return;
|
||||||
|
|
@ -300,13 +300,13 @@ void CL_PlayDemo_f (void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cls.demoplayback = true;
|
cls.demoplayback = qtrue;
|
||||||
cls.state = ca_connected;
|
cls.state = ca_connected;
|
||||||
cls.forcetrack = 0;
|
cls.forcetrack = 0;
|
||||||
|
|
||||||
while ((c = getc(cls.demofile)) != '\n')
|
while ((c = getc(cls.demofile)) != '\n')
|
||||||
if (c == '-')
|
if (c == '-')
|
||||||
neg = true;
|
neg = qtrue;
|
||||||
else
|
else
|
||||||
cls.forcetrack = cls.forcetrack * 10 + (c - '0');
|
cls.forcetrack = cls.forcetrack * 10 + (c - '0');
|
||||||
|
|
||||||
|
|
@ -327,7 +327,7 @@ void CL_FinishTimeDemo (void)
|
||||||
int frames;
|
int frames;
|
||||||
float time;
|
float time;
|
||||||
|
|
||||||
cls.timedemo = false;
|
cls.timedemo = qfalse;
|
||||||
|
|
||||||
// the first frame didn't count
|
// the first frame didn't count
|
||||||
frames = (host_framecount - cls.td_startframe) - 1;
|
frames = (host_framecount - cls.td_startframe) - 1;
|
||||||
|
|
@ -360,7 +360,7 @@ void CL_TimeDemo_f (void)
|
||||||
// cls.td_starttime will be grabbed at the second frame of the demo, so
|
// cls.td_starttime will be grabbed at the second frame of the demo, so
|
||||||
// all the loading time doesn't get counted
|
// all the loading time doesn't get counted
|
||||||
|
|
||||||
cls.timedemo = true;
|
cls.timedemo = qtrue;
|
||||||
cls.td_startframe = host_framecount;
|
cls.td_startframe = host_framecount;
|
||||||
cls.td_lastframe = -1; // get a new message this frame
|
cls.td_lastframe = -1; // get a new message this frame
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -218,8 +218,8 @@ float CL_KeyState (kbutton_t *key)
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
cvar_t cl_upspeed = {"cl_upspeed","200"};
|
cvar_t cl_upspeed = {"cl_upspeed","200"};
|
||||||
cvar_t cl_forwardspeed = {"cl_forwardspeed","200", true};
|
cvar_t cl_forwardspeed = {"cl_forwardspeed","200", qtrue};
|
||||||
cvar_t cl_backspeed = {"cl_backspeed","200", true};
|
cvar_t cl_backspeed = {"cl_backspeed","200", qtrue};
|
||||||
cvar_t cl_sidespeed = {"cl_sidespeed","350"};
|
cvar_t cl_sidespeed = {"cl_sidespeed","350"};
|
||||||
|
|
||||||
cvar_t cl_movespeedkey = {"cl_movespeedkey","2.0"};
|
cvar_t cl_movespeedkey = {"cl_movespeedkey","2.0"};
|
||||||
|
|
|
||||||
|
|
@ -25,20 +25,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
// references them even when on a unix system.
|
// references them even when on a unix system.
|
||||||
|
|
||||||
// these two are not intended to be set directly
|
// these two are not intended to be set directly
|
||||||
cvar_t cl_name = {"_cl_name", "player", true};
|
cvar_t cl_name = {"_cl_name", "player", qtrue};
|
||||||
cvar_t cl_color = {"_cl_color", "0", true};
|
cvar_t cl_color = {"_cl_color", "0", qtrue};
|
||||||
|
|
||||||
cvar_t cl_shownet = {"cl_shownet","0"}; // can be 0, 1, or 2
|
cvar_t cl_shownet = {"cl_shownet","0"}; // can be 0, 1, or 2
|
||||||
cvar_t cl_nolerp = {"cl_nolerp","0"};
|
cvar_t cl_nolerp = {"cl_nolerp","0"};
|
||||||
|
|
||||||
cvar_t lookspring = {"lookspring","0", true};
|
cvar_t lookspring = {"lookspring","0", qtrue};
|
||||||
cvar_t lookstrafe = {"lookstrafe","0", true};
|
cvar_t lookstrafe = {"lookstrafe","0", qtrue};
|
||||||
cvar_t sensitivity = {"sensitivity","3", true};
|
cvar_t sensitivity = {"sensitivity","3", qtrue};
|
||||||
|
|
||||||
cvar_t m_pitch = {"m_pitch","0.022", true};
|
cvar_t m_pitch = {"m_pitch","0.022", qtrue};
|
||||||
cvar_t m_yaw = {"m_yaw","0.022", true};
|
cvar_t m_yaw = {"m_yaw","0.022", qtrue};
|
||||||
cvar_t m_forward = {"m_forward","1", true};
|
cvar_t m_forward = {"m_forward","1", qtrue};
|
||||||
cvar_t m_side = {"m_side","0.8", true};
|
cvar_t m_side = {"m_side","0.8", qtrue};
|
||||||
|
|
||||||
|
|
||||||
client_static_t cls;
|
client_static_t cls;
|
||||||
|
|
@ -99,7 +99,7 @@ This is also called on Host_Error, so it shouldn't cause any errors
|
||||||
void CL_Disconnect (void)
|
void CL_Disconnect (void)
|
||||||
{
|
{
|
||||||
// stop sounds (especially looping!)
|
// stop sounds (especially looping!)
|
||||||
S_StopAllSounds (true);
|
S_StopAllSounds (qtrue);
|
||||||
|
|
||||||
// bring the console down and fade the colors back to normal
|
// bring the console down and fade the colors back to normal
|
||||||
// SCR_BringDownConsole ();
|
// SCR_BringDownConsole ();
|
||||||
|
|
@ -121,10 +121,10 @@ void CL_Disconnect (void)
|
||||||
|
|
||||||
cls.state = ca_disconnected;
|
cls.state = ca_disconnected;
|
||||||
if (sv.active)
|
if (sv.active)
|
||||||
Host_ShutdownServer(false);
|
Host_ShutdownServer(qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
cls.demoplayback = cls.timedemo = false;
|
cls.demoplayback = cls.timedemo = qfalse;
|
||||||
cls.signon = 0;
|
cls.signon = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -132,7 +132,7 @@ void CL_Disconnect_f (void)
|
||||||
{
|
{
|
||||||
CL_Disconnect ();
|
CL_Disconnect ();
|
||||||
if (sv.active)
|
if (sv.active)
|
||||||
Host_ShutdownServer (false);
|
Host_ShutdownServer (qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -573,7 +573,7 @@ void CL_RelinkEntities (void)
|
||||||
VectorCopy (ent->origin, dl->origin);
|
VectorCopy (ent->origin, dl->origin);
|
||||||
dl->radius = 200.0 + (rand()&31);
|
dl->radius = 200.0 + (rand()&31);
|
||||||
dl->die = cl.time + 0.001;
|
dl->die = cl.time + 0.001;
|
||||||
dl->dark = true;
|
dl->dark = qtrue;
|
||||||
}
|
}
|
||||||
if (ent->effects & EF_LIGHT)
|
if (ent->effects & EF_LIGHT)
|
||||||
{
|
{
|
||||||
|
|
@ -605,7 +605,7 @@ void CL_RelinkEntities (void)
|
||||||
else if (ent->model->flags & EF_TRACER3)
|
else if (ent->model->flags & EF_TRACER3)
|
||||||
R_RocketTrail (oldorg, ent->origin, 6);
|
R_RocketTrail (oldorg, ent->origin, 6);
|
||||||
|
|
||||||
ent->forcelink = false;
|
ent->forcelink = qfalse;
|
||||||
|
|
||||||
if (i == cl.viewentity && !chase_active.value)
|
if (i == cl.viewentity && !chase_active.value)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,7 @@ void CL_ParseServerInfo (void)
|
||||||
|
|
||||||
for (i=1 ; i<nummodels ; i++)
|
for (i=1 ; i<nummodels ; i++)
|
||||||
{
|
{
|
||||||
cl.model_precache[i] = Mod_ForName (model_precache[i], false);
|
cl.model_precache[i] = Mod_ForName (model_precache[i], qfalse);
|
||||||
if (cl.model_precache[i] == NULL)
|
if (cl.model_precache[i] == NULL)
|
||||||
{
|
{
|
||||||
Con_Printf("Model %s not found\n", model_precache[i]);
|
Con_Printf("Model %s not found\n", model_precache[i]);
|
||||||
|
|
@ -312,7 +312,7 @@ void CL_ParseServerInfo (void)
|
||||||
|
|
||||||
Hunk_Check (); // make sure nothing is hurt
|
Hunk_Check (); // make sure nothing is hurt
|
||||||
|
|
||||||
noclip_anglehack = false; // noclip is turned off at start
|
noclip_anglehack = qfalse; // noclip is turned off at start
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -363,9 +363,9 @@ if (bits&(1<<i)){
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ent->msgtime != cl.mtime[1])
|
if (ent->msgtime != cl.mtime[1])
|
||||||
forcelink = true; // no previous frame to lerp from
|
forcelink = qtrue; // no previous frame to lerp from
|
||||||
else
|
else
|
||||||
forcelink = false;
|
forcelink = qfalse;
|
||||||
|
|
||||||
ent->msgtime = cl.mtime[0];
|
ent->msgtime = cl.mtime[0];
|
||||||
|
|
||||||
|
|
@ -392,7 +392,7 @@ if (bits&(1<<i)){
|
||||||
ent->syncbase = 0.0;
|
ent->syncbase = 0.0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
forcelink = true; // hack to make null model players work
|
forcelink = qtrue; // hack to make null model players work
|
||||||
#ifdef GLQUAKE
|
#ifdef GLQUAKE
|
||||||
if (num > 0 && num <= cl.maxclients)
|
if (num > 0 && num <= cl.maxclients)
|
||||||
R_TranslatePlayerSkin (num - 1);
|
R_TranslatePlayerSkin (num - 1);
|
||||||
|
|
@ -473,7 +473,7 @@ if (bits&(1<<i)){
|
||||||
ent->msg_angles[0][2] = ent->baseline.angles[2];
|
ent->msg_angles[0][2] = ent->baseline.angles[2];
|
||||||
|
|
||||||
if ( bits & U_NOLERP )
|
if ( bits & U_NOLERP )
|
||||||
ent->forcelink = true;
|
ent->forcelink = qtrue;
|
||||||
|
|
||||||
if ( forcelink )
|
if ( forcelink )
|
||||||
{ // didn't have an update last message
|
{ // didn't have an update last message
|
||||||
|
|
@ -481,7 +481,7 @@ if (bits&(1<<i)){
|
||||||
VectorCopy (ent->msg_origins[0], ent->origin);
|
VectorCopy (ent->msg_origins[0], ent->origin);
|
||||||
VectorCopy (ent->msg_angles[0], ent->msg_angles[1]);
|
VectorCopy (ent->msg_angles[0], ent->msg_angles[1]);
|
||||||
VectorCopy (ent->msg_angles[0], ent->angles);
|
VectorCopy (ent->msg_angles[0], ent->angles);
|
||||||
ent->forcelink = true;
|
ent->forcelink = qtrue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -732,7 +732,7 @@ void CL_ParseServerMessage (void)
|
||||||
else if (cl_shownet.value == 2)
|
else if (cl_shownet.value == 2)
|
||||||
Con_Printf ("------------------\n");
|
Con_Printf ("------------------\n");
|
||||||
|
|
||||||
cl.onground = false; // unless the server says otherwise
|
cl.onground = qfalse; // unless the server says otherwise
|
||||||
//
|
//
|
||||||
// parse the message
|
// parse the message
|
||||||
//
|
//
|
||||||
|
|
@ -809,7 +809,7 @@ void CL_ParseServerMessage (void)
|
||||||
|
|
||||||
case svc_serverinfo:
|
case svc_serverinfo:
|
||||||
CL_ParseServerInfo ();
|
CL_ParseServerInfo ();
|
||||||
vid.recalc_refdef = true; // leave intermission full screen
|
vid.recalc_refdef = qtrue; // leave intermission full screen
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case svc_setangle:
|
case svc_setangle:
|
||||||
|
|
@ -887,14 +887,14 @@ void CL_ParseServerMessage (void)
|
||||||
{
|
{
|
||||||
CDAudio_Pause ();
|
CDAudio_Pause ();
|
||||||
#ifdef WINQUAKE
|
#ifdef WINQUAKE
|
||||||
VID_HandlePause (true);
|
VID_HandlePause (qtrue);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CDAudio_Resume ();
|
CDAudio_Resume ();
|
||||||
#ifdef WINQUAKE
|
#ifdef WINQUAKE
|
||||||
VID_HandlePause (false);
|
VID_HandlePause (qfalse);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -931,28 +931,28 @@ void CL_ParseServerMessage (void)
|
||||||
cl.cdtrack = MSG_ReadByte ();
|
cl.cdtrack = MSG_ReadByte ();
|
||||||
cl.looptrack = MSG_ReadByte ();
|
cl.looptrack = MSG_ReadByte ();
|
||||||
if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
|
if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
|
||||||
CDAudio_Play ((byte)cls.forcetrack, true);
|
CDAudio_Play ((byte)cls.forcetrack, qtrue);
|
||||||
else
|
else
|
||||||
CDAudio_Play ((byte)cl.cdtrack, true);
|
CDAudio_Play ((byte)cl.cdtrack, qtrue);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case svc_intermission:
|
case svc_intermission:
|
||||||
cl.intermission = 1;
|
cl.intermission = 1;
|
||||||
cl.completed_time = cl.time;
|
cl.completed_time = cl.time;
|
||||||
vid.recalc_refdef = true; // go to full screen
|
vid.recalc_refdef = qtrue; // go to full screen
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case svc_finale:
|
case svc_finale:
|
||||||
cl.intermission = 2;
|
cl.intermission = 2;
|
||||||
cl.completed_time = cl.time;
|
cl.completed_time = cl.time;
|
||||||
vid.recalc_refdef = true; // go to full screen
|
vid.recalc_refdef = qtrue; // go to full screen
|
||||||
SCR_CenterPrint (MSG_ReadString ());
|
SCR_CenterPrint (MSG_ReadString ());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case svc_cutscene:
|
case svc_cutscene:
|
||||||
cl.intermission = 3;
|
cl.intermission = 3;
|
||||||
cl.completed_time = cl.time;
|
cl.completed_time = cl.time;
|
||||||
vid.recalc_refdef = true; // go to full screen
|
vid.recalc_refdef = qtrue; // go to full screen
|
||||||
SCR_CenterPrint (MSG_ReadString ());
|
SCR_CenterPrint (MSG_ReadString ());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -214,20 +214,20 @@ void CL_ParseTEnt (void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TE_LIGHTNING1: // lightning bolts
|
case TE_LIGHTNING1: // lightning bolts
|
||||||
CL_ParseBeam (Mod_ForName("progs/bolt.mdl", true));
|
CL_ParseBeam (Mod_ForName("progs/bolt.mdl", qtrue));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TE_LIGHTNING2: // lightning bolts
|
case TE_LIGHTNING2: // lightning bolts
|
||||||
CL_ParseBeam (Mod_ForName("progs/bolt2.mdl", true));
|
CL_ParseBeam (Mod_ForName("progs/bolt2.mdl", qtrue));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TE_LIGHTNING3: // lightning bolts
|
case TE_LIGHTNING3: // lightning bolts
|
||||||
CL_ParseBeam (Mod_ForName("progs/bolt3.mdl", true));
|
CL_ParseBeam (Mod_ForName("progs/bolt3.mdl", qtrue));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// PGM 01/21/97
|
// PGM 01/21/97
|
||||||
case TE_BEAM: // grappling hook beam
|
case TE_BEAM: // grappling hook beam
|
||||||
CL_ParseBeam (Mod_ForName("progs/beam.mdl", true));
|
CL_ParseBeam (Mod_ForName("progs/beam.mdl", qtrue));
|
||||||
break;
|
break;
|
||||||
// PGM 01/21/97
|
// PGM 01/21/97
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ bind g "impulse 5 ; +attack ; wait ; -attack ; impulse 2"
|
||||||
*/
|
*/
|
||||||
void Cmd_Wait_f (void)
|
void Cmd_Wait_f (void)
|
||||||
{
|
{
|
||||||
cmd_wait = true;
|
cmd_wait = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -186,7 +186,7 @@ void Cbuf_Execute (void)
|
||||||
if (cmd_wait)
|
if (cmd_wait)
|
||||||
{ // skip out while text still remains in buffer, leaving it
|
{ // skip out while text still remains in buffer, leaving it
|
||||||
// for next frame
|
// for next frame
|
||||||
cmd_wait = false;
|
cmd_wait = qfalse;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -572,10 +572,10 @@ qboolean Cmd_Exists (char *cmd_name)
|
||||||
for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
|
for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
|
||||||
{
|
{
|
||||||
if (!Q_strcmp (cmd_name,cmd->name))
|
if (!Q_strcmp (cmd_name,cmd->name))
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
44
src/common.c
44
src/common.c
|
|
@ -30,9 +30,9 @@ static char *safeargvs[NUM_SAFE_ARGVS] =
|
||||||
{"-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse", "-dibonly"};
|
{"-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse", "-dibonly"};
|
||||||
|
|
||||||
cvar_t registered = {"registered","0"};
|
cvar_t registered = {"registered","0"};
|
||||||
cvar_t cmdline = {"cmdline","0", false, true};
|
cvar_t cmdline = {"cmdline","0", qfalse, qtrue};
|
||||||
|
|
||||||
qboolean com_modified; // set true if using non-id files
|
qboolean com_modified; // set qtrue if using non-id files
|
||||||
|
|
||||||
qboolean proghack;
|
qboolean proghack;
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ char **com_argv;
|
||||||
#define CMDLINE_LENGTH 256
|
#define CMDLINE_LENGTH 256
|
||||||
char com_cmdline[CMDLINE_LENGTH];
|
char com_cmdline[CMDLINE_LENGTH];
|
||||||
|
|
||||||
qboolean standard_quake = true, rogue, hipnotic;
|
qboolean standard_quake = qtrue, rogue, hipnotic;
|
||||||
|
|
||||||
// this graphic needs to be in the pak file to use registered features
|
// this graphic needs to be in the pak file to use registered features
|
||||||
unsigned short pop[] =
|
unsigned short pop[] =
|
||||||
|
|
@ -600,7 +600,7 @@ qboolean msg_badread;
|
||||||
void MSG_BeginReading (void)
|
void MSG_BeginReading (void)
|
||||||
{
|
{
|
||||||
msg_readcount = 0;
|
msg_readcount = 0;
|
||||||
msg_badread = false;
|
msg_badread = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns -1 and sets msg_badread if no more characters are available
|
// returns -1 and sets msg_badread if no more characters are available
|
||||||
|
|
@ -610,7 +610,7 @@ int MSG_ReadChar (void)
|
||||||
|
|
||||||
if (msg_readcount+1 > net_message.cursize)
|
if (msg_readcount+1 > net_message.cursize)
|
||||||
{
|
{
|
||||||
msg_badread = true;
|
msg_badread = qtrue;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -626,7 +626,7 @@ int MSG_ReadByte (void)
|
||||||
|
|
||||||
if (msg_readcount+1 > net_message.cursize)
|
if (msg_readcount+1 > net_message.cursize)
|
||||||
{
|
{
|
||||||
msg_badread = true;
|
msg_badread = qtrue;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -642,7 +642,7 @@ int MSG_ReadShort (void)
|
||||||
|
|
||||||
if (msg_readcount+2 > net_message.cursize)
|
if (msg_readcount+2 > net_message.cursize)
|
||||||
{
|
{
|
||||||
msg_badread = true;
|
msg_badread = qtrue;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -660,7 +660,7 @@ int MSG_ReadLong (void)
|
||||||
|
|
||||||
if (msg_readcount+4 > net_message.cursize)
|
if (msg_readcount+4 > net_message.cursize)
|
||||||
{
|
{
|
||||||
msg_badread = true;
|
msg_badread = qtrue;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -763,7 +763,7 @@ void *SZ_GetSpace (sizebuf_t *buf, int length)
|
||||||
if (length > buf->maxsize)
|
if (length > buf->maxsize)
|
||||||
Sys_Error ("SZ_GetSpace: %i is > full buffer size", length);
|
Sys_Error ("SZ_GetSpace: %i is > full buffer size", length);
|
||||||
|
|
||||||
buf->overflowed = true;
|
buf->overflowed = qtrue;
|
||||||
Con_Printf ("SZ_GetSpace: overflow");
|
Con_Printf ("SZ_GetSpace: overflow");
|
||||||
SZ_Clear (buf);
|
SZ_Clear (buf);
|
||||||
}
|
}
|
||||||
|
|
@ -1079,14 +1079,14 @@ void COM_InitArgv (int argc, char **argv)
|
||||||
|
|
||||||
com_cmdline[n] = 0;
|
com_cmdline[n] = 0;
|
||||||
|
|
||||||
safe = false;
|
safe = qfalse;
|
||||||
|
|
||||||
for (com_argc=0 ; (com_argc<MAX_NUM_ARGVS) && (com_argc < argc) ;
|
for (com_argc=0 ; (com_argc<MAX_NUM_ARGVS) && (com_argc < argc) ;
|
||||||
com_argc++)
|
com_argc++)
|
||||||
{
|
{
|
||||||
largv[com_argc] = argv[com_argc];
|
largv[com_argc] = argv[com_argc];
|
||||||
if (!Q_strcmp ("-safe", argv[com_argc]))
|
if (!Q_strcmp ("-safe", argv[com_argc]))
|
||||||
safe = true;
|
safe = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (safe)
|
if (safe)
|
||||||
|
|
@ -1105,14 +1105,14 @@ void COM_InitArgv (int argc, char **argv)
|
||||||
|
|
||||||
if (COM_CheckParm ("-rogue"))
|
if (COM_CheckParm ("-rogue"))
|
||||||
{
|
{
|
||||||
rogue = true;
|
rogue = qtrue;
|
||||||
standard_quake = false;
|
standard_quake = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (COM_CheckParm ("-hipnotic"))
|
if (COM_CheckParm ("-hipnotic"))
|
||||||
{
|
{
|
||||||
hipnotic = true;
|
hipnotic = qtrue;
|
||||||
standard_quake = false;
|
standard_quake = qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1129,7 +1129,7 @@ void COM_Init (char *basedir)
|
||||||
// set the byte swapping variables in a portable manner
|
// set the byte swapping variables in a portable manner
|
||||||
if ( *(short *)swaptest == 1)
|
if ( *(short *)swaptest == 1)
|
||||||
{
|
{
|
||||||
bigendien = false;
|
bigendien = qfalse;
|
||||||
BigShort = ShortSwap;
|
BigShort = ShortSwap;
|
||||||
LittleShort = ShortNoSwap;
|
LittleShort = ShortNoSwap;
|
||||||
BigLong = LongSwap;
|
BigLong = LongSwap;
|
||||||
|
|
@ -1139,7 +1139,7 @@ void COM_Init (char *basedir)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bigendien = true;
|
bigendien = qtrue;
|
||||||
BigShort = ShortNoSwap;
|
BigShort = ShortNoSwap;
|
||||||
LittleShort = ShortSwap;
|
LittleShort = ShortSwap;
|
||||||
BigLong = LongNoSwap;
|
BigLong = LongNoSwap;
|
||||||
|
|
@ -1645,7 +1645,7 @@ pack_t *COM_LoadPackFile (char *packfile)
|
||||||
Sys_Error ("%s has %i files", packfile, numpackfiles);
|
Sys_Error ("%s has %i files", packfile, numpackfiles);
|
||||||
|
|
||||||
if (numpackfiles != PAK0_COUNT)
|
if (numpackfiles != PAK0_COUNT)
|
||||||
com_modified = true; // not the original file
|
com_modified = qtrue; // not the original file
|
||||||
|
|
||||||
newfiles = Hunk_AllocName (numpackfiles * sizeof(packfile_t), "packfile");
|
newfiles = Hunk_AllocName (numpackfiles * sizeof(packfile_t), "packfile");
|
||||||
|
|
||||||
|
|
@ -1657,7 +1657,7 @@ pack_t *COM_LoadPackFile (char *packfile)
|
||||||
for (i=0 ; i<header.dirlen ; i++)
|
for (i=0 ; i<header.dirlen ; i++)
|
||||||
CRC_ProcessByte (&crc, ((byte *)info)[i]);
|
CRC_ProcessByte (&crc, ((byte *)info)[i]);
|
||||||
if (crc != PAK0_CRC)
|
if (crc != PAK0_CRC)
|
||||||
com_modified = true;
|
com_modified = qtrue;
|
||||||
|
|
||||||
// parse the directory
|
// parse the directory
|
||||||
for (i=0 ; i<numpackfiles ; i++)
|
for (i=0 ; i<numpackfiles ; i++)
|
||||||
|
|
@ -1788,7 +1788,7 @@ void COM_InitFilesystem (void)
|
||||||
i = COM_CheckParm ("-game");
|
i = COM_CheckParm ("-game");
|
||||||
if (i && i < com_argc-1)
|
if (i && i < com_argc-1)
|
||||||
{
|
{
|
||||||
com_modified = true;
|
com_modified = qtrue;
|
||||||
COM_AddGameDirectory (va("%s/%s", basedir, com_argv[i+1]));
|
COM_AddGameDirectory (va("%s/%s", basedir, com_argv[i+1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1799,7 +1799,7 @@ void COM_InitFilesystem (void)
|
||||||
i = COM_CheckParm ("-path");
|
i = COM_CheckParm ("-path");
|
||||||
if (i)
|
if (i)
|
||||||
{
|
{
|
||||||
com_modified = true;
|
com_modified = qtrue;
|
||||||
com_searchpaths = NULL;
|
com_searchpaths = NULL;
|
||||||
while (++i < com_argc)
|
while (++i < com_argc)
|
||||||
{
|
{
|
||||||
|
|
@ -1821,7 +1821,7 @@ void COM_InitFilesystem (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (COM_CheckParm ("-proghack"))
|
if (COM_CheckParm ("-proghack"))
|
||||||
proghack = true;
|
proghack = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ extern qboolean team_message;
|
||||||
void Con_MessageMode_f (void)
|
void Con_MessageMode_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_message;
|
key_dest = key_message;
|
||||||
team_message = false;
|
team_message = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -139,7 +139,7 @@ Con_MessageMode2_f
|
||||||
void Con_MessageMode2_f (void)
|
void Con_MessageMode2_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_message;
|
key_dest = key_message;
|
||||||
team_message = true;
|
team_message = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -242,7 +242,7 @@ void Con_Init (void)
|
||||||
Cmd_AddCommand ("messagemode", Con_MessageMode_f);
|
Cmd_AddCommand ("messagemode", Con_MessageMode_f);
|
||||||
Cmd_AddCommand ("messagemode2", Con_MessageMode2_f);
|
Cmd_AddCommand ("messagemode2", Con_MessageMode2_f);
|
||||||
Cmd_AddCommand ("clear", Con_Clear_f);
|
Cmd_AddCommand ("clear", Con_Clear_f);
|
||||||
con_initialized = true;
|
con_initialized = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -309,7 +309,7 @@ void Con_Print (char *txt)
|
||||||
if (cr)
|
if (cr)
|
||||||
{
|
{
|
||||||
con_current--;
|
con_current--;
|
||||||
cr = false;
|
cr = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -407,9 +407,9 @@ void Con_Printf (char *fmt, ...)
|
||||||
// Con_Printd
|
// Con_Printd
|
||||||
if (!inupdate)
|
if (!inupdate)
|
||||||
{
|
{
|
||||||
inupdate = true;
|
inupdate = qtrue;
|
||||||
SCR_UpdateScreen ();
|
SCR_UpdateScreen ();
|
||||||
inupdate = false;
|
inupdate = qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -455,7 +455,7 @@ void Con_SafePrintf (char *fmt, ...)
|
||||||
va_end (argptr);
|
va_end (argptr);
|
||||||
|
|
||||||
temp = scr_disabled_for_loading;
|
temp = scr_disabled_for_loading;
|
||||||
scr_disabled_for_loading = true;
|
scr_disabled_for_loading = qtrue;
|
||||||
Con_Printf ("%s", msg);
|
Con_Printf ("%s", msg);
|
||||||
scr_disabled_for_loading = temp;
|
scr_disabled_for_loading = temp;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,17 +191,17 @@ qboolean Cvar_Command (void)
|
||||||
// check variables
|
// check variables
|
||||||
v = Cvar_FindVar (Cmd_Argv(0));
|
v = Cvar_FindVar (Cmd_Argv(0));
|
||||||
if (!v)
|
if (!v)
|
||||||
return false;
|
return qfalse;
|
||||||
|
|
||||||
// perform a variable print or set
|
// perform a variable print or set
|
||||||
if (Cmd_Argc() == 1)
|
if (Cmd_Argc() == 1)
|
||||||
{
|
{
|
||||||
Con_Printf ("\"%s\" is \"%s\"\n", v->name, v->string);
|
Con_Printf ("\"%s\" is \"%s\"\n", v->name, v->string);
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cvar_Set (v->name, Cmd_Argv(1));
|
Cvar_Set (v->name, Cmd_Argv(1));
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -210,7 +210,7 @@ qboolean Cvar_Command (void)
|
||||||
Cvar_WriteVariables
|
Cvar_WriteVariables
|
||||||
|
|
||||||
Writes lines containing "set variable value" for all variables
|
Writes lines containing "set variable value" for all variables
|
||||||
with the archive flag set to true.
|
with the archive flag set to qtrue.
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
void Cvar_WriteVariables (FILE *f)
|
void Cvar_WriteVariables (FILE *f)
|
||||||
|
|
|
||||||
28
src/gl.c
28
src/gl.c
|
|
@ -52,14 +52,14 @@ static qboolean mouse_active;
|
||||||
static int mx, my;
|
static int mx, my;
|
||||||
static int old_mouse_x, old_mouse_y;
|
static int old_mouse_x, old_mouse_y;
|
||||||
|
|
||||||
qboolean dgamouse = false;
|
qboolean dgamouse = qfalse;
|
||||||
qboolean vidmode_ext = false;
|
qboolean vidmode_ext = qfalse;
|
||||||
|
|
||||||
static int scr_width, scr_height;
|
static int scr_width, scr_height;
|
||||||
|
|
||||||
static int default_dotclock_vidmode;
|
static int default_dotclock_vidmode;
|
||||||
static int num_vidmodes;
|
static int num_vidmodes;
|
||||||
static qboolean vidmode_active = false;
|
static qboolean vidmode_active = qfalse;
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
@ -84,9 +84,9 @@ void (*qgl3DfxSetPaletteEXT) (GLuint *);
|
||||||
|
|
||||||
static float vid_gamma = 1.0;
|
static float vid_gamma = 1.0;
|
||||||
|
|
||||||
qboolean is8bit = false;
|
qboolean is8bit = qfalse;
|
||||||
qboolean isPermedia = false;
|
qboolean isPermedia = qfalse;
|
||||||
qboolean gl_mtexable = false;
|
qboolean gl_mtexable = qfalse;
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
void D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height)
|
void D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height)
|
||||||
|
|
@ -101,7 +101,7 @@ static void install_grabs(void)
|
||||||
{
|
{
|
||||||
MwHideCursor(opengl);
|
MwHideCursor(opengl);
|
||||||
MwGrabPointer(opengl, 1);
|
MwGrabPointer(opengl, 1);
|
||||||
mouse_active = true;
|
mouse_active = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uninstall_grabs(void)
|
static void uninstall_grabs(void)
|
||||||
|
|
@ -111,7 +111,7 @@ static void uninstall_grabs(void)
|
||||||
|
|
||||||
MwGrabPointer(opengl, 0);
|
MwGrabPointer(opengl, 0);
|
||||||
|
|
||||||
mouse_active = false;
|
mouse_active = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int MilskoToQuakeKey(int key){
|
static int MilskoToQuakeKey(int key){
|
||||||
|
|
@ -190,7 +190,7 @@ void focusout(MwWidget handle, void* user, void* call){
|
||||||
static void HandleEvents(void)
|
static void HandleEvents(void)
|
||||||
{
|
{
|
||||||
int b;
|
int b;
|
||||||
qboolean dowarp = false;
|
qboolean dowarp = qfalse;
|
||||||
int mwx = vid.width/2;
|
int mwx = vid.width/2;
|
||||||
int mwy = vid.height/2;
|
int mwy = vid.height/2;
|
||||||
|
|
||||||
|
|
@ -209,7 +209,7 @@ static void IN_DeactivateMouse( void )
|
||||||
|
|
||||||
if (mouse_active) {
|
if (mouse_active) {
|
||||||
uninstall_grabs();
|
uninstall_grabs();
|
||||||
mouse_active = false;
|
mouse_active = qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,7 +221,7 @@ static void IN_ActivateMouse( void )
|
||||||
if (!mouse_active) {
|
if (!mouse_active) {
|
||||||
mx = my = 0; // don't spazz
|
mx = my = 0; // don't spazz
|
||||||
install_grabs();
|
install_grabs();
|
||||||
mouse_active = true;
|
mouse_active = qtrue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -232,7 +232,7 @@ void VID_Shutdown(void)
|
||||||
if (win) {
|
if (win) {
|
||||||
MwDestroyWidget(win);
|
MwDestroyWidget(win);
|
||||||
}
|
}
|
||||||
vidmode_active = false;
|
vidmode_active = qfalse;
|
||||||
win = NULL;
|
win = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -426,7 +426,7 @@ void VID_Init(unsigned char *palette)
|
||||||
char gldir[MAX_OSPATH];
|
char gldir[MAX_OSPATH];
|
||||||
int width = 640, height = 480;
|
int width = 640, height = 480;
|
||||||
unsigned long mask;
|
unsigned long mask;
|
||||||
qboolean fullscreen = true;
|
qboolean fullscreen = qtrue;
|
||||||
int MajorVersion, MinorVersion;
|
int MajorVersion, MinorVersion;
|
||||||
int actualWidth, actualHeight;
|
int actualWidth, actualHeight;
|
||||||
MwSizeHints sh;
|
MwSizeHints sh;
|
||||||
|
|
@ -443,7 +443,7 @@ void VID_Init(unsigned char *palette)
|
||||||
|
|
||||||
// set vid parameters
|
// set vid parameters
|
||||||
if ((i = COM_CheckParm("-window")) != 0)
|
if ((i = COM_CheckParm("-window")) != 0)
|
||||||
fullscreen = false;
|
fullscreen = qfalse;
|
||||||
|
|
||||||
if ((i = COM_CheckParm("-width")) != 0)
|
if ((i = COM_CheckParm("-width")) != 0)
|
||||||
width = atoi(com_argv[i+1]);
|
width = atoi(com_argv[i+1]);
|
||||||
|
|
|
||||||
|
|
@ -160,9 +160,9 @@ void Scrap_Upload (void)
|
||||||
|
|
||||||
for (texnum=0 ; texnum<MAX_SCRAPS ; texnum++) {
|
for (texnum=0 ; texnum<MAX_SCRAPS ; texnum++) {
|
||||||
GL_Bind(scrap_texnum + texnum);
|
GL_Bind(scrap_texnum + texnum);
|
||||||
GL_Upload8 (scrap_texels[texnum], BLOCK_WIDTH, BLOCK_HEIGHT, false, true);
|
GL_Upload8 (scrap_texels[texnum], BLOCK_WIDTH, BLOCK_HEIGHT, qfalse, qtrue);
|
||||||
}
|
}
|
||||||
scrap_dirty = false;
|
scrap_dirty = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
@ -200,7 +200,7 @@ qpic_t *Draw_PicFromWad (char *name)
|
||||||
int texnum;
|
int texnum;
|
||||||
|
|
||||||
texnum = Scrap_AllocBlock (p->width, p->height, &x, &y);
|
texnum = Scrap_AllocBlock (p->width, p->height, &x, &y);
|
||||||
scrap_dirty = true;
|
scrap_dirty = qtrue;
|
||||||
k = 0;
|
k = 0;
|
||||||
for (i=0 ; i<p->height ; i++)
|
for (i=0 ; i<p->height ; i++)
|
||||||
for (j=0 ; j<p->width ; j++, k++)
|
for (j=0 ; j<p->width ; j++, k++)
|
||||||
|
|
@ -402,7 +402,7 @@ void Draw_Init (void)
|
||||||
draw_chars[i] = 255; // proper transparent color
|
draw_chars[i] = 255; // proper transparent color
|
||||||
|
|
||||||
// now turn them into textures
|
// now turn them into textures
|
||||||
char_texture = GL_LoadTexture ("charset", 128, 128, draw_chars, false, true);
|
char_texture = GL_LoadTexture ("charset", 128, 128, draw_chars, qfalse, qtrue);
|
||||||
|
|
||||||
start = Hunk_LowMark();
|
start = Hunk_LowMark();
|
||||||
|
|
||||||
|
|
@ -461,7 +461,7 @@ void Draw_Init (void)
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
gl = (glpic_t *)conback->data;
|
gl = (glpic_t *)conback->data;
|
||||||
gl->texnum = GL_LoadTexture ("conback", conback->width, conback->height, ncdata, false, false);
|
gl->texnum = GL_LoadTexture ("conback", conback->width, conback->height, ncdata, qfalse, qfalse);
|
||||||
gl->sl = 0;
|
gl->sl = 0;
|
||||||
gl->sh = 1;
|
gl->sh = 1;
|
||||||
gl->tl = 0;
|
gl->tl = 0;
|
||||||
|
|
@ -1104,15 +1104,15 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
|
||||||
// texture even if it was specified as otherwise
|
// texture even if it was specified as otherwise
|
||||||
if (alpha)
|
if (alpha)
|
||||||
{
|
{
|
||||||
noalpha = true;
|
noalpha = qtrue;
|
||||||
for (i=0 ; i<s ; i++)
|
for (i=0 ; i<s ; i++)
|
||||||
{
|
{
|
||||||
if (data[i] == 255)
|
if (data[i] == 255)
|
||||||
noalpha = false;
|
noalpha = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alpha && noalpha)
|
if (alpha && noalpha)
|
||||||
alpha = false;
|
alpha = qfalse;
|
||||||
}
|
}
|
||||||
for (scaled_width = 1 ; scaled_width < width ; scaled_width<<=1)
|
for (scaled_width = 1 ; scaled_width < width ; scaled_width<<=1)
|
||||||
;
|
;
|
||||||
|
|
@ -1197,17 +1197,17 @@ static unsigned trans[640*480]; // FIXME, temporary
|
||||||
// texture even if it was specified as otherwise
|
// texture even if it was specified as otherwise
|
||||||
if (alpha)
|
if (alpha)
|
||||||
{
|
{
|
||||||
noalpha = true;
|
noalpha = qtrue;
|
||||||
for (i=0 ; i<s ; i++)
|
for (i=0 ; i<s ; i++)
|
||||||
{
|
{
|
||||||
p = data[i];
|
p = data[i];
|
||||||
if (p == 255)
|
if (p == 255)
|
||||||
noalpha = false;
|
noalpha = qfalse;
|
||||||
trans[i] = d_8to24table[p];
|
trans[i] = d_8to24table[p];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alpha && noalpha)
|
if (alpha && noalpha)
|
||||||
alpha = false;
|
alpha = qfalse;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1280,7 +1280,7 @@ GL_LoadPicTexture
|
||||||
*/
|
*/
|
||||||
int GL_LoadPicTexture (qpic_t *pic)
|
int GL_LoadPicTexture (qpic_t *pic)
|
||||||
{
|
{
|
||||||
return GL_LoadTexture ("", pic->width, pic->height, pic->data, false, true);
|
return GL_LoadTexture ("", pic->width, pic->height, pic->data, qfalse, qtrue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************/
|
/****************************************/
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ byte mod_novis[MAX_MAP_LEAFS/8];
|
||||||
model_t mod_known[MAX_MOD_KNOWN];
|
model_t mod_known[MAX_MOD_KNOWN];
|
||||||
int mod_numknown;
|
int mod_numknown;
|
||||||
|
|
||||||
cvar_t gl_subdivide_size = {"gl_subdivide_size", "128", true};
|
cvar_t gl_subdivide_size = {"gl_subdivide_size", "128", qtrue};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
|
|
@ -66,7 +66,7 @@ void *Mod_Extradata (model_t *mod)
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
Mod_LoadModel (mod, true);
|
Mod_LoadModel (mod, qtrue);
|
||||||
|
|
||||||
if (!mod->cache.data)
|
if (!mod->cache.data)
|
||||||
Sys_Error ("Mod_Extradata: caching failed");
|
Sys_Error ("Mod_Extradata: caching failed");
|
||||||
|
|
@ -172,7 +172,7 @@ void Mod_ClearAll (void)
|
||||||
|
|
||||||
for (i=0 , mod=mod_known ; i<mod_numknown ; i++, mod++)
|
for (i=0 , mod=mod_known ; i<mod_numknown ; i++, mod++)
|
||||||
if (mod->type != mod_alias)
|
if (mod->type != mod_alias)
|
||||||
mod->needload = true;
|
mod->needload = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -201,7 +201,7 @@ model_t *Mod_FindName (char *name)
|
||||||
if (mod_numknown == MAX_MOD_KNOWN)
|
if (mod_numknown == MAX_MOD_KNOWN)
|
||||||
Sys_Error ("mod_numknown == MAX_MOD_KNOWN");
|
Sys_Error ("mod_numknown == MAX_MOD_KNOWN");
|
||||||
strcpy (mod->name, name);
|
strcpy (mod->name, name);
|
||||||
mod->needload = true;
|
mod->needload = qtrue;
|
||||||
mod_numknown++;
|
mod_numknown++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -283,7 +283,7 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
|
||||||
//
|
//
|
||||||
|
|
||||||
// call the apropriate loader
|
// call the apropriate loader
|
||||||
mod->needload = false;
|
mod->needload = qfalse;
|
||||||
|
|
||||||
switch (LittleLong(*(unsigned *)buf))
|
switch (LittleLong(*(unsigned *)buf))
|
||||||
{
|
{
|
||||||
|
|
@ -388,7 +388,7 @@ void Mod_LoadTextures (lump_t *l)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
texture_mode = GL_LINEAR_MIPMAP_NEAREST; //_LINEAR;
|
texture_mode = GL_LINEAR_MIPMAP_NEAREST; //_LINEAR;
|
||||||
tx->gl_texturenum = GL_LoadTexture (mt->name, tx->width, tx->height, (byte *)(tx+1), true, false);
|
tx->gl_texturenum = GL_LoadTexture (mt->name, tx->width, tx->height, (byte *)(tx+1), qtrue, qfalse);
|
||||||
texture_mode = GL_LINEAR;
|
texture_mode = GL_LINEAR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1444,7 +1444,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
||||||
pheader->gl_texturenum[i][2] =
|
pheader->gl_texturenum[i][2] =
|
||||||
pheader->gl_texturenum[i][3] =
|
pheader->gl_texturenum[i][3] =
|
||||||
GL_LoadTexture (name, pheader->skinwidth,
|
GL_LoadTexture (name, pheader->skinwidth,
|
||||||
pheader->skinheight, (byte *)(pskintype + 1), true, false);
|
pheader->skinheight, (byte *)(pskintype + 1), qtrue, qfalse);
|
||||||
pskintype = (daliasskintype_t *)((byte *)(pskintype+1) + s);
|
pskintype = (daliasskintype_t *)((byte *)(pskintype+1) + s);
|
||||||
} else {
|
} else {
|
||||||
// animating skin group. yuck.
|
// animating skin group. yuck.
|
||||||
|
|
@ -1466,7 +1466,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
||||||
sprintf (name, "%s_%i_%i", loadmodel->name, i,j);
|
sprintf (name, "%s_%i_%i", loadmodel->name, i,j);
|
||||||
pheader->gl_texturenum[i][j&3] =
|
pheader->gl_texturenum[i][j&3] =
|
||||||
GL_LoadTexture (name, pheader->skinwidth,
|
GL_LoadTexture (name, pheader->skinwidth,
|
||||||
pheader->skinheight, (byte *)(pskintype), true, false);
|
pheader->skinheight, (byte *)(pskintype), qtrue, qfalse);
|
||||||
pskintype = (daliasskintype_t *)((byte *)(pskintype) + s);
|
pskintype = (daliasskintype_t *)((byte *)(pskintype) + s);
|
||||||
}
|
}
|
||||||
k = j;
|
k = j;
|
||||||
|
|
@ -1684,7 +1684,7 @@ void * Mod_LoadSpriteFrame (void * pin, mspriteframe_t **ppframe, int framenum)
|
||||||
pspriteframe->right = width + origin[0];
|
pspriteframe->right = width + origin[0];
|
||||||
|
|
||||||
sprintf (name, "%s_%i", loadmodel->name, framenum);
|
sprintf (name, "%s_%i", loadmodel->name, framenum);
|
||||||
pspriteframe->gl_texturenum = GL_LoadTexture (name, width, height, (byte *)(pinframe + 1), true, true);
|
pspriteframe->gl_texturenum = GL_LoadTexture (name, width, height, (byte *)(pinframe + 1), qtrue, qtrue);
|
||||||
|
|
||||||
return (void *)((byte *)pinframe + sizeof (dspriteframe_t) + size);
|
return (void *)((byte *)pinframe + sizeof (dspriteframe_t) + size);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ mplane_t frustum[4];
|
||||||
|
|
||||||
int c_brush_polys, c_alias_polys;
|
int c_brush_polys, c_alias_polys;
|
||||||
|
|
||||||
qboolean envmap; // true during envmap command capture
|
qboolean envmap; // qtrue during envmap command capture
|
||||||
|
|
||||||
int currenttexture = -1; // to avoid unnecessary texture sets
|
int currenttexture = -1; // to avoid unnecessary texture sets
|
||||||
|
|
||||||
|
|
@ -105,7 +105,7 @@ extern cvar_t gl_ztrick;
|
||||||
=================
|
=================
|
||||||
R_CullBox
|
R_CullBox
|
||||||
|
|
||||||
Returns true if the box is completely outside the frustom
|
Returns qtrue if the box is completely outside the frustom
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
qboolean R_CullBox (vec3_t mins, vec3_t maxs)
|
qboolean R_CullBox (vec3_t mins, vec3_t maxs)
|
||||||
|
|
@ -114,8 +114,8 @@ qboolean R_CullBox (vec3_t mins, vec3_t maxs)
|
||||||
|
|
||||||
for (i=0 ; i<4 ; i++)
|
for (i=0 ; i<4 ; i++)
|
||||||
if (BoxOnPlaneSide (mins, maxs, &frustum[i]) == 2)
|
if (BoxOnPlaneSide (mins, maxs, &frustum[i]) == 2)
|
||||||
return true;
|
return qtrue;
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -833,7 +833,7 @@ void R_SetupFrame (void)
|
||||||
V_SetContentsColor (r_viewleaf->contents);
|
V_SetContentsColor (r_viewleaf->contents);
|
||||||
V_CalcBlend ();
|
V_CalcBlend ();
|
||||||
|
|
||||||
r_cache_thrash = false;
|
r_cache_thrash = qfalse;
|
||||||
|
|
||||||
c_brush_polys = 0;
|
c_brush_polys = 0;
|
||||||
c_alias_polys = 0;
|
c_alias_polys = 0;
|
||||||
|
|
@ -1099,7 +1099,7 @@ void R_RenderView (void)
|
||||||
c_alias_polys = 0;
|
c_alias_polys = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
mirror = false;
|
mirror = qfalse;
|
||||||
|
|
||||||
if (gl_finish.value)
|
if (gl_finish.value)
|
||||||
glFinish ();
|
glFinish ();
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ void R_Envmap_f (void)
|
||||||
|
|
||||||
glDrawBuffer (GL_FRONT);
|
glDrawBuffer (GL_FRONT);
|
||||||
glReadBuffer (GL_FRONT);
|
glReadBuffer (GL_FRONT);
|
||||||
envmap = true;
|
envmap = qtrue;
|
||||||
|
|
||||||
r_refdef.vrect.x = 0;
|
r_refdef.vrect.x = 0;
|
||||||
r_refdef.vrect.y = 0;
|
r_refdef.vrect.y = 0;
|
||||||
|
|
@ -157,7 +157,7 @@ void R_Envmap_f (void)
|
||||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||||
COM_WriteFile ("env5.rgb", buffer, sizeof(buffer));
|
COM_WriteFile ("env5.rgb", buffer, sizeof(buffer));
|
||||||
|
|
||||||
envmap = false;
|
envmap = qfalse;
|
||||||
glDrawBuffer (GL_BACK);
|
glDrawBuffer (GL_BACK);
|
||||||
glReadBuffer (GL_BACK);
|
glReadBuffer (GL_BACK);
|
||||||
GL_EndRendering ();
|
GL_EndRendering ();
|
||||||
|
|
@ -304,7 +304,7 @@ void R_TranslatePlayerSkin (int playernum)
|
||||||
|
|
||||||
|
|
||||||
// don't mipmap these, because it takes too long
|
// don't mipmap these, because it takes too long
|
||||||
GL_Upload8 (translated, paliashdr->skinwidth, paliashdr->skinheight, false, false, true);
|
GL_Upload8 (translated, paliashdr->skinwidth, paliashdr->skinheight, qfalse, qfalse, qtrue);
|
||||||
#else
|
#else
|
||||||
scaled_width = gl_max_size.value < 512 ? gl_max_size.value : 512;
|
scaled_width = gl_max_size.value < 512 ? gl_max_size.value : 512;
|
||||||
scaled_height = gl_max_size.value < 256 ? gl_max_size.value : 256;
|
scaled_height = gl_max_size.value < 256 ? gl_max_size.value : 256;
|
||||||
|
|
@ -336,7 +336,7 @@ void R_TranslatePlayerSkin (int playernum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_Upload8_EXT ((byte *)pixels, scaled_width, scaled_height, false, false);
|
GL_Upload8_EXT ((byte *)pixels, scaled_width, scaled_height, qfalse, qfalse);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ void DrawGLWaterPolyLightmap (glpoly_t *p);
|
||||||
lpMTexFUNC qglMTexCoord2fSGIS = NULL;
|
lpMTexFUNC qglMTexCoord2fSGIS = NULL;
|
||||||
lpSelTexFUNC qglSelectTextureSGIS = NULL;
|
lpSelTexFUNC qglSelectTextureSGIS = NULL;
|
||||||
|
|
||||||
qboolean mtexenabled = false;
|
qboolean mtexenabled = qfalse;
|
||||||
|
|
||||||
void GL_SelectTexture (GLenum target);
|
void GL_SelectTexture (GLenum target);
|
||||||
|
|
||||||
|
|
@ -288,7 +288,7 @@ void GL_DisableMultitexture(void)
|
||||||
if (mtexenabled) {
|
if (mtexenabled) {
|
||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
GL_SelectTexture(TEXTURE0_SGIS);
|
GL_SelectTexture(TEXTURE0_SGIS);
|
||||||
mtexenabled = false;
|
mtexenabled = qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -297,7 +297,7 @@ void GL_EnableMultitexture(void)
|
||||||
if (gl_mtexable) {
|
if (gl_mtexable) {
|
||||||
GL_SelectTexture(TEXTURE1_SGIS);
|
GL_SelectTexture(TEXTURE1_SGIS);
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
mtexenabled = true;
|
mtexenabled = qtrue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -439,7 +439,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
||||||
i = s->lightmaptexturenum;
|
i = s->lightmaptexturenum;
|
||||||
if (lightmap_modified[i])
|
if (lightmap_modified[i])
|
||||||
{
|
{
|
||||||
lightmap_modified[i] = false;
|
lightmap_modified[i] = qfalse;
|
||||||
theRect = &lightmap_rectchange[i];
|
theRect = &lightmap_rectchange[i];
|
||||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t,
|
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t,
|
||||||
BLOCK_WIDTH, theRect->h, gl_lightmap_format, GL_UNSIGNED_BYTE,
|
BLOCK_WIDTH, theRect->h, gl_lightmap_format, GL_UNSIGNED_BYTE,
|
||||||
|
|
@ -541,7 +541,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
||||||
i = s->lightmaptexturenum;
|
i = s->lightmaptexturenum;
|
||||||
if (lightmap_modified[i])
|
if (lightmap_modified[i])
|
||||||
{
|
{
|
||||||
lightmap_modified[i] = false;
|
lightmap_modified[i] = qfalse;
|
||||||
theRect = &lightmap_rectchange[i];
|
theRect = &lightmap_rectchange[i];
|
||||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t,
|
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t,
|
||||||
BLOCK_WIDTH, theRect->h, gl_lightmap_format, GL_UNSIGNED_BYTE,
|
BLOCK_WIDTH, theRect->h, gl_lightmap_format, GL_UNSIGNED_BYTE,
|
||||||
|
|
@ -700,7 +700,7 @@ void R_BlendLightmaps (void)
|
||||||
GL_Bind(lightmap_textures+i);
|
GL_Bind(lightmap_textures+i);
|
||||||
if (lightmap_modified[i])
|
if (lightmap_modified[i])
|
||||||
{
|
{
|
||||||
lightmap_modified[i] = false;
|
lightmap_modified[i] = qfalse;
|
||||||
theRect = &lightmap_rectchange[i];
|
theRect = &lightmap_rectchange[i];
|
||||||
// glTexImage2D (GL_TEXTURE_2D, 0, lightmap_bytes
|
// glTexImage2D (GL_TEXTURE_2D, 0, lightmap_bytes
|
||||||
// , BLOCK_WIDTH, BLOCK_HEIGHT, 0,
|
// , BLOCK_WIDTH, BLOCK_HEIGHT, 0,
|
||||||
|
|
@ -798,7 +798,7 @@ void R_RenderBrushPoly (msurface_t *fa)
|
||||||
dynamic:
|
dynamic:
|
||||||
if (r_dynamic.value)
|
if (r_dynamic.value)
|
||||||
{
|
{
|
||||||
lightmap_modified[fa->lightmaptexturenum] = true;
|
lightmap_modified[fa->lightmaptexturenum] = qtrue;
|
||||||
theRect = &lightmap_rectchange[fa->lightmaptexturenum];
|
theRect = &lightmap_rectchange[fa->lightmaptexturenum];
|
||||||
if (fa->light_t < theRect->t) {
|
if (fa->light_t < theRect->t) {
|
||||||
if (theRect->h)
|
if (theRect->h)
|
||||||
|
|
@ -857,7 +857,7 @@ void R_RenderDynamicLightmaps (msurface_t *fa)
|
||||||
dynamic:
|
dynamic:
|
||||||
if (r_dynamic.value)
|
if (r_dynamic.value)
|
||||||
{
|
{
|
||||||
lightmap_modified[fa->lightmaptexturenum] = true;
|
lightmap_modified[fa->lightmaptexturenum] = qtrue;
|
||||||
theRect = &lightmap_rectchange[fa->lightmaptexturenum];
|
theRect = &lightmap_rectchange[fa->lightmaptexturenum];
|
||||||
if (fa->light_t < theRect->t) {
|
if (fa->light_t < theRect->t) {
|
||||||
if (theRect->h)
|
if (theRect->h)
|
||||||
|
|
@ -891,7 +891,7 @@ void R_MirrorChain (msurface_t *s)
|
||||||
{
|
{
|
||||||
if (mirror)
|
if (mirror)
|
||||||
return;
|
return;
|
||||||
mirror = true;
|
mirror = qtrue;
|
||||||
mirror_plane = s->plane;
|
mirror_plane = s->plane;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1090,7 +1090,7 @@ void R_DrawBrushModel (entity_t *e)
|
||||||
|
|
||||||
if (e->angles[0] || e->angles[1] || e->angles[2])
|
if (e->angles[0] || e->angles[1] || e->angles[2])
|
||||||
{
|
{
|
||||||
rotated = true;
|
rotated = qtrue;
|
||||||
for (i=0 ; i<3 ; i++)
|
for (i=0 ; i<3 ; i++)
|
||||||
{
|
{
|
||||||
mins[i] = e->origin[i] - clmodel->radius;
|
mins[i] = e->origin[i] - clmodel->radius;
|
||||||
|
|
@ -1099,7 +1099,7 @@ void R_DrawBrushModel (entity_t *e)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rotated = false;
|
rotated = qfalse;
|
||||||
VectorAdd (e->origin, clmodel->mins, mins);
|
VectorAdd (e->origin, clmodel->mins, mins);
|
||||||
VectorAdd (e->origin, clmodel->maxs, maxs);
|
VectorAdd (e->origin, clmodel->maxs, maxs);
|
||||||
}
|
}
|
||||||
|
|
@ -1674,7 +1674,7 @@ void GL_BuildLightmaps (void)
|
||||||
{
|
{
|
||||||
if (!allocated[i][0])
|
if (!allocated[i][0])
|
||||||
break; // no more used
|
break; // no more used
|
||||||
lightmap_modified[i] = false;
|
lightmap_modified[i] = qfalse;
|
||||||
lightmap_rectchange[i].l = BLOCK_WIDTH;
|
lightmap_rectchange[i].l = BLOCK_WIDTH;
|
||||||
lightmap_rectchange[i].t = BLOCK_HEIGHT;
|
lightmap_rectchange[i].t = BLOCK_HEIGHT;
|
||||||
lightmap_rectchange[i].w = 0;
|
lightmap_rectchange[i].w = 0;
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ float scr_con_current;
|
||||||
float scr_conlines; // lines of console to display
|
float scr_conlines; // lines of console to display
|
||||||
|
|
||||||
float oldscreensize, oldfov;
|
float oldscreensize, oldfov;
|
||||||
cvar_t scr_viewsize = {"viewsize","100", true};
|
cvar_t scr_viewsize = {"viewsize","100", qtrue};
|
||||||
cvar_t scr_fov = {"fov","90"}; // 10 - 170
|
cvar_t scr_fov = {"fov","90"}; // 10 - 170
|
||||||
cvar_t scr_conspeed = {"scr_conspeed","300"};
|
cvar_t scr_conspeed = {"scr_conspeed","300"};
|
||||||
cvar_t scr_centertime = {"scr_centertime","2"};
|
cvar_t scr_centertime = {"scr_centertime","2"};
|
||||||
|
|
@ -88,7 +88,7 @@ cvar_t scr_showram = {"showram","1"};
|
||||||
cvar_t scr_showturtle = {"showturtle","0"};
|
cvar_t scr_showturtle = {"showturtle","0"};
|
||||||
cvar_t scr_showpause = {"showpause","1"};
|
cvar_t scr_showpause = {"showpause","1"};
|
||||||
cvar_t scr_printspeed = {"scr_printspeed","8"};
|
cvar_t scr_printspeed = {"scr_printspeed","8"};
|
||||||
cvar_t gl_triplebuffer = {"gl_triplebuffer", "1", true };
|
cvar_t gl_triplebuffer = {"gl_triplebuffer", "1", qtrue };
|
||||||
|
|
||||||
extern cvar_t crosshair;
|
extern cvar_t crosshair;
|
||||||
|
|
||||||
|
|
@ -257,7 +257,7 @@ static void SCR_CalcRefdef (void)
|
||||||
vrect_t vrect;
|
vrect_t vrect;
|
||||||
float size;
|
float size;
|
||||||
int h;
|
int h;
|
||||||
qboolean full = false;
|
qboolean full = qfalse;
|
||||||
|
|
||||||
|
|
||||||
scr_fullupdate = 0; // force a background redraw
|
scr_fullupdate = 0; // force a background redraw
|
||||||
|
|
@ -294,13 +294,13 @@ static void SCR_CalcRefdef (void)
|
||||||
sb_lines = 24+16+8;
|
sb_lines = 24+16+8;
|
||||||
|
|
||||||
if (scr_viewsize.value >= 100.0) {
|
if (scr_viewsize.value >= 100.0) {
|
||||||
full = true;
|
full = qtrue;
|
||||||
size = 100.0;
|
size = 100.0;
|
||||||
} else
|
} else
|
||||||
size = scr_viewsize.value;
|
size = scr_viewsize.value;
|
||||||
if (cl.intermission)
|
if (cl.intermission)
|
||||||
{
|
{
|
||||||
full = true;
|
full = qtrue;
|
||||||
size = 100;
|
size = 100;
|
||||||
sb_lines = 0;
|
sb_lines = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -391,7 +391,7 @@ void SCR_Init (void)
|
||||||
scr_net = Draw_PicFromWad ("net");
|
scr_net = Draw_PicFromWad ("net");
|
||||||
scr_turtle = Draw_PicFromWad ("turtle");
|
scr_turtle = Draw_PicFromWad ("turtle");
|
||||||
|
|
||||||
scr_initialized = true;
|
scr_initialized = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -556,7 +556,7 @@ void SCR_DrawConsole (void)
|
||||||
if (scr_con_current)
|
if (scr_con_current)
|
||||||
{
|
{
|
||||||
scr_copyeverything = 1;
|
scr_copyeverything = 1;
|
||||||
Con_DrawConsole (scr_con_current, true);
|
Con_DrawConsole (scr_con_current, qtrue);
|
||||||
clearconsole = 0;
|
clearconsole = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -652,7 +652,7 @@ SCR_BeginLoadingPlaque
|
||||||
*/
|
*/
|
||||||
void SCR_BeginLoadingPlaque (void)
|
void SCR_BeginLoadingPlaque (void)
|
||||||
{
|
{
|
||||||
S_StopAllSounds (true);
|
S_StopAllSounds (qtrue);
|
||||||
|
|
||||||
if (cls.state != ca_connected)
|
if (cls.state != ca_connected)
|
||||||
return;
|
return;
|
||||||
|
|
@ -664,13 +664,13 @@ void SCR_BeginLoadingPlaque (void)
|
||||||
scr_centertime_off = 0;
|
scr_centertime_off = 0;
|
||||||
scr_con_current = 0;
|
scr_con_current = 0;
|
||||||
|
|
||||||
scr_drawloading = true;
|
scr_drawloading = qtrue;
|
||||||
scr_fullupdate = 0;
|
scr_fullupdate = 0;
|
||||||
Sbar_Changed ();
|
Sbar_Changed ();
|
||||||
SCR_UpdateScreen ();
|
SCR_UpdateScreen ();
|
||||||
scr_drawloading = false;
|
scr_drawloading = qfalse;
|
||||||
|
|
||||||
scr_disabled_for_loading = true;
|
scr_disabled_for_loading = qtrue;
|
||||||
scr_disabled_time = realtime;
|
scr_disabled_time = realtime;
|
||||||
scr_fullupdate = 0;
|
scr_fullupdate = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -683,7 +683,7 @@ SCR_EndLoadingPlaque
|
||||||
*/
|
*/
|
||||||
void SCR_EndLoadingPlaque (void)
|
void SCR_EndLoadingPlaque (void)
|
||||||
{
|
{
|
||||||
scr_disabled_for_loading = false;
|
scr_disabled_for_loading = qfalse;
|
||||||
scr_fullupdate = 0;
|
scr_fullupdate = 0;
|
||||||
Con_ClearNotify ();
|
Con_ClearNotify ();
|
||||||
}
|
}
|
||||||
|
|
@ -736,15 +736,15 @@ keypress.
|
||||||
int SCR_ModalMessage (char *text)
|
int SCR_ModalMessage (char *text)
|
||||||
{
|
{
|
||||||
if (cls.state == ca_dedicated)
|
if (cls.state == ca_dedicated)
|
||||||
return true;
|
return qtrue;
|
||||||
|
|
||||||
scr_notifystring = text;
|
scr_notifystring = text;
|
||||||
|
|
||||||
// draw a fresh screen
|
// draw a fresh screen
|
||||||
scr_fullupdate = 0;
|
scr_fullupdate = 0;
|
||||||
scr_drawdialog = true;
|
scr_drawdialog = qtrue;
|
||||||
SCR_UpdateScreen ();
|
SCR_UpdateScreen ();
|
||||||
scr_drawdialog = false;
|
scr_drawdialog = qfalse;
|
||||||
|
|
||||||
S_ClearBuffer (); // so dma doesn't loop current sound
|
S_ClearBuffer (); // so dma doesn't loop current sound
|
||||||
|
|
||||||
|
|
@ -835,7 +835,7 @@ void SCR_UpdateScreen (void)
|
||||||
{
|
{
|
||||||
if (realtime - scr_disabled_time > 60)
|
if (realtime - scr_disabled_time > 60)
|
||||||
{
|
{
|
||||||
scr_disabled_for_loading = false;
|
scr_disabled_for_loading = qfalse;
|
||||||
Con_Printf ("load failed.\n");
|
Con_Printf ("load failed.\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -854,13 +854,13 @@ void SCR_UpdateScreen (void)
|
||||||
if (oldfov != scr_fov.value)
|
if (oldfov != scr_fov.value)
|
||||||
{
|
{
|
||||||
oldfov = scr_fov.value;
|
oldfov = scr_fov.value;
|
||||||
vid.recalc_refdef = true;
|
vid.recalc_refdef = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldscreensize != scr_viewsize.value)
|
if (oldscreensize != scr_viewsize.value)
|
||||||
{
|
{
|
||||||
oldscreensize = scr_viewsize.value;
|
oldscreensize = scr_viewsize.value;
|
||||||
vid.recalc_refdef = true;
|
vid.recalc_refdef = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vid.recalc_refdef)
|
if (vid.recalc_refdef)
|
||||||
|
|
@ -885,7 +885,7 @@ void SCR_UpdateScreen (void)
|
||||||
Sbar_Draw ();
|
Sbar_Draw ();
|
||||||
Draw_FadeScreen ();
|
Draw_FadeScreen ();
|
||||||
SCR_DrawNotifyString ();
|
SCR_DrawNotifyString ();
|
||||||
scr_copyeverything = true;
|
scr_copyeverything = qtrue;
|
||||||
}
|
}
|
||||||
else if (scr_drawloading)
|
else if (scr_drawloading)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ plane_t *HitPlane (vec3_t start, vec3_t end)
|
||||||
// fill in a default trace
|
// fill in a default trace
|
||||||
memset (&trace, 0, sizeof(trace_t));
|
memset (&trace, 0, sizeof(trace_t));
|
||||||
trace.fraction = 1;
|
trace.fraction = 1;
|
||||||
trace.allsolid = true;
|
trace.allsolid = qtrue;
|
||||||
VectorCopy (end, trace.endpos);
|
VectorCopy (end, trace.endpos);
|
||||||
|
|
||||||
SV_RecursiveHullCheck (cl.worldmodel->hulls, 0, 0, 1, start, end, &trace);
|
SV_RecursiveHullCheck (cl.worldmodel->hulls, 0, 0, 1, start, end, &trace);
|
||||||
|
|
|
||||||
|
|
@ -816,19 +816,19 @@ void ClipSkyPolygon (int nump, vec3_t vecs, int stage)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
front = back = false;
|
front = back = qfalse;
|
||||||
norm = skyclip[stage];
|
norm = skyclip[stage];
|
||||||
for (i=0, v = vecs ; i<nump ; i++, v+=3)
|
for (i=0, v = vecs ; i<nump ; i++, v+=3)
|
||||||
{
|
{
|
||||||
d = DotProduct (v, norm);
|
d = DotProduct (v, norm);
|
||||||
if (d > ON_EPSILON)
|
if (d > ON_EPSILON)
|
||||||
{
|
{
|
||||||
front = true;
|
front = qtrue;
|
||||||
sides[i] = SIDE_FRONT;
|
sides[i] = SIDE_FRONT;
|
||||||
}
|
}
|
||||||
else if (d < ON_EPSILON)
|
else if (d < ON_EPSILON)
|
||||||
{
|
{
|
||||||
back = true;
|
back = qtrue;
|
||||||
sides[i] = SIDE_BACK;
|
sides[i] = SIDE_BACK;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
40
src/host.c
40
src/host.c
|
|
@ -35,7 +35,7 @@ Memory is cleared / released when a server or client begins, not when they end.
|
||||||
|
|
||||||
quakeparms_t host_parms;
|
quakeparms_t host_parms;
|
||||||
|
|
||||||
qboolean host_initialized; // true if into command execution
|
qboolean host_initialized; // qtrue if into command execution
|
||||||
|
|
||||||
double host_frametime;
|
double host_frametime;
|
||||||
double host_time;
|
double host_time;
|
||||||
|
|
@ -60,12 +60,12 @@ cvar_t host_speeds = {"host_speeds","0"}; // set for running times
|
||||||
cvar_t sys_ticrate = {"sys_ticrate","0.05"};
|
cvar_t sys_ticrate = {"sys_ticrate","0.05"};
|
||||||
cvar_t serverprofile = {"serverprofile","0"};
|
cvar_t serverprofile = {"serverprofile","0"};
|
||||||
|
|
||||||
cvar_t fraglimit = {"fraglimit","0",false,true};
|
cvar_t fraglimit = {"fraglimit","0",qfalse,qtrue};
|
||||||
cvar_t timelimit = {"timelimit","0",false,true};
|
cvar_t timelimit = {"timelimit","0",qfalse,qtrue};
|
||||||
cvar_t teamplay = {"teamplay","0",false,true};
|
cvar_t teamplay = {"teamplay","0",qfalse,qtrue};
|
||||||
|
|
||||||
cvar_t samelevel = {"samelevel","0"};
|
cvar_t samelevel = {"samelevel","0"};
|
||||||
cvar_t noexit = {"noexit","0",false,true};
|
cvar_t noexit = {"noexit","0",qfalse,qtrue};
|
||||||
|
|
||||||
#ifdef QUAKE2
|
#ifdef QUAKE2
|
||||||
cvar_t developer = {"developer","1"}; // should be 0 for release!
|
cvar_t developer = {"developer","1"}; // should be 0 for release!
|
||||||
|
|
@ -98,7 +98,7 @@ void Host_EndGame (char *message, ...)
|
||||||
Con_DPrintf ("Host_EndGame: %s\n",string);
|
Con_DPrintf ("Host_EndGame: %s\n",string);
|
||||||
|
|
||||||
if (sv.active)
|
if (sv.active)
|
||||||
Host_ShutdownServer (false);
|
Host_ShutdownServer (qfalse);
|
||||||
|
|
||||||
if (cls.state == ca_dedicated)
|
if (cls.state == ca_dedicated)
|
||||||
Sys_Error ("Host_EndGame: %s\n",string); // dedicated servers exit
|
Sys_Error ("Host_EndGame: %s\n",string); // dedicated servers exit
|
||||||
|
|
@ -122,11 +122,11 @@ void Host_Error (char *error, ...)
|
||||||
{
|
{
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
char string[1024];
|
char string[1024];
|
||||||
static qboolean inerror = false;
|
static qboolean inerror = qfalse;
|
||||||
|
|
||||||
if (inerror)
|
if (inerror)
|
||||||
Sys_Error ("Host_Error: recursively entered");
|
Sys_Error ("Host_Error: recursively entered");
|
||||||
inerror = true;
|
inerror = qtrue;
|
||||||
|
|
||||||
SCR_EndLoadingPlaque (); // reenable screen updates
|
SCR_EndLoadingPlaque (); // reenable screen updates
|
||||||
|
|
||||||
|
|
@ -136,7 +136,7 @@ void Host_Error (char *error, ...)
|
||||||
Con_Printf ("Host_Error: %s\n",string);
|
Con_Printf ("Host_Error: %s\n",string);
|
||||||
|
|
||||||
if (sv.active)
|
if (sv.active)
|
||||||
Host_ShutdownServer (false);
|
Host_ShutdownServer (qfalse);
|
||||||
|
|
||||||
if (cls.state == ca_dedicated)
|
if (cls.state == ca_dedicated)
|
||||||
Sys_Error ("Host_Error: %s\n",string); // dedicated servers exit
|
Sys_Error ("Host_Error: %s\n",string); // dedicated servers exit
|
||||||
|
|
@ -144,7 +144,7 @@ void Host_Error (char *error, ...)
|
||||||
CL_Disconnect ();
|
CL_Disconnect ();
|
||||||
cls.demonum = -1;
|
cls.demonum = -1;
|
||||||
|
|
||||||
inerror = false;
|
inerror = qfalse;
|
||||||
|
|
||||||
longjmp (host_abortserver, 1);
|
longjmp (host_abortserver, 1);
|
||||||
}
|
}
|
||||||
|
|
@ -337,7 +337,7 @@ void Host_ClientCommands (char *fmt, ...)
|
||||||
SV_DropClient
|
SV_DropClient
|
||||||
|
|
||||||
Called when the player is getting totally kicked off the host
|
Called when the player is getting totally kicked off the host
|
||||||
if (crash = true), don't bother sending signofs
|
if (crash = qtrue), don't bother sending signofs
|
||||||
=====================
|
=====================
|
||||||
*/
|
*/
|
||||||
void SV_DropClient (qboolean crash)
|
void SV_DropClient (qboolean crash)
|
||||||
|
|
@ -373,7 +373,7 @@ void SV_DropClient (qboolean crash)
|
||||||
host_client->netconnection = NULL;
|
host_client->netconnection = NULL;
|
||||||
|
|
||||||
// free the client (the body stays around)
|
// free the client (the body stays around)
|
||||||
host_client->active = false;
|
host_client->active = qfalse;
|
||||||
host_client->name[0] = 0;
|
host_client->name[0] = 0;
|
||||||
host_client->old_frags = -999999;
|
host_client->old_frags = -999999;
|
||||||
net_activeconnections--;
|
net_activeconnections--;
|
||||||
|
|
@ -413,7 +413,7 @@ void Host_ShutdownServer(qboolean crash)
|
||||||
if (!sv.active)
|
if (!sv.active)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sv.active = false;
|
sv.active = qfalse;
|
||||||
|
|
||||||
// stop all client sounds immediately
|
// stop all client sounds immediately
|
||||||
if (cls.state == ca_connected)
|
if (cls.state == ca_connected)
|
||||||
|
|
@ -495,7 +495,7 @@ void Host_ClearMemory (void)
|
||||||
===================
|
===================
|
||||||
Host_FilterTime
|
Host_FilterTime
|
||||||
|
|
||||||
Returns false if the time is too short to run a frame
|
Returns qfalse if the time is too short to run a frame
|
||||||
===================
|
===================
|
||||||
*/
|
*/
|
||||||
qboolean Host_FilterTime (float time)
|
qboolean Host_FilterTime (float time)
|
||||||
|
|
@ -503,7 +503,7 @@ qboolean Host_FilterTime (float time)
|
||||||
realtime += time;
|
realtime += time;
|
||||||
|
|
||||||
if (!cls.timedemo && realtime - oldrealtime < 1.0/72.0)
|
if (!cls.timedemo && realtime - oldrealtime < 1.0/72.0)
|
||||||
return false; // framerate is too high
|
return qfalse; // framerate is too high
|
||||||
|
|
||||||
host_frametime = realtime - oldrealtime;
|
host_frametime = realtime - oldrealtime;
|
||||||
oldrealtime = realtime;
|
oldrealtime = realtime;
|
||||||
|
|
@ -518,7 +518,7 @@ qboolean Host_FilterTime (float time)
|
||||||
host_frametime = 0.001;
|
host_frametime = 0.001;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -915,7 +915,7 @@ void Host_Init (quakeparms_t *parms)
|
||||||
Hunk_AllocName (0, "-HOST_HUNKLEVEL-");
|
Hunk_AllocName (0, "-HOST_HUNKLEVEL-");
|
||||||
host_hunklevel = Hunk_LowMark ();
|
host_hunklevel = Hunk_LowMark ();
|
||||||
|
|
||||||
host_initialized = true;
|
host_initialized = qtrue;
|
||||||
|
|
||||||
Sys_Printf ("========Quake Initialized=========\n");
|
Sys_Printf ("========Quake Initialized=========\n");
|
||||||
}
|
}
|
||||||
|
|
@ -931,17 +931,17 @@ to run quit through here before the final handoff to the sys code.
|
||||||
*/
|
*/
|
||||||
void Host_Shutdown(void)
|
void Host_Shutdown(void)
|
||||||
{
|
{
|
||||||
static qboolean isdown = false;
|
static qboolean isdown = qfalse;
|
||||||
|
|
||||||
if (isdown)
|
if (isdown)
|
||||||
{
|
{
|
||||||
printf ("recursive shutdown\n");
|
printf ("recursive shutdown\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isdown = true;
|
isdown = qtrue;
|
||||||
|
|
||||||
// keep Con_Printf from trying to update the screen
|
// keep Con_Printf from trying to update the screen
|
||||||
scr_disabled_for_loading = true;
|
scr_disabled_for_loading = qtrue;
|
||||||
|
|
||||||
Host_WriteConfiguration ();
|
Host_WriteConfiguration ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ void Host_Quit_f (void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CL_Disconnect ();
|
CL_Disconnect ();
|
||||||
Host_ShutdownServer(false);
|
Host_ShutdownServer(qfalse);
|
||||||
|
|
||||||
Sys_Quit ();
|
Sys_Quit ();
|
||||||
}
|
}
|
||||||
|
|
@ -161,13 +161,13 @@ void Host_Noclip_f (void)
|
||||||
|
|
||||||
if (sv_player->v.movetype != MOVETYPE_NOCLIP)
|
if (sv_player->v.movetype != MOVETYPE_NOCLIP)
|
||||||
{
|
{
|
||||||
noclip_anglehack = true;
|
noclip_anglehack = qtrue;
|
||||||
sv_player->v.movetype = MOVETYPE_NOCLIP;
|
sv_player->v.movetype = MOVETYPE_NOCLIP;
|
||||||
SV_ClientPrintf ("noclip ON\n");
|
SV_ClientPrintf ("noclip ON\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
noclip_anglehack = false;
|
noclip_anglehack = qfalse;
|
||||||
sv_player->v.movetype = MOVETYPE_WALK;
|
sv_player->v.movetype = MOVETYPE_WALK;
|
||||||
SV_ClientPrintf ("noclip OFF\n");
|
SV_ClientPrintf ("noclip OFF\n");
|
||||||
}
|
}
|
||||||
|
|
@ -264,7 +264,7 @@ void Host_Map_f (void)
|
||||||
cls.demonum = -1; // stop demo loop in case this fails
|
cls.demonum = -1; // stop demo loop in case this fails
|
||||||
|
|
||||||
CL_Disconnect ();
|
CL_Disconnect ();
|
||||||
Host_ShutdownServer(false);
|
Host_ShutdownServer(qfalse);
|
||||||
|
|
||||||
key_dest = key_game; // remove console or menu
|
key_dest = key_game; // remove console or menu
|
||||||
SCR_BeginLoadingPlaque ();
|
SCR_BeginLoadingPlaque ();
|
||||||
|
|
@ -633,8 +633,8 @@ void Host_Loadgame_f (void)
|
||||||
Con_Printf ("Couldn't load map\n");
|
Con_Printf ("Couldn't load map\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sv.paused = true; // pause until all clients connect
|
sv.paused = qtrue; // pause until all clients connect
|
||||||
sv.loadgame = true;
|
sv.loadgame = qtrue;
|
||||||
|
|
||||||
// load the light styles
|
// load the light styles
|
||||||
|
|
||||||
|
|
@ -680,12 +680,12 @@ void Host_Loadgame_f (void)
|
||||||
|
|
||||||
ent = EDICT_NUM(entnum);
|
ent = EDICT_NUM(entnum);
|
||||||
memset (&ent->v, 0, progs->entityfields * 4);
|
memset (&ent->v, 0, progs->entityfields * 4);
|
||||||
ent->free = false;
|
ent->free = qfalse;
|
||||||
ED_ParseEdict (start, ent);
|
ED_ParseEdict (start, ent);
|
||||||
|
|
||||||
// link it into the bsp tree
|
// link it into the bsp tree
|
||||||
if (!ent->free)
|
if (!ent->free)
|
||||||
SV_LinkEdict (ent, false);
|
SV_LinkEdict (ent, qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
entnum++;
|
entnum++;
|
||||||
|
|
@ -843,12 +843,12 @@ int LoadGamestate(char *level, char *startspot)
|
||||||
|
|
||||||
ent = EDICT_NUM(entnum);
|
ent = EDICT_NUM(entnum);
|
||||||
memset (&ent->v, 0, progs->entityfields * 4);
|
memset (&ent->v, 0, progs->entityfields * 4);
|
||||||
ent->free = false;
|
ent->free = qfalse;
|
||||||
ED_ParseEdict (start, ent);
|
ED_ParseEdict (start, ent);
|
||||||
|
|
||||||
// link it into the bsp tree
|
// link it into the bsp tree
|
||||||
if (!ent->free)
|
if (!ent->free)
|
||||||
SV_LinkEdict (ent, false);
|
SV_LinkEdict (ent, qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// sv.num_edicts = entnum;
|
// sv.num_edicts = entnum;
|
||||||
|
|
@ -971,13 +971,13 @@ void Host_Please_f (void)
|
||||||
cl = &svs.clients[j];
|
cl = &svs.clients[j];
|
||||||
if (cl->privileged)
|
if (cl->privileged)
|
||||||
{
|
{
|
||||||
cl->privileged = false;
|
cl->privileged = qfalse;
|
||||||
cl->edict->v.flags = (int)cl->edict->v.flags & ~(FL_GODMODE|FL_NOTARGET);
|
cl->edict->v.flags = (int)cl->edict->v.flags & ~(FL_GODMODE|FL_NOTARGET);
|
||||||
cl->edict->v.movetype = MOVETYPE_WALK;
|
cl->edict->v.movetype = MOVETYPE_WALK;
|
||||||
noclip_anglehack = false;
|
noclip_anglehack = qfalse;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cl->privileged = true;
|
cl->privileged = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Cmd_Argc () != 2)
|
if (Cmd_Argc () != 2)
|
||||||
|
|
@ -991,13 +991,13 @@ void Host_Please_f (void)
|
||||||
{
|
{
|
||||||
if (cl->privileged)
|
if (cl->privileged)
|
||||||
{
|
{
|
||||||
cl->privileged = false;
|
cl->privileged = qfalse;
|
||||||
cl->edict->v.flags = (int)cl->edict->v.flags & ~(FL_GODMODE|FL_NOTARGET);
|
cl->edict->v.flags = (int)cl->edict->v.flags & ~(FL_GODMODE|FL_NOTARGET);
|
||||||
cl->edict->v.movetype = MOVETYPE_WALK;
|
cl->edict->v.movetype = MOVETYPE_WALK;
|
||||||
noclip_anglehack = false;
|
noclip_anglehack = qfalse;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cl->privileged = true;
|
cl->privileged = qtrue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1012,14 +1012,14 @@ void Host_Say(qboolean teamonly)
|
||||||
int j;
|
int j;
|
||||||
char *p;
|
char *p;
|
||||||
unsigned char text[64];
|
unsigned char text[64];
|
||||||
qboolean fromServer = false;
|
qboolean fromServer = qfalse;
|
||||||
|
|
||||||
if (cmd_source == src_command)
|
if (cmd_source == src_command)
|
||||||
{
|
{
|
||||||
if (cls.state == ca_dedicated)
|
if (cls.state == ca_dedicated)
|
||||||
{
|
{
|
||||||
fromServer = true;
|
fromServer = qtrue;
|
||||||
teamonly = false;
|
teamonly = qfalse;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1071,13 +1071,13 @@ void Host_Say(qboolean teamonly)
|
||||||
|
|
||||||
void Host_Say_f(void)
|
void Host_Say_f(void)
|
||||||
{
|
{
|
||||||
Host_Say(false);
|
Host_Say(qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Host_Say_Team_f(void)
|
void Host_Say_Team_f(void)
|
||||||
{
|
{
|
||||||
Host_Say(true);
|
Host_Say(qtrue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1268,7 +1268,7 @@ void Host_PreSpawn_f (void)
|
||||||
SZ_Write (&host_client->message, sv.signon.data, sv.signon.cursize);
|
SZ_Write (&host_client->message, sv.signon.data, sv.signon.cursize);
|
||||||
MSG_WriteByte (&host_client->message, svc_signonnum);
|
MSG_WriteByte (&host_client->message, svc_signonnum);
|
||||||
MSG_WriteByte (&host_client->message, 2);
|
MSG_WriteByte (&host_client->message, 2);
|
||||||
host_client->sendsignon = true;
|
host_client->sendsignon = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -1298,7 +1298,7 @@ void Host_Spawn_f (void)
|
||||||
if (sv.loadgame)
|
if (sv.loadgame)
|
||||||
{ // loaded games are fully inited allready
|
{ // loaded games are fully inited allready
|
||||||
// if this is the last client to be connected, unpause
|
// if this is the last client to be connected, unpause
|
||||||
sv.paused = false;
|
sv.paused = qfalse;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1392,7 +1392,7 @@ void Host_Spawn_f (void)
|
||||||
|
|
||||||
MSG_WriteByte (&host_client->message, svc_signonnum);
|
MSG_WriteByte (&host_client->message, svc_signonnum);
|
||||||
MSG_WriteByte (&host_client->message, 3);
|
MSG_WriteByte (&host_client->message, 3);
|
||||||
host_client->sendsignon = true;
|
host_client->sendsignon = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -1408,7 +1408,7 @@ void Host_Begin_f (void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
host_client->spawned = true;
|
host_client->spawned = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
@ -1427,7 +1427,7 @@ void Host_Kick_f (void)
|
||||||
char *message = NULL;
|
char *message = NULL;
|
||||||
client_t *save;
|
client_t *save;
|
||||||
int i;
|
int i;
|
||||||
qboolean byNumber = false;
|
qboolean byNumber = qfalse;
|
||||||
|
|
||||||
if (cmd_source == src_command)
|
if (cmd_source == src_command)
|
||||||
{
|
{
|
||||||
|
|
@ -1450,7 +1450,7 @@ void Host_Kick_f (void)
|
||||||
if (!svs.clients[i].active)
|
if (!svs.clients[i].active)
|
||||||
return;
|
return;
|
||||||
host_client = &svs.clients[i];
|
host_client = &svs.clients[i];
|
||||||
byNumber = true;
|
byNumber = qtrue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1494,7 +1494,7 @@ void Host_Kick_f (void)
|
||||||
SV_ClientPrintf ("Kicked by %s: %s\n", who, message);
|
SV_ClientPrintf ("Kicked by %s: %s\n", who, message);
|
||||||
else
|
else
|
||||||
SV_ClientPrintf ("Kicked by %s\n", who);
|
SV_ClientPrintf ("Kicked by %s\n", who);
|
||||||
SV_DropClient (false);
|
SV_DropClient (qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
host_client = save;
|
host_client = save;
|
||||||
|
|
@ -1696,7 +1696,7 @@ void Host_Viewmodel_f (void)
|
||||||
if (!e)
|
if (!e)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m = Mod_ForName (Cmd_Argv(1), false);
|
m = Mod_ForName (Cmd_Argv(1), qfalse);
|
||||||
if (!m)
|
if (!m)
|
||||||
{
|
{
|
||||||
Con_Printf ("Can't load %s\n", Cmd_Argv(1));
|
Con_Printf ("Can't load %s\n", Cmd_Argv(1));
|
||||||
|
|
|
||||||
44
src/keys.c
44
src/keys.c
|
|
@ -29,7 +29,7 @@ key up events are sent even if in console mode
|
||||||
#define MAXCMDLINE 256
|
#define MAXCMDLINE 256
|
||||||
char key_lines[32][MAXCMDLINE];
|
char key_lines[32][MAXCMDLINE];
|
||||||
int key_linepos;
|
int key_linepos;
|
||||||
int shift_down=false;
|
int shift_down=qfalse;
|
||||||
int key_lastpress;
|
int key_lastpress;
|
||||||
|
|
||||||
int edit_line=0;
|
int edit_line=0;
|
||||||
|
|
@ -40,8 +40,8 @@ keydest_t key_dest;
|
||||||
int key_count; // incremented every key event
|
int key_count; // incremented every key event
|
||||||
|
|
||||||
char *keybindings[256];
|
char *keybindings[256];
|
||||||
qboolean consolekeys[256]; // if true, can't be rebound while in console
|
qboolean consolekeys[256]; // if qtrue, can't be rebound while in console
|
||||||
qboolean menubound[256]; // if true, can't be rebound while in menu
|
qboolean menubound[256]; // if qtrue, can't be rebound while in menu
|
||||||
int keyshift[256]; // key to map to if shift held down in console
|
int keyshift[256]; // key to map to if shift held down in console
|
||||||
int key_repeats[256]; // if > 1, it is autorepeating
|
int key_repeats[256]; // if > 1, it is autorepeating
|
||||||
qboolean keydown[256];
|
qboolean keydown[256];
|
||||||
|
|
@ -277,7 +277,7 @@ void Key_Console (int key)
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
char chat_buffer[32];
|
char chat_buffer[32];
|
||||||
qboolean team_message = false;
|
qboolean team_message = qfalse;
|
||||||
|
|
||||||
void Key_Message (int key)
|
void Key_Message (int key)
|
||||||
{
|
{
|
||||||
|
|
@ -532,21 +532,21 @@ void Key_Init (void)
|
||||||
// init ascii characters in console mode
|
// init ascii characters in console mode
|
||||||
//
|
//
|
||||||
for (i=32 ; i<128 ; i++)
|
for (i=32 ; i<128 ; i++)
|
||||||
consolekeys[i] = true;
|
consolekeys[i] = qtrue;
|
||||||
consolekeys[K_ENTER] = true;
|
consolekeys[K_ENTER] = qtrue;
|
||||||
consolekeys[K_TAB] = true;
|
consolekeys[K_TAB] = qtrue;
|
||||||
consolekeys[K_LEFTARROW] = true;
|
consolekeys[K_LEFTARROW] = qtrue;
|
||||||
consolekeys[K_RIGHTARROW] = true;
|
consolekeys[K_RIGHTARROW] = qtrue;
|
||||||
consolekeys[K_UPARROW] = true;
|
consolekeys[K_UPARROW] = qtrue;
|
||||||
consolekeys[K_DOWNARROW] = true;
|
consolekeys[K_DOWNARROW] = qtrue;
|
||||||
consolekeys[K_BACKSPACE] = true;
|
consolekeys[K_BACKSPACE] = qtrue;
|
||||||
consolekeys[K_PGUP] = true;
|
consolekeys[K_PGUP] = qtrue;
|
||||||
consolekeys[K_PGDN] = true;
|
consolekeys[K_PGDN] = qtrue;
|
||||||
consolekeys[K_SHIFT] = true;
|
consolekeys[K_SHIFT] = qtrue;
|
||||||
consolekeys[K_MWHEELUP] = true;
|
consolekeys[K_MWHEELUP] = qtrue;
|
||||||
consolekeys[K_MWHEELDOWN] = true;
|
consolekeys[K_MWHEELDOWN] = qtrue;
|
||||||
consolekeys['`'] = false;
|
consolekeys['`'] = qfalse;
|
||||||
consolekeys['~'] = false;
|
consolekeys['~'] = qfalse;
|
||||||
|
|
||||||
for (i=0 ; i<256 ; i++)
|
for (i=0 ; i<256 ; i++)
|
||||||
keyshift[i] = i;
|
keyshift[i] = i;
|
||||||
|
|
@ -574,9 +574,9 @@ void Key_Init (void)
|
||||||
keyshift['`'] = '~';
|
keyshift['`'] = '~';
|
||||||
keyshift['\\'] = '|';
|
keyshift['\\'] = '|';
|
||||||
|
|
||||||
menubound[K_ESCAPE] = true;
|
menubound[K_ESCAPE] = qtrue;
|
||||||
for (i=0 ; i<12 ; i++)
|
for (i=0 ; i<12 ; i++)
|
||||||
menubound[K_F1+i] = true;
|
menubound[K_F1+i] = qtrue;
|
||||||
|
|
||||||
//
|
//
|
||||||
// register our functions
|
// register our functions
|
||||||
|
|
@ -752,7 +752,7 @@ void Key_ClearStates (void)
|
||||||
|
|
||||||
for (i=0 ; i<256 ; i++)
|
for (i=0 ; i<256 ; i++)
|
||||||
{
|
{
|
||||||
keydown[i] = false;
|
keydown[i] = qfalse;
|
||||||
key_repeats[i] = 0;
|
key_repeats[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
116
src/menu.c
116
src/menu.c
|
|
@ -240,7 +240,7 @@ M_ToggleMenu_f
|
||||||
*/
|
*/
|
||||||
void M_ToggleMenu_f (void)
|
void M_ToggleMenu_f (void)
|
||||||
{
|
{
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
|
|
||||||
if (key_dest == key_menu)
|
if (key_dest == key_menu)
|
||||||
{
|
{
|
||||||
|
|
@ -280,7 +280,7 @@ void M_Menu_Main_f (void)
|
||||||
}
|
}
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_main;
|
m_state = m_main;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -325,7 +325,7 @@ void M_Main_Key (int key)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case K_ENTER:
|
case K_ENTER:
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
|
|
||||||
switch (m_main_cursor)
|
switch (m_main_cursor)
|
||||||
{
|
{
|
||||||
|
|
@ -363,7 +363,7 @@ void M_Menu_SinglePlayer_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_singleplayer;
|
m_state = m_singleplayer;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -404,7 +404,7 @@ void M_SinglePlayer_Key (int key)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case K_ENTER:
|
case K_ENTER:
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
|
|
||||||
switch (m_singleplayer_cursor)
|
switch (m_singleplayer_cursor)
|
||||||
{
|
{
|
||||||
|
|
@ -449,7 +449,7 @@ void M_ScanSaves (void)
|
||||||
for (i=0 ; i<MAX_SAVEGAMES ; i++)
|
for (i=0 ; i<MAX_SAVEGAMES ; i++)
|
||||||
{
|
{
|
||||||
strcpy (m_filenames[i], "--- UNUSED SLOT ---");
|
strcpy (m_filenames[i], "--- UNUSED SLOT ---");
|
||||||
loadable[i] = false;
|
loadable[i] = qfalse;
|
||||||
sprintf (name, "%s/s%i.sav", com_gamedir, i);
|
sprintf (name, "%s/s%i.sav", com_gamedir, i);
|
||||||
f = fopen (name, "r");
|
f = fopen (name, "r");
|
||||||
if (!f)
|
if (!f)
|
||||||
|
|
@ -462,14 +462,14 @@ void M_ScanSaves (void)
|
||||||
for (j=0 ; j<SAVEGAME_COMMENT_LENGTH ; j++)
|
for (j=0 ; j<SAVEGAME_COMMENT_LENGTH ; j++)
|
||||||
if (m_filenames[i][j] == '_')
|
if (m_filenames[i][j] == '_')
|
||||||
m_filenames[i][j] = ' ';
|
m_filenames[i][j] = ' ';
|
||||||
loadable[i] = true;
|
loadable[i] = qtrue;
|
||||||
fclose (f);
|
fclose (f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void M_Menu_Load_f (void)
|
void M_Menu_Load_f (void)
|
||||||
{
|
{
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
m_state = m_load;
|
m_state = m_load;
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
M_ScanSaves ();
|
M_ScanSaves ();
|
||||||
|
|
@ -484,7 +484,7 @@ void M_Menu_Save_f (void)
|
||||||
return;
|
return;
|
||||||
if (svs.maxclients != 1)
|
if (svs.maxclients != 1)
|
||||||
return;
|
return;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
m_state = m_save;
|
m_state = m_save;
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
M_ScanSaves ();
|
M_ScanSaves ();
|
||||||
|
|
@ -608,7 +608,7 @@ void M_Menu_MultiPlayer_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_multiplayer;
|
m_state = m_multiplayer;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -653,7 +653,7 @@ void M_MultiPlayer_Key (int key)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case K_ENTER:
|
case K_ENTER:
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
switch (m_multiplayer_cursor)
|
switch (m_multiplayer_cursor)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -692,7 +692,7 @@ void M_Menu_Setup_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_setup;
|
m_state = m_setup;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
Q_strcpy(setup_myname, cl_name.string);
|
Q_strcpy(setup_myname, cl_name.string);
|
||||||
Q_strcpy(setup_hostname, hostname.string);
|
Q_strcpy(setup_hostname, hostname.string);
|
||||||
setup_top = setup_oldtop = ((int)cl_color.value) >> 4;
|
setup_top = setup_oldtop = ((int)cl_color.value) >> 4;
|
||||||
|
|
@ -796,7 +796,7 @@ forward:
|
||||||
Cvar_Set("hostname", setup_hostname);
|
Cvar_Set("hostname", setup_hostname);
|
||||||
if (setup_top != setup_oldtop || setup_bottom != setup_oldbottom)
|
if (setup_top != setup_oldtop || setup_bottom != setup_oldbottom)
|
||||||
Cbuf_AddText( va ("color %i %i\n", setup_top, setup_bottom) );
|
Cbuf_AddText( va ("color %i %i\n", setup_top, setup_bottom) );
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
M_Menu_MultiPlayer_f ();
|
M_Menu_MultiPlayer_f ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -882,7 +882,7 @@ void M_Menu_Net_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_net;
|
m_state = m_net;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
m_net_items = 4;
|
m_net_items = 4;
|
||||||
|
|
||||||
if (m_net_cursor >= m_net_items)
|
if (m_net_cursor >= m_net_items)
|
||||||
|
|
@ -993,7 +993,7 @@ again:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case K_ENTER:
|
case K_ENTER:
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
|
|
||||||
switch (m_net_cursor)
|
switch (m_net_cursor)
|
||||||
{
|
{
|
||||||
|
|
@ -1046,7 +1046,7 @@ void M_Menu_Options_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_options;
|
m_state = m_options;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
|
|
||||||
#ifdef WINQUAKE
|
#ifdef WINQUAKE
|
||||||
if ((options_cursor == 13) && (modestate != MS_WINDOWED))
|
if ((options_cursor == 13) && (modestate != MS_WINDOWED))
|
||||||
|
|
@ -1241,7 +1241,7 @@ void M_Options_Key (int k)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case K_ENTER:
|
case K_ENTER:
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
switch (options_cursor)
|
switch (options_cursor)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -1339,7 +1339,7 @@ void M_Menu_Keys_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_keys;
|
m_state = m_keys;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1449,7 +1449,7 @@ void M_Keys_Key (int k)
|
||||||
S_LocalSound ("misc/menu1.wav");
|
S_LocalSound ("misc/menu1.wav");
|
||||||
if (k == K_ESCAPE)
|
if (k == K_ESCAPE)
|
||||||
{
|
{
|
||||||
bind_grab = false;
|
bind_grab = qfalse;
|
||||||
}
|
}
|
||||||
else if (k != '`')
|
else if (k != '`')
|
||||||
{
|
{
|
||||||
|
|
@ -1457,7 +1457,7 @@ void M_Keys_Key (int k)
|
||||||
Cbuf_InsertText (cmd);
|
Cbuf_InsertText (cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
bind_grab = false;
|
bind_grab = qfalse;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1488,7 +1488,7 @@ void M_Keys_Key (int k)
|
||||||
S_LocalSound ("misc/menu2.wav");
|
S_LocalSound ("misc/menu2.wav");
|
||||||
if (keys[1] != -1)
|
if (keys[1] != -1)
|
||||||
M_UnbindCommand (bindnames[keys_cursor][0]);
|
M_UnbindCommand (bindnames[keys_cursor][0]);
|
||||||
bind_grab = true;
|
bind_grab = qtrue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case K_BACKSPACE: // delete bindings
|
case K_BACKSPACE: // delete bindings
|
||||||
|
|
@ -1506,7 +1506,7 @@ void M_Menu_Video_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_video;
|
m_state = m_video;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1532,7 +1532,7 @@ void M_Menu_Help_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_help;
|
m_state = m_help;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
help_page = 0;
|
help_page = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1554,14 +1554,14 @@ void M_Help_Key (int key)
|
||||||
|
|
||||||
case K_UPARROW:
|
case K_UPARROW:
|
||||||
case K_RIGHTARROW:
|
case K_RIGHTARROW:
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
if (++help_page >= NUM_HELP_PAGES)
|
if (++help_page >= NUM_HELP_PAGES)
|
||||||
help_page = 0;
|
help_page = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case K_DOWNARROW:
|
case K_DOWNARROW:
|
||||||
case K_LEFTARROW:
|
case K_LEFTARROW:
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
if (--help_page < 0)
|
if (--help_page < 0)
|
||||||
help_page = NUM_HELP_PAGES-1;
|
help_page = NUM_HELP_PAGES-1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -1587,7 +1587,7 @@ char *quitMessage [] =
|
||||||
|
|
||||||
" Milord, methinks that ",
|
" Milord, methinks that ",
|
||||||
" thou art a lowly ",
|
" thou art a lowly ",
|
||||||
" quitter. Is this true? ",
|
" quitter. Is this qtrue? ",
|
||||||
" ",
|
" ",
|
||||||
|
|
||||||
" Do I need to bust your ",
|
" Do I need to bust your ",
|
||||||
|
|
@ -1630,7 +1630,7 @@ void M_Menu_Quit_f (void)
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_quit_prevstate = m_state;
|
m_quit_prevstate = m_state;
|
||||||
m_state = m_quit;
|
m_state = m_quit;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
msgNumber = rand()&7;
|
msgNumber = rand()&7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1645,7 +1645,7 @@ void M_Quit_Key (int key)
|
||||||
if (wasInMenus)
|
if (wasInMenus)
|
||||||
{
|
{
|
||||||
m_state = m_quit_prevstate;
|
m_state = m_quit_prevstate;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1672,7 +1672,7 @@ void M_Quit_Draw (void)
|
||||||
if (wasInMenus)
|
if (wasInMenus)
|
||||||
{
|
{
|
||||||
m_state = m_quit_prevstate;
|
m_state = m_quit_prevstate;
|
||||||
m_recursiveDraw = true;
|
m_recursiveDraw = qtrue;
|
||||||
M_Draw ();
|
M_Draw ();
|
||||||
m_state = m_quit;
|
m_state = m_quit;
|
||||||
}
|
}
|
||||||
|
|
@ -1735,7 +1735,7 @@ void M_Menu_SerialConfig_f (void)
|
||||||
|
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_serialconfig;
|
m_state = m_serialconfig;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
if (JoiningGame && SerialConfig)
|
if (JoiningGame && SerialConfig)
|
||||||
serialConfig_cursor = 4;
|
serialConfig_cursor = 4;
|
||||||
else
|
else
|
||||||
|
|
@ -1762,7 +1762,7 @@ void M_Menu_SerialConfig_f (void)
|
||||||
n = 5;
|
n = 5;
|
||||||
serialConfig_baud = n;
|
serialConfig_baud = n;
|
||||||
|
|
||||||
m_return_onerror = false;
|
m_return_onerror = qfalse;
|
||||||
m_return_reason[0] = 0;
|
m_return_reason[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1925,7 +1925,7 @@ forward:
|
||||||
if (serialConfig_cursor < 3)
|
if (serialConfig_cursor < 3)
|
||||||
goto forward;
|
goto forward;
|
||||||
|
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
|
|
||||||
if (serialConfig_cursor == 3)
|
if (serialConfig_cursor == 3)
|
||||||
{
|
{
|
||||||
|
|
@ -1953,7 +1953,7 @@ forward:
|
||||||
}
|
}
|
||||||
|
|
||||||
m_return_state = m_state;
|
m_return_state = m_state;
|
||||||
m_return_onerror = true;
|
m_return_onerror = qtrue;
|
||||||
key_dest = key_game;
|
key_dest = key_game;
|
||||||
m_state = m_none;
|
m_state = m_none;
|
||||||
|
|
||||||
|
|
@ -2014,7 +2014,7 @@ void M_Menu_ModemConfig_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_modemconfig;
|
m_state = m_modemconfig;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
(*GetModemConfig) (0, &modemConfig_dialing, modemConfig_clear, modemConfig_init, modemConfig_hangup);
|
(*GetModemConfig) (0, &modemConfig_dialing, modemConfig_clear, modemConfig_init, modemConfig_hangup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2103,13 +2103,13 @@ void M_ModemConfig_Key (int key)
|
||||||
modemConfig_dialing = 'T';
|
modemConfig_dialing = 'T';
|
||||||
else
|
else
|
||||||
modemConfig_dialing = 'P';
|
modemConfig_dialing = 'P';
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modemConfig_cursor == 4)
|
if (modemConfig_cursor == 4)
|
||||||
{
|
{
|
||||||
(*SetModemConfig) (0, va ("%c", modemConfig_dialing), modemConfig_clear, modemConfig_init, modemConfig_hangup);
|
(*SetModemConfig) (0, va ("%c", modemConfig_dialing), modemConfig_clear, modemConfig_init, modemConfig_hangup);
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
M_Menu_SerialConfig_f ();
|
M_Menu_SerialConfig_f ();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -2185,7 +2185,7 @@ void M_Menu_LanConfig_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_lanconfig;
|
m_state = m_lanconfig;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
if (lanConfig_cursor == -1)
|
if (lanConfig_cursor == -1)
|
||||||
{
|
{
|
||||||
if (JoiningGame && TCPIPConfig)
|
if (JoiningGame && TCPIPConfig)
|
||||||
|
|
@ -2198,7 +2198,7 @@ void M_Menu_LanConfig_f (void)
|
||||||
lanConfig_port = DEFAULTnet_hostport;
|
lanConfig_port = DEFAULTnet_hostport;
|
||||||
sprintf(lanConfig_portname, "%u", lanConfig_port);
|
sprintf(lanConfig_portname, "%u", lanConfig_port);
|
||||||
|
|
||||||
m_return_onerror = false;
|
m_return_onerror = qfalse;
|
||||||
m_return_reason[0] = 0;
|
m_return_reason[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2290,7 +2290,7 @@ void M_LanConfig_Key (int key)
|
||||||
if (lanConfig_cursor == 0)
|
if (lanConfig_cursor == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
|
|
||||||
M_ConfigureNetSubsystem ();
|
M_ConfigureNetSubsystem ();
|
||||||
|
|
||||||
|
|
@ -2308,7 +2308,7 @@ void M_LanConfig_Key (int key)
|
||||||
if (lanConfig_cursor == 2)
|
if (lanConfig_cursor == 2)
|
||||||
{
|
{
|
||||||
m_return_state = m_state;
|
m_return_state = m_state;
|
||||||
m_return_onerror = true;
|
m_return_onerror = qtrue;
|
||||||
key_dest = key_game;
|
key_dest = key_game;
|
||||||
m_state = m_none;
|
m_state = m_none;
|
||||||
Cbuf_AddText ( va ("connect \"%s\"\n", lanConfig_joinname) );
|
Cbuf_AddText ( va ("connect \"%s\"\n", lanConfig_joinname) );
|
||||||
|
|
@ -2522,14 +2522,14 @@ episode_t rogueepisodes[] =
|
||||||
int startepisode;
|
int startepisode;
|
||||||
int startlevel;
|
int startlevel;
|
||||||
int maxplayers;
|
int maxplayers;
|
||||||
qboolean m_serverInfoMessage = false;
|
qboolean m_serverInfoMessage = qfalse;
|
||||||
double m_serverInfoMessageTime;
|
double m_serverInfoMessageTime;
|
||||||
|
|
||||||
void M_Menu_GameOptions_f (void)
|
void M_Menu_GameOptions_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_gameoptions;
|
m_state = m_gameoptions;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
if (maxplayers == 0)
|
if (maxplayers == 0)
|
||||||
maxplayers = svs.maxclients;
|
maxplayers = svs.maxclients;
|
||||||
if (maxplayers < 2)
|
if (maxplayers < 2)
|
||||||
|
|
@ -2660,7 +2660,7 @@ void M_GameOptions_Draw (void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_serverInfoMessage = false;
|
m_serverInfoMessage = qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2677,7 +2677,7 @@ void M_NetStart_Change (int dir)
|
||||||
if (maxplayers > svs.maxclientslimit)
|
if (maxplayers > svs.maxclientslimit)
|
||||||
{
|
{
|
||||||
maxplayers = svs.maxclientslimit;
|
maxplayers = svs.maxclientslimit;
|
||||||
m_serverInfoMessage = true;
|
m_serverInfoMessage = qtrue;
|
||||||
m_serverInfoMessageTime = realtime;
|
m_serverInfoMessageTime = realtime;
|
||||||
}
|
}
|
||||||
if (maxplayers < 2)
|
if (maxplayers < 2)
|
||||||
|
|
@ -2832,17 +2832,17 @@ void M_GameOptions_Key (int key)
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/* SEARCH MENU */
|
/* SEARCH MENU */
|
||||||
|
|
||||||
qboolean searchComplete = false;
|
qboolean searchComplete = qfalse;
|
||||||
double searchCompleteTime;
|
double searchCompleteTime;
|
||||||
|
|
||||||
void M_Menu_Search_f (void)
|
void M_Menu_Search_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_search;
|
m_state = m_search;
|
||||||
m_entersound = false;
|
m_entersound = qfalse;
|
||||||
slistSilent = true;
|
slistSilent = qtrue;
|
||||||
slistLocal = false;
|
slistLocal = qfalse;
|
||||||
searchComplete = false;
|
searchComplete = qfalse;
|
||||||
NET_Slist_f();
|
NET_Slist_f();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -2867,7 +2867,7 @@ void M_Search_Draw (void)
|
||||||
|
|
||||||
if (! searchComplete)
|
if (! searchComplete)
|
||||||
{
|
{
|
||||||
searchComplete = true;
|
searchComplete = qtrue;
|
||||||
searchCompleteTime = realtime;
|
searchCompleteTime = realtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2899,11 +2899,11 @@ void M_Menu_ServerList_f (void)
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_slist;
|
m_state = m_slist;
|
||||||
m_entersound = true;
|
m_entersound = qtrue;
|
||||||
slist_cursor = 0;
|
slist_cursor = 0;
|
||||||
m_return_onerror = false;
|
m_return_onerror = qfalse;
|
||||||
m_return_reason[0] = 0;
|
m_return_reason[0] = 0;
|
||||||
slist_sorted = false;
|
slist_sorted = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2928,7 +2928,7 @@ void M_ServerList_Draw (void)
|
||||||
Q_memcpy(&hostcache[i], &temp, sizeof(hostcache_t));
|
Q_memcpy(&hostcache[i], &temp, sizeof(hostcache_t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
slist_sorted = true;
|
slist_sorted = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = Draw_CachePic ("gfx/p_multi.lmp");
|
p = Draw_CachePic ("gfx/p_multi.lmp");
|
||||||
|
|
@ -2979,8 +2979,8 @@ void M_ServerList_Key (int k)
|
||||||
case K_ENTER:
|
case K_ENTER:
|
||||||
S_LocalSound ("misc/menu2.wav");
|
S_LocalSound ("misc/menu2.wav");
|
||||||
m_return_state = m_state;
|
m_return_state = m_state;
|
||||||
m_return_onerror = true;
|
m_return_onerror = qtrue;
|
||||||
slist_sorted = false;
|
slist_sorted = qfalse;
|
||||||
key_dest = key_game;
|
key_dest = key_game;
|
||||||
m_state = m_none;
|
m_state = m_none;
|
||||||
Cbuf_AddText ( va ("connect \"%s\"\n", hostcache[slist_cursor].cname) );
|
Cbuf_AddText ( va ("connect \"%s\"\n", hostcache[slist_cursor].cname) );
|
||||||
|
|
@ -3037,7 +3037,7 @@ void M_Draw (void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_recursiveDraw = false;
|
m_recursiveDraw = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (m_state)
|
switch (m_state)
|
||||||
|
|
@ -3121,7 +3121,7 @@ void M_Draw (void)
|
||||||
if (m_entersound)
|
if (m_entersound)
|
||||||
{
|
{
|
||||||
S_LocalSound ("misc/menu2.wav");
|
S_LocalSound ("misc/menu2.wav");
|
||||||
m_entersound = false;
|
m_entersound = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
VID_UnlockBuffer ();
|
VID_UnlockBuffer ();
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ net_driver_t net_drivers[MAX_NET_DRIVERS] =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
"Loopback",
|
"Loopback",
|
||||||
false,
|
qfalse,
|
||||||
Loop_Init,
|
Loop_Init,
|
||||||
Loop_Listen,
|
Loop_Listen,
|
||||||
Loop_SearchForHosts,
|
Loop_SearchForHosts,
|
||||||
|
|
@ -43,7 +43,7 @@ net_driver_t net_drivers[MAX_NET_DRIVERS] =
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
"Datagram",
|
"Datagram",
|
||||||
false,
|
qfalse,
|
||||||
Datagram_Init,
|
Datagram_Init,
|
||||||
Datagram_Listen,
|
Datagram_Listen,
|
||||||
Datagram_SearchForHosts,
|
Datagram_SearchForHosts,
|
||||||
|
|
@ -67,7 +67,7 @@ net_landriver_t net_landrivers[MAX_NET_DRIVERS] =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
"UDP",
|
"UDP",
|
||||||
false,
|
qfalse,
|
||||||
0,
|
0,
|
||||||
UDP_Init,
|
UDP_Init,
|
||||||
UDP_Shutdown,
|
UDP_Shutdown,
|
||||||
|
|
|
||||||
|
|
@ -171,8 +171,8 @@ int Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data)
|
||||||
if (data->cursize > NET_MAXMESSAGE)
|
if (data->cursize > NET_MAXMESSAGE)
|
||||||
Sys_Error("Datagram_SendMessage: message too big %u\n", data->cursize);
|
Sys_Error("Datagram_SendMessage: message too big %u\n", data->cursize);
|
||||||
|
|
||||||
if (sock->canSend == false)
|
if (sock->canSend == qfalse)
|
||||||
Sys_Error("SendMessage: called with canSend == false\n");
|
Sys_Error("SendMessage: called with canSend == qfalse\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Q_memcpy(sock->sendMessage, data->data, data->cursize);
|
Q_memcpy(sock->sendMessage, data->data, data->cursize);
|
||||||
|
|
@ -194,7 +194,7 @@ int Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data)
|
||||||
packetBuffer.sequence = BigLong(sock->sendSequence++);
|
packetBuffer.sequence = BigLong(sock->sendSequence++);
|
||||||
Q_memcpy (packetBuffer.data, sock->sendMessage, dataLen);
|
Q_memcpy (packetBuffer.data, sock->sendMessage, dataLen);
|
||||||
|
|
||||||
sock->canSend = false;
|
sock->canSend = qfalse;
|
||||||
|
|
||||||
if (sfunc.Write (sock->socket, (byte *)&packetBuffer, packetLen, &sock->addr) == -1)
|
if (sfunc.Write (sock->socket, (byte *)&packetBuffer, packetLen, &sock->addr) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -227,7 +227,7 @@ int SendMessageNext (qsocket_t *sock)
|
||||||
packetBuffer.sequence = BigLong(sock->sendSequence++);
|
packetBuffer.sequence = BigLong(sock->sendSequence++);
|
||||||
Q_memcpy (packetBuffer.data, sock->sendMessage, dataLen);
|
Q_memcpy (packetBuffer.data, sock->sendMessage, dataLen);
|
||||||
|
|
||||||
sock->sendNext = false;
|
sock->sendNext = qfalse;
|
||||||
|
|
||||||
if (sfunc.Write (sock->socket, (byte *)&packetBuffer, packetLen, &sock->addr) == -1)
|
if (sfunc.Write (sock->socket, (byte *)&packetBuffer, packetLen, &sock->addr) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -260,7 +260,7 @@ int ReSendMessage (qsocket_t *sock)
|
||||||
packetBuffer.sequence = BigLong(sock->sendSequence - 1);
|
packetBuffer.sequence = BigLong(sock->sendSequence - 1);
|
||||||
Q_memcpy (packetBuffer.data, sock->sendMessage, dataLen);
|
Q_memcpy (packetBuffer.data, sock->sendMessage, dataLen);
|
||||||
|
|
||||||
sock->sendNext = false;
|
sock->sendNext = qfalse;
|
||||||
|
|
||||||
if (sfunc.Write (sock->socket, (byte *)&packetBuffer, packetLen, &sock->addr) == -1)
|
if (sfunc.Write (sock->socket, (byte *)&packetBuffer, packetLen, &sock->addr) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -282,7 +282,7 @@ qboolean Datagram_CanSendMessage (qsocket_t *sock)
|
||||||
|
|
||||||
qboolean Datagram_CanSendUnreliableMessage (qsocket_t *sock)
|
qboolean Datagram_CanSendUnreliableMessage (qsocket_t *sock)
|
||||||
{
|
{
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -414,12 +414,12 @@ int Datagram_GetMessage (qsocket_t *sock)
|
||||||
if (sock->sendMessageLength > 0)
|
if (sock->sendMessageLength > 0)
|
||||||
{
|
{
|
||||||
Q_memcpy(sock->sendMessage, sock->sendMessage+MAX_DATAGRAM, sock->sendMessageLength);
|
Q_memcpy(sock->sendMessage, sock->sendMessage+MAX_DATAGRAM, sock->sendMessageLength);
|
||||||
sock->sendNext = true;
|
sock->sendNext = qtrue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sock->sendMessageLength = 0;
|
sock->sendMessageLength = 0;
|
||||||
sock->canSend = true;
|
sock->canSend = qtrue;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -511,7 +511,7 @@ void NET_Stats_f (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static qboolean testInProgress = false;
|
static qboolean testInProgress = qfalse;
|
||||||
static int testPollCount;
|
static int testPollCount;
|
||||||
static int testDriver;
|
static int testDriver;
|
||||||
static int testSocket;
|
static int testSocket;
|
||||||
|
|
@ -572,7 +572,7 @@ static void Test_Poll(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dfunc.CloseSocket(testSocket);
|
dfunc.CloseSocket(testSocket);
|
||||||
testInProgress = false;
|
testInProgress = qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -621,7 +621,7 @@ JustDoIt:
|
||||||
if (testSocket == -1)
|
if (testSocket == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
testInProgress = true;
|
testInProgress = qtrue;
|
||||||
testPollCount = 20;
|
testPollCount = 20;
|
||||||
testDriver = net_landriverlevel;
|
testDriver = net_landriverlevel;
|
||||||
|
|
||||||
|
|
@ -640,7 +640,7 @@ JustDoIt:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static qboolean test2InProgress = false;
|
static qboolean test2InProgress = qfalse;
|
||||||
static int test2Driver;
|
static int test2Driver;
|
||||||
static int test2Socket;
|
static int test2Socket;
|
||||||
|
|
||||||
|
|
@ -701,7 +701,7 @@ Error:
|
||||||
Con_Printf("Unexpected repsonse to Rule Info request\n");
|
Con_Printf("Unexpected repsonse to Rule Info request\n");
|
||||||
Done:
|
Done:
|
||||||
dfunc.CloseSocket(test2Socket);
|
dfunc.CloseSocket(test2Socket);
|
||||||
test2InProgress = false;
|
test2InProgress = qfalse;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -748,7 +748,7 @@ JustDoIt:
|
||||||
if (test2Socket == -1)
|
if (test2Socket == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
test2InProgress = true;
|
test2InProgress = qtrue;
|
||||||
test2Driver = net_landriverlevel;
|
test2Driver = net_landriverlevel;
|
||||||
|
|
||||||
SZ_Clear(&net_message);
|
SZ_Clear(&net_message);
|
||||||
|
|
@ -783,7 +783,7 @@ int Datagram_Init (void)
|
||||||
csock = net_landrivers[i].Init ();
|
csock = net_landrivers[i].Init ();
|
||||||
if (csock == -1)
|
if (csock == -1)
|
||||||
continue;
|
continue;
|
||||||
net_landrivers[i].initialized = true;
|
net_landrivers[i].initialized = qtrue;
|
||||||
net_landrivers[i].controlSock = csock;
|
net_landrivers[i].controlSock = csock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -809,7 +809,7 @@ void Datagram_Shutdown (void)
|
||||||
if (net_landrivers[i].initialized)
|
if (net_landrivers[i].initialized)
|
||||||
{
|
{
|
||||||
net_landrivers[i].Shutdown ();
|
net_landrivers[i].Shutdown ();
|
||||||
net_landrivers[i].initialized = false;
|
net_landrivers[i].initialized = qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1366,7 +1366,7 @@ static qsocket_t *_Datagram_Connect (char *host)
|
||||||
goto ErrorReturn;
|
goto ErrorReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_return_onerror = false;
|
m_return_onerror = qfalse;
|
||||||
return sock;
|
return sock;
|
||||||
|
|
||||||
ErrorReturn:
|
ErrorReturn:
|
||||||
|
|
@ -1377,7 +1377,7 @@ ErrorReturn2:
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_return_state;
|
m_state = m_return_state;
|
||||||
m_return_onerror = false;
|
m_return_onerror = qfalse;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "quakedef.h"
|
#include "quakedef.h"
|
||||||
#include "net_loop.h"
|
#include "net_loop.h"
|
||||||
|
|
||||||
qboolean localconnectpending = false;
|
qboolean localconnectpending = qfalse;
|
||||||
qsocket_t *loop_client = NULL;
|
qsocket_t *loop_client = NULL;
|
||||||
qsocket_t *loop_server = NULL;
|
qsocket_t *loop_server = NULL;
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ qsocket_t *Loop_Connect (char *host)
|
||||||
if (Q_strcmp(host,"local") != 0)
|
if (Q_strcmp(host,"local") != 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
localconnectpending = true;
|
localconnectpending = qtrue;
|
||||||
|
|
||||||
if (!loop_client)
|
if (!loop_client)
|
||||||
{
|
{
|
||||||
|
|
@ -80,7 +80,7 @@ qsocket_t *Loop_Connect (char *host)
|
||||||
}
|
}
|
||||||
loop_client->receiveMessageLength = 0;
|
loop_client->receiveMessageLength = 0;
|
||||||
loop_client->sendMessageLength = 0;
|
loop_client->sendMessageLength = 0;
|
||||||
loop_client->canSend = true;
|
loop_client->canSend = qtrue;
|
||||||
|
|
||||||
if (!loop_server)
|
if (!loop_server)
|
||||||
{
|
{
|
||||||
|
|
@ -93,7 +93,7 @@ qsocket_t *Loop_Connect (char *host)
|
||||||
}
|
}
|
||||||
loop_server->receiveMessageLength = 0;
|
loop_server->receiveMessageLength = 0;
|
||||||
loop_server->sendMessageLength = 0;
|
loop_server->sendMessageLength = 0;
|
||||||
loop_server->canSend = true;
|
loop_server->canSend = qtrue;
|
||||||
|
|
||||||
loop_client->driverdata = (void *)loop_server;
|
loop_client->driverdata = (void *)loop_server;
|
||||||
loop_server->driverdata = (void *)loop_client;
|
loop_server->driverdata = (void *)loop_client;
|
||||||
|
|
@ -107,13 +107,13 @@ qsocket_t *Loop_CheckNewConnections (void)
|
||||||
if (!localconnectpending)
|
if (!localconnectpending)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
localconnectpending = false;
|
localconnectpending = qfalse;
|
||||||
loop_server->sendMessageLength = 0;
|
loop_server->sendMessageLength = 0;
|
||||||
loop_server->receiveMessageLength = 0;
|
loop_server->receiveMessageLength = 0;
|
||||||
loop_server->canSend = true;
|
loop_server->canSend = qtrue;
|
||||||
loop_client->sendMessageLength = 0;
|
loop_client->sendMessageLength = 0;
|
||||||
loop_client->receiveMessageLength = 0;
|
loop_client->receiveMessageLength = 0;
|
||||||
loop_client->canSend = true;
|
loop_client->canSend = qtrue;
|
||||||
return loop_server;
|
return loop_server;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,7 +145,7 @@ int Loop_GetMessage (qsocket_t *sock)
|
||||||
Q_memcpy(sock->receiveMessage, &sock->receiveMessage[length], sock->receiveMessageLength);
|
Q_memcpy(sock->receiveMessage, &sock->receiveMessage[length], sock->receiveMessageLength);
|
||||||
|
|
||||||
if (sock->driverdata && ret == 1)
|
if (sock->driverdata && ret == 1)
|
||||||
((qsocket_t *)sock->driverdata)->canSend = true;
|
((qsocket_t *)sock->driverdata)->canSend = qtrue;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -180,7 +180,7 @@ int Loop_SendMessage (qsocket_t *sock, sizebuf_t *data)
|
||||||
Q_memcpy(buffer, data->data, data->cursize);
|
Q_memcpy(buffer, data->data, data->cursize);
|
||||||
*bufferLength = IntAlign(*bufferLength + data->cursize + 4);
|
*bufferLength = IntAlign(*bufferLength + data->cursize + 4);
|
||||||
|
|
||||||
sock->canSend = false;
|
sock->canSend = qfalse;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -220,14 +220,14 @@ int Loop_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data)
|
||||||
qboolean Loop_CanSendMessage (qsocket_t *sock)
|
qboolean Loop_CanSendMessage (qsocket_t *sock)
|
||||||
{
|
{
|
||||||
if (!sock->driverdata)
|
if (!sock->driverdata)
|
||||||
return false;
|
return qfalse;
|
||||||
return sock->canSend;
|
return sock->canSend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
qboolean Loop_CanSendUnreliableMessage (qsocket_t *sock)
|
qboolean Loop_CanSendUnreliableMessage (qsocket_t *sock)
|
||||||
{
|
{
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -237,7 +237,7 @@ void Loop_Close (qsocket_t *sock)
|
||||||
((qsocket_t *)sock->driverdata)->driverdata = NULL;
|
((qsocket_t *)sock->driverdata)->driverdata = NULL;
|
||||||
sock->receiveMessageLength = 0;
|
sock->receiveMessageLength = 0;
|
||||||
sock->sendMessageLength = 0;
|
sock->sendMessageLength = 0;
|
||||||
sock->canSend = true;
|
sock->canSend = qtrue;
|
||||||
if (sock == loop_client)
|
if (sock == loop_client)
|
||||||
loop_client = NULL;
|
loop_client = NULL;
|
||||||
else
|
else
|
||||||
|
|
|
||||||
120
src/net_main.c
120
src/net_main.c
|
|
@ -26,9 +26,9 @@ qsocket_t *net_activeSockets = NULL;
|
||||||
qsocket_t *net_freeSockets = NULL;
|
qsocket_t *net_freeSockets = NULL;
|
||||||
int net_numsockets = 0;
|
int net_numsockets = 0;
|
||||||
|
|
||||||
qboolean serialAvailable = false;
|
qboolean serialAvailable = qfalse;
|
||||||
qboolean ipxAvailable = false;
|
qboolean ipxAvailable = qfalse;
|
||||||
qboolean tcpipAvailable = false;
|
qboolean tcpipAvailable = qfalse;
|
||||||
|
|
||||||
int net_hostport;
|
int net_hostport;
|
||||||
int DEFAULTnet_hostport = 26000;
|
int DEFAULTnet_hostport = 26000;
|
||||||
|
|
@ -41,11 +41,11 @@ void (*SetComPortConfig) (int portNumber, int port, int irq, int baud, qboolean
|
||||||
void (*GetModemConfig) (int portNumber, char *dialType, char *clear, char *init, char *hangup);
|
void (*GetModemConfig) (int portNumber, char *dialType, char *clear, char *init, char *hangup);
|
||||||
void (*SetModemConfig) (int portNumber, char *dialType, char *clear, char *init, char *hangup);
|
void (*SetModemConfig) (int portNumber, char *dialType, char *clear, char *init, char *hangup);
|
||||||
|
|
||||||
static qboolean listening = false;
|
static qboolean listening = qfalse;
|
||||||
|
|
||||||
qboolean slistInProgress = false;
|
qboolean slistInProgress = qfalse;
|
||||||
qboolean slistSilent = false;
|
qboolean slistSilent = qfalse;
|
||||||
qboolean slistLocal = true;
|
qboolean slistLocal = qtrue;
|
||||||
static double slistStartTime;
|
static double slistStartTime;
|
||||||
static int slistLastShown;
|
static int slistLastShown;
|
||||||
|
|
||||||
|
|
@ -66,22 +66,22 @@ int unreliableMessagesReceived = 0;
|
||||||
cvar_t net_messagetimeout = {"net_messagetimeout","300"};
|
cvar_t net_messagetimeout = {"net_messagetimeout","300"};
|
||||||
cvar_t hostname = {"hostname", "UNNAMED"};
|
cvar_t hostname = {"hostname", "UNNAMED"};
|
||||||
|
|
||||||
qboolean configRestored = false;
|
qboolean configRestored = qfalse;
|
||||||
cvar_t config_com_port = {"_config_com_port", "0x3f8", true};
|
cvar_t config_com_port = {"_config_com_port", "0x3f8", qtrue};
|
||||||
cvar_t config_com_irq = {"_config_com_irq", "4", true};
|
cvar_t config_com_irq = {"_config_com_irq", "4", qtrue};
|
||||||
cvar_t config_com_baud = {"_config_com_baud", "57600", true};
|
cvar_t config_com_baud = {"_config_com_baud", "57600", qtrue};
|
||||||
cvar_t config_com_modem = {"_config_com_modem", "1", true};
|
cvar_t config_com_modem = {"_config_com_modem", "1", qtrue};
|
||||||
cvar_t config_modem_dialtype = {"_config_modem_dialtype", "T", true};
|
cvar_t config_modem_dialtype = {"_config_modem_dialtype", "T", qtrue};
|
||||||
cvar_t config_modem_clear = {"_config_modem_clear", "ATZ", true};
|
cvar_t config_modem_clear = {"_config_modem_clear", "ATZ", qtrue};
|
||||||
cvar_t config_modem_init = {"_config_modem_init", "", true};
|
cvar_t config_modem_init = {"_config_modem_init", "", qtrue};
|
||||||
cvar_t config_modem_hangup = {"_config_modem_hangup", "AT H", true};
|
cvar_t config_modem_hangup = {"_config_modem_hangup", "AT H", qtrue};
|
||||||
|
|
||||||
#ifdef IDGODS
|
#ifdef IDGODS
|
||||||
cvar_t idgods = {"idgods", "0"};
|
cvar_t idgods = {"idgods", "0"};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int vcrFile = -1;
|
int vcrFile = -1;
|
||||||
qboolean recording = false;
|
qboolean recording = qfalse;
|
||||||
|
|
||||||
// these two macros are to make the code more readable
|
// these two macros are to make the code more readable
|
||||||
#define sfunc net_drivers[sock->driver]
|
#define sfunc net_drivers[sock->driver]
|
||||||
|
|
@ -125,14 +125,14 @@ qsocket_t *NET_NewQSocket (void)
|
||||||
sock->next = net_activeSockets;
|
sock->next = net_activeSockets;
|
||||||
net_activeSockets = sock;
|
net_activeSockets = sock;
|
||||||
|
|
||||||
sock->disconnected = false;
|
sock->disconnected = qfalse;
|
||||||
sock->connecttime = net_time;
|
sock->connecttime = net_time;
|
||||||
Q_strcpy (sock->address,"UNSET ADDRESS");
|
Q_strcpy (sock->address,"UNSET ADDRESS");
|
||||||
sock->driver = net_driverlevel;
|
sock->driver = net_driverlevel;
|
||||||
sock->socket = 0;
|
sock->socket = 0;
|
||||||
sock->driverdata = NULL;
|
sock->driverdata = NULL;
|
||||||
sock->canSend = true;
|
sock->canSend = qtrue;
|
||||||
sock->sendNext = false;
|
sock->sendNext = qfalse;
|
||||||
sock->lastMessageTime = net_time;
|
sock->lastMessageTime = net_time;
|
||||||
sock->ackSequence = 0;
|
sock->ackSequence = 0;
|
||||||
sock->sendSequence = 0;
|
sock->sendSequence = 0;
|
||||||
|
|
@ -168,7 +168,7 @@ void NET_FreeQSocket(qsocket_t *sock)
|
||||||
// add it to free list
|
// add it to free list
|
||||||
sock->next = net_freeSockets;
|
sock->next = net_freeSockets;
|
||||||
net_freeSockets = sock;
|
net_freeSockets = sock;
|
||||||
sock->disconnected = true;
|
sock->disconnected = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -180,11 +180,11 @@ static void NET_Listen_f (void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
listening = Q_atoi(Cmd_Argv(1)) ? true : false;
|
listening = Q_atoi(Cmd_Argv(1)) ? qtrue : qfalse;
|
||||||
|
|
||||||
for (net_driverlevel=0 ; net_driverlevel<net_numdrivers; net_driverlevel++)
|
for (net_driverlevel=0 ; net_driverlevel<net_numdrivers; net_driverlevel++)
|
||||||
{
|
{
|
||||||
if (net_drivers[net_driverlevel].initialized == false)
|
if (net_drivers[net_driverlevel].initialized == qfalse)
|
||||||
continue;
|
continue;
|
||||||
dfunc.Listen (listening);
|
dfunc.Listen (listening);
|
||||||
}
|
}
|
||||||
|
|
@ -302,7 +302,7 @@ void NET_Slist_f (void)
|
||||||
PrintSlistHeader();
|
PrintSlistHeader();
|
||||||
}
|
}
|
||||||
|
|
||||||
slistInProgress = true;
|
slistInProgress = qtrue;
|
||||||
slistStartTime = Sys_FloatTime();
|
slistStartTime = Sys_FloatTime();
|
||||||
|
|
||||||
SchedulePollProcedure(&slistSendProcedure, 0.0);
|
SchedulePollProcedure(&slistSendProcedure, 0.0);
|
||||||
|
|
@ -318,9 +318,9 @@ static void Slist_Send(void)
|
||||||
{
|
{
|
||||||
if (!slistLocal && net_driverlevel == 0)
|
if (!slistLocal && net_driverlevel == 0)
|
||||||
continue;
|
continue;
|
||||||
if (net_drivers[net_driverlevel].initialized == false)
|
if (net_drivers[net_driverlevel].initialized == qfalse)
|
||||||
continue;
|
continue;
|
||||||
dfunc.SearchForHosts (true);
|
dfunc.SearchForHosts (qtrue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Sys_FloatTime() - slistStartTime) < 0.5)
|
if ((Sys_FloatTime() - slistStartTime) < 0.5)
|
||||||
|
|
@ -334,9 +334,9 @@ static void Slist_Poll(void)
|
||||||
{
|
{
|
||||||
if (!slistLocal && net_driverlevel == 0)
|
if (!slistLocal && net_driverlevel == 0)
|
||||||
continue;
|
continue;
|
||||||
if (net_drivers[net_driverlevel].initialized == false)
|
if (net_drivers[net_driverlevel].initialized == qfalse)
|
||||||
continue;
|
continue;
|
||||||
dfunc.SearchForHosts (false);
|
dfunc.SearchForHosts (qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! slistSilent)
|
if (! slistSilent)
|
||||||
|
|
@ -350,9 +350,9 @@ static void Slist_Poll(void)
|
||||||
|
|
||||||
if (! slistSilent)
|
if (! slistSilent)
|
||||||
PrintSlistTrailer();
|
PrintSlistTrailer();
|
||||||
slistInProgress = false;
|
slistInProgress = qfalse;
|
||||||
slistSilent = false;
|
slistSilent = qfalse;
|
||||||
slistLocal = true;
|
slistLocal = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -397,7 +397,7 @@ qsocket_t *NET_Connect (char *host)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
slistSilent = host ? true : false;
|
slistSilent = host ? qtrue : qfalse;
|
||||||
NET_Slist_f ();
|
NET_Slist_f ();
|
||||||
|
|
||||||
while(slistInProgress)
|
while(slistInProgress)
|
||||||
|
|
@ -422,7 +422,7 @@ qsocket_t *NET_Connect (char *host)
|
||||||
JustDoIt:
|
JustDoIt:
|
||||||
for (net_driverlevel=0 ; net_driverlevel<numdrivers; net_driverlevel++)
|
for (net_driverlevel=0 ; net_driverlevel<numdrivers; net_driverlevel++)
|
||||||
{
|
{
|
||||||
if (net_drivers[net_driverlevel].initialized == false)
|
if (net_drivers[net_driverlevel].initialized == qfalse)
|
||||||
continue;
|
continue;
|
||||||
ret = dfunc.Connect (host);
|
ret = dfunc.Connect (host);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
@ -462,9 +462,9 @@ qsocket_t *NET_CheckNewConnections (void)
|
||||||
|
|
||||||
for (net_driverlevel=0 ; net_driverlevel<net_numdrivers; net_driverlevel++)
|
for (net_driverlevel=0 ; net_driverlevel<net_numdrivers; net_driverlevel++)
|
||||||
{
|
{
|
||||||
if (net_drivers[net_driverlevel].initialized == false)
|
if (net_drivers[net_driverlevel].initialized == qfalse)
|
||||||
continue;
|
continue;
|
||||||
if (net_driverlevel && listening == false)
|
if (net_driverlevel && listening == qfalse)
|
||||||
continue;
|
continue;
|
||||||
ret = dfunc.CheckNewConnections ();
|
ret = dfunc.CheckNewConnections ();
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
@ -688,7 +688,7 @@ int NET_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data)
|
||||||
==================
|
==================
|
||||||
NET_CanSendMessage
|
NET_CanSendMessage
|
||||||
|
|
||||||
Returns true or false if the given qsocket can currently accept a
|
Returns qtrue or qfalse if the given qsocket can currently accept a
|
||||||
message to be transmitted.
|
message to be transmitted.
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
|
|
@ -697,10 +697,10 @@ qboolean NET_CanSendMessage (qsocket_t *sock)
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (!sock)
|
if (!sock)
|
||||||
return false;
|
return qfalse;
|
||||||
|
|
||||||
if (sock->disconnected)
|
if (sock->disconnected)
|
||||||
return false;
|
return qfalse;
|
||||||
|
|
||||||
SetNetTime();
|
SetNetTime();
|
||||||
|
|
||||||
|
|
@ -736,18 +736,18 @@ int NET_SendToAll(sizebuf_t *data, int blocktime)
|
||||||
if (host_client->netconnection->driver == 0)
|
if (host_client->netconnection->driver == 0)
|
||||||
{
|
{
|
||||||
NET_SendMessage(host_client->netconnection, data);
|
NET_SendMessage(host_client->netconnection, data);
|
||||||
state1[i] = true;
|
state1[i] = qtrue;
|
||||||
state2[i] = true;
|
state2[i] = qtrue;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
state1[i] = false;
|
state1[i] = qfalse;
|
||||||
state2[i] = false;
|
state2[i] = qfalse;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
state1[i] = true;
|
state1[i] = qtrue;
|
||||||
state2[i] = true;
|
state2[i] = qtrue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -761,7 +761,7 @@ int NET_SendToAll(sizebuf_t *data, int blocktime)
|
||||||
{
|
{
|
||||||
if (NET_CanSendMessage (host_client->netconnection))
|
if (NET_CanSendMessage (host_client->netconnection))
|
||||||
{
|
{
|
||||||
state1[i] = true;
|
state1[i] = qtrue;
|
||||||
NET_SendMessage(host_client->netconnection, data);
|
NET_SendMessage(host_client->netconnection, data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -776,7 +776,7 @@ int NET_SendToAll(sizebuf_t *data, int blocktime)
|
||||||
{
|
{
|
||||||
if (NET_CanSendMessage (host_client->netconnection))
|
if (NET_CanSendMessage (host_client->netconnection))
|
||||||
{
|
{
|
||||||
state2[i] = true;
|
state2[i] = qtrue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -814,7 +814,7 @@ void NET_Init (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (COM_CheckParm("-record"))
|
if (COM_CheckParm("-record"))
|
||||||
recording = true;
|
recording = qtrue;
|
||||||
|
|
||||||
i = COM_CheckParm ("-port");
|
i = COM_CheckParm ("-port");
|
||||||
if (!i)
|
if (!i)
|
||||||
|
|
@ -832,7 +832,7 @@ void NET_Init (void)
|
||||||
net_hostport = DEFAULTnet_hostport;
|
net_hostport = DEFAULTnet_hostport;
|
||||||
|
|
||||||
if (COM_CheckParm("-listen") || cls.state == ca_dedicated)
|
if (COM_CheckParm("-listen") || cls.state == ca_dedicated)
|
||||||
listening = true;
|
listening = qtrue;
|
||||||
net_numsockets = svs.maxclientslimit;
|
net_numsockets = svs.maxclientslimit;
|
||||||
if (cls.state != ca_dedicated)
|
if (cls.state != ca_dedicated)
|
||||||
net_numsockets++;
|
net_numsockets++;
|
||||||
|
|
@ -844,7 +844,7 @@ void NET_Init (void)
|
||||||
s = (qsocket_t *)Hunk_AllocName(sizeof(qsocket_t), "qsocket");
|
s = (qsocket_t *)Hunk_AllocName(sizeof(qsocket_t), "qsocket");
|
||||||
s->next = net_freeSockets;
|
s->next = net_freeSockets;
|
||||||
net_freeSockets = s;
|
net_freeSockets = s;
|
||||||
s->disconnected = true;
|
s->disconnected = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate space for network message buffer
|
// allocate space for network message buffer
|
||||||
|
|
@ -875,10 +875,10 @@ void NET_Init (void)
|
||||||
controlSocket = net_drivers[net_driverlevel].Init();
|
controlSocket = net_drivers[net_driverlevel].Init();
|
||||||
if (controlSocket == -1)
|
if (controlSocket == -1)
|
||||||
continue;
|
continue;
|
||||||
net_drivers[net_driverlevel].initialized = true;
|
net_drivers[net_driverlevel].initialized = qtrue;
|
||||||
net_drivers[net_driverlevel].controlSock = controlSocket;
|
net_drivers[net_driverlevel].controlSock = controlSocket;
|
||||||
if (listening)
|
if (listening)
|
||||||
net_drivers[net_driverlevel].Listen (true);
|
net_drivers[net_driverlevel].Listen (qtrue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*my_ipx_address)
|
if (*my_ipx_address)
|
||||||
|
|
@ -907,10 +907,10 @@ void NET_Shutdown (void)
|
||||||
//
|
//
|
||||||
for (net_driverlevel = 0; net_driverlevel < net_numdrivers; net_driverlevel++)
|
for (net_driverlevel = 0; net_driverlevel < net_numdrivers; net_driverlevel++)
|
||||||
{
|
{
|
||||||
if (net_drivers[net_driverlevel].initialized == true)
|
if (net_drivers[net_driverlevel].initialized == qtrue)
|
||||||
{
|
{
|
||||||
net_drivers[net_driverlevel].Shutdown ();
|
net_drivers[net_driverlevel].Shutdown ();
|
||||||
net_drivers[net_driverlevel].initialized = false;
|
net_drivers[net_driverlevel].initialized = qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -934,13 +934,13 @@ void NET_Poll(void)
|
||||||
if (serialAvailable)
|
if (serialAvailable)
|
||||||
{
|
{
|
||||||
if (config_com_modem.value == 1.0)
|
if (config_com_modem.value == 1.0)
|
||||||
useModem = true;
|
useModem = qtrue;
|
||||||
else
|
else
|
||||||
useModem = false;
|
useModem = qfalse;
|
||||||
SetComPortConfig (0, (int)config_com_port.value, (int)config_com_irq.value, (int)config_com_baud.value, useModem);
|
SetComPortConfig (0, (int)config_com_port.value, (int)config_com_irq.value, (int)config_com_baud.value, useModem);
|
||||||
SetModemConfig (0, config_modem_dialtype.string, config_modem_clear.string, config_modem_init.string, config_modem_hangup.string);
|
SetModemConfig (0, config_modem_dialtype.string, config_modem_clear.string, config_modem_init.string, config_modem_hangup.string);
|
||||||
}
|
}
|
||||||
configRestored = true;
|
configRestored = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetNetTime();
|
SetNetTime();
|
||||||
|
|
@ -985,13 +985,13 @@ void SchedulePollProcedure(PollProcedure *proc, double timeOffset)
|
||||||
qboolean IsID(struct qsockaddr *addr)
|
qboolean IsID(struct qsockaddr *addr)
|
||||||
{
|
{
|
||||||
if (idgods.value == 0.0)
|
if (idgods.value == 0.0)
|
||||||
return false;
|
return qfalse;
|
||||||
|
|
||||||
if (addr->sa_family != 2)
|
if (addr->sa_family != 2)
|
||||||
return false;
|
return qfalse;
|
||||||
|
|
||||||
if ((BigLong(*(int *)&addr->sa_data[2]) & 0xffffff00) == IDNET)
|
if ((BigLong(*(int *)&addr->sa_data[2]) & 0xffffff00) == IDNET)
|
||||||
return true;
|
return qtrue;
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ int UDP_Init (void)
|
||||||
*colon = 0;
|
*colon = 0;
|
||||||
|
|
||||||
Con_Printf("UDP Initialized\n");
|
Con_Printf("UDP Initialized\n");
|
||||||
tcpipAvailable = true;
|
tcpipAvailable = qtrue;
|
||||||
|
|
||||||
return net_controlsocket;
|
return net_controlsocket;
|
||||||
}
|
}
|
||||||
|
|
@ -111,7 +111,7 @@ int UDP_Init (void)
|
||||||
|
|
||||||
void UDP_Shutdown (void)
|
void UDP_Shutdown (void)
|
||||||
{
|
{
|
||||||
UDP_Listen (false);
|
UDP_Listen (qfalse);
|
||||||
UDP_CloseSocket (net_controlsocket);
|
UDP_CloseSocket (net_controlsocket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,16 +142,16 @@ int UDP_OpenSocket (int port)
|
||||||
{
|
{
|
||||||
int newsocket;
|
int newsocket;
|
||||||
struct sockaddr_in address;
|
struct sockaddr_in address;
|
||||||
qboolean _true = true;
|
qboolean _qtrue = qtrue;
|
||||||
|
|
||||||
if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
|
if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (ioctl (newsocket, FIONBIO, (u_long*)&_true) == -1)
|
if (ioctl (newsocket, FIONBIO, (u_long*)&_qtrue) == -1)
|
||||||
goto ErrorReturn;
|
goto ErrorReturn;
|
||||||
#else
|
#else
|
||||||
if (ioctl (newsocket, FIONBIO, (char *)&_true) == -1)
|
if (ioctl (newsocket, FIONBIO, (char *)&_qtrue) == -1)
|
||||||
goto ErrorReturn;
|
goto ErrorReturn;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ void PF_setorigin (void)
|
||||||
e = G_EDICT(OFS_PARM0);
|
e = G_EDICT(OFS_PARM0);
|
||||||
org = G_VECTOR(OFS_PARM1);
|
org = G_VECTOR(OFS_PARM1);
|
||||||
VectorCopy (org, e->v.origin);
|
VectorCopy (org, e->v.origin);
|
||||||
SV_LinkEdict (e, false);
|
SV_LinkEdict (e, qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -143,7 +143,7 @@ void SetMinMaxSize (edict_t *e, float *min, float *max, qboolean rotate)
|
||||||
if (min[i] > max[i])
|
if (min[i] > max[i])
|
||||||
PR_RunError ("backwards mins/maxs");
|
PR_RunError ("backwards mins/maxs");
|
||||||
|
|
||||||
rotate = false; // FIXME: implement rotation properly again
|
rotate = qfalse; // FIXME: implement rotation properly again
|
||||||
|
|
||||||
if (!rotate)
|
if (!rotate)
|
||||||
{
|
{
|
||||||
|
|
@ -200,7 +200,7 @@ void SetMinMaxSize (edict_t *e, float *min, float *max, qboolean rotate)
|
||||||
VectorCopy (rmax, e->v.maxs);
|
VectorCopy (rmax, e->v.maxs);
|
||||||
VectorSubtract (max, min, e->v.size);
|
VectorSubtract (max, min, e->v.size);
|
||||||
|
|
||||||
SV_LinkEdict (e, false);
|
SV_LinkEdict (e, qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -220,7 +220,7 @@ void PF_setsize (void)
|
||||||
e = G_EDICT(OFS_PARM0);
|
e = G_EDICT(OFS_PARM0);
|
||||||
min = G_VECTOR(OFS_PARM1);
|
min = G_VECTOR(OFS_PARM1);
|
||||||
max = G_VECTOR(OFS_PARM2);
|
max = G_VECTOR(OFS_PARM2);
|
||||||
SetMinMaxSize (e, min, max, false);
|
SetMinMaxSize (e, min, max, qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -253,12 +253,12 @@ void PF_setmodel (void)
|
||||||
e->v.model = PR_SetEngineString(*check);
|
e->v.model = PR_SetEngineString(*check);
|
||||||
e->v.modelindex = i; //SV_ModelIndex (m);
|
e->v.modelindex = i; //SV_ModelIndex (m);
|
||||||
|
|
||||||
mod = sv.models[ (int)e->v.modelindex]; // Mod_ForName (m, true);
|
mod = sv.models[ (int)e->v.modelindex]; // Mod_ForName (m, qtrue);
|
||||||
|
|
||||||
if (mod)
|
if (mod)
|
||||||
SetMinMaxSize (e, mod->mins, mod->maxs, true);
|
SetMinMaxSize (e, mod->mins, mod->maxs, qtrue);
|
||||||
else
|
else
|
||||||
SetMinMaxSize (e, vec3_origin, vec3_origin, true);
|
SetMinMaxSize (e, vec3_origin, vec3_origin, qtrue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -669,7 +669,7 @@ void PF_TraceToss (void)
|
||||||
=================
|
=================
|
||||||
PF_checkpos
|
PF_checkpos
|
||||||
|
|
||||||
Returns true if the given entity can move to the given position from it's
|
Returns qtrue if the given entity can move to the given position from it's
|
||||||
current position by walking or rolling.
|
current position by walking or rolling.
|
||||||
FIXME: make work...
|
FIXME: make work...
|
||||||
scalar checkpos (entity, vector)
|
scalar checkpos (entity, vector)
|
||||||
|
|
@ -1106,7 +1106,7 @@ void PF_precache_model (void)
|
||||||
if (!sv.model_precache[i])
|
if (!sv.model_precache[i])
|
||||||
{
|
{
|
||||||
sv.model_precache[i] = s;
|
sv.model_precache[i] = s;
|
||||||
sv.models[i] = Mod_ForName (s, true);
|
sv.models[i] = Mod_ForName (s, qtrue);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!strcmp(sv.model_precache[i], s))
|
if (!strcmp(sv.model_precache[i], s))
|
||||||
|
|
@ -1123,12 +1123,12 @@ void PF_coredump (void)
|
||||||
|
|
||||||
void PF_traceon (void)
|
void PF_traceon (void)
|
||||||
{
|
{
|
||||||
pr_trace = true;
|
pr_trace = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PF_traceoff (void)
|
void PF_traceoff (void)
|
||||||
{
|
{
|
||||||
pr_trace = false;
|
pr_trace = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PF_eprint (void)
|
void PF_eprint (void)
|
||||||
|
|
@ -1171,7 +1171,7 @@ void PF_walkmove (void)
|
||||||
oldf = pr_xfunction;
|
oldf = pr_xfunction;
|
||||||
oldself = pr_global_struct->self;
|
oldself = pr_global_struct->self;
|
||||||
|
|
||||||
G_FLOAT(OFS_RETURN) = SV_movestep(ent, move, true);
|
G_FLOAT(OFS_RETURN) = SV_movestep(ent, move, qtrue);
|
||||||
|
|
||||||
|
|
||||||
// restore program state
|
// restore program state
|
||||||
|
|
@ -1197,14 +1197,14 @@ void PF_droptofloor (void)
|
||||||
VectorCopy (ent->v.origin, end);
|
VectorCopy (ent->v.origin, end);
|
||||||
end[2] -= 256;
|
end[2] -= 256;
|
||||||
|
|
||||||
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, end, false, ent);
|
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, end, qfalse, ent);
|
||||||
|
|
||||||
if (trace.fraction == 1 || trace.allsolid)
|
if (trace.fraction == 1 || trace.allsolid)
|
||||||
G_FLOAT(OFS_RETURN) = 0;
|
G_FLOAT(OFS_RETURN) = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
VectorCopy (trace.endpos, ent->v.origin);
|
VectorCopy (trace.endpos, ent->v.origin);
|
||||||
SV_LinkEdict (ent, false);
|
SV_LinkEdict (ent, qfalse);
|
||||||
ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
|
ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
|
||||||
ent->v.groundentity = EDICT_TO_PROG(trace.ent);
|
ent->v.groundentity = EDICT_TO_PROG(trace.ent);
|
||||||
G_FLOAT(OFS_RETURN) = 1;
|
G_FLOAT(OFS_RETURN) = 1;
|
||||||
|
|
@ -1348,7 +1348,7 @@ void PF_aim (void)
|
||||||
// try sending a trace straight
|
// try sending a trace straight
|
||||||
VectorCopy (pr_global_struct->v_forward, dir);
|
VectorCopy (pr_global_struct->v_forward, dir);
|
||||||
VectorMA (start, 2048, dir, end);
|
VectorMA (start, 2048, dir, end);
|
||||||
tr = SV_Move (start, vec3_origin, vec3_origin, end, false, ent);
|
tr = SV_Move (start, vec3_origin, vec3_origin, end, qfalse, ent);
|
||||||
if (tr.ent && tr.ent->v.takedamage == DAMAGE_AIM
|
if (tr.ent && tr.ent->v.takedamage == DAMAGE_AIM
|
||||||
&& (!teamplay.value || ent->v.team <=0 || ent->v.team != tr.ent->v.team) )
|
&& (!teamplay.value || ent->v.team <=0 || ent->v.team != tr.ent->v.team) )
|
||||||
{
|
{
|
||||||
|
|
@ -1379,7 +1379,7 @@ void PF_aim (void)
|
||||||
dist = DotProduct (dir, pr_global_struct->v_forward);
|
dist = DotProduct (dir, pr_global_struct->v_forward);
|
||||||
if (dist < bestdist)
|
if (dist < bestdist)
|
||||||
continue; // to far to turn
|
continue; // to far to turn
|
||||||
tr = SV_Move (start, vec3_origin, vec3_origin, end, false, ent);
|
tr = SV_Move (start, vec3_origin, vec3_origin, end, qfalse, ent);
|
||||||
if (tr.ent == check)
|
if (tr.ent == check)
|
||||||
{ // can shoot at this one
|
{ // can shoot at this one
|
||||||
bestdist = dist;
|
bestdist = dist;
|
||||||
|
|
@ -1642,7 +1642,7 @@ void PF_changelevel (void)
|
||||||
|
|
||||||
if (svs.changelevel_issued)
|
if (svs.changelevel_issued)
|
||||||
return;
|
return;
|
||||||
svs.changelevel_issued = true;
|
svs.changelevel_issued = qtrue;
|
||||||
|
|
||||||
s1 = G_STRING(OFS_PARM0);
|
s1 = G_STRING(OFS_PARM0);
|
||||||
s2 = G_STRING(OFS_PARM1);
|
s2 = G_STRING(OFS_PARM1);
|
||||||
|
|
@ -1657,7 +1657,7 @@ void PF_changelevel (void)
|
||||||
// make sure we don't issue two changelevels
|
// make sure we don't issue two changelevels
|
||||||
if (svs.changelevel_issued)
|
if (svs.changelevel_issued)
|
||||||
return;
|
return;
|
||||||
svs.changelevel_issued = true;
|
svs.changelevel_issued = qtrue;
|
||||||
|
|
||||||
s = G_STRING(OFS_PARM0);
|
s = G_STRING(OFS_PARM0);
|
||||||
Cbuf_AddText (va("changelevel %s\n",s));
|
Cbuf_AddText (va("changelevel %s\n",s));
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,11 @@ cvar_t scratch1 = {"scratch1", "0"};
|
||||||
cvar_t scratch2 = {"scratch2", "0"};
|
cvar_t scratch2 = {"scratch2", "0"};
|
||||||
cvar_t scratch3 = {"scratch3", "0"};
|
cvar_t scratch3 = {"scratch3", "0"};
|
||||||
cvar_t scratch4 = {"scratch4", "0"};
|
cvar_t scratch4 = {"scratch4", "0"};
|
||||||
cvar_t savedgamecfg = {"savedgamecfg", "0", true};
|
cvar_t savedgamecfg = {"savedgamecfg", "0", qtrue};
|
||||||
cvar_t saved1 = {"saved1", "0", true};
|
cvar_t saved1 = {"saved1", "0", qtrue};
|
||||||
cvar_t saved2 = {"saved2", "0", true};
|
cvar_t saved2 = {"saved2", "0", qtrue};
|
||||||
cvar_t saved3 = {"saved3", "0", true};
|
cvar_t saved3 = {"saved3", "0", qtrue};
|
||||||
cvar_t saved4 = {"saved4", "0", true};
|
cvar_t saved4 = {"saved4", "0", qtrue};
|
||||||
|
|
||||||
#define MAX_FIELD_LEN 64
|
#define MAX_FIELD_LEN 64
|
||||||
#define GEFV_CACHESIZE 2
|
#define GEFV_CACHESIZE 2
|
||||||
|
|
@ -104,7 +104,7 @@ Sets everything to NULL
|
||||||
void ED_ClearEdict (edict_t *e)
|
void ED_ClearEdict (edict_t *e)
|
||||||
{
|
{
|
||||||
memset (&e->v, 0, progs->entityfields * 4);
|
memset (&e->v, 0, progs->entityfields * 4);
|
||||||
e->free = false;
|
e->free = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -157,7 +157,7 @@ void ED_Free (edict_t *ed)
|
||||||
{
|
{
|
||||||
SV_UnlinkEdict (ed); // unlink from world bsp
|
SV_UnlinkEdict (ed); // unlink from world bsp
|
||||||
|
|
||||||
ed->free = true;
|
ed->free = qtrue;
|
||||||
ed->v.model = 0;
|
ed->v.model = 0;
|
||||||
ed->v.takedamage = 0;
|
ed->v.takedamage = 0;
|
||||||
ed->v.modelindex = 0;
|
ed->v.modelindex = 0;
|
||||||
|
|
@ -756,7 +756,7 @@ static string_t ED_NewString (const char *string)
|
||||||
ED_ParseEval
|
ED_ParseEval
|
||||||
|
|
||||||
Can parse either fields or globals
|
Can parse either fields or globals
|
||||||
returns false if error
|
returns qfalse if error
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
qboolean ED_ParseEpair (void *base, ddef_t *key, char *s)
|
qboolean ED_ParseEpair (void *base, ddef_t *key, char *s)
|
||||||
|
|
@ -803,7 +803,7 @@ qboolean ED_ParseEpair (void *base, ddef_t *key, char *s)
|
||||||
if (!def)
|
if (!def)
|
||||||
{
|
{
|
||||||
Con_Printf ("Can't find field %s\n", s);
|
Con_Printf ("Can't find field %s\n", s);
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
*(int *)d = G_INT(def->ofs);
|
*(int *)d = G_INT(def->ofs);
|
||||||
break;
|
break;
|
||||||
|
|
@ -813,7 +813,7 @@ qboolean ED_ParseEpair (void *base, ddef_t *key, char *s)
|
||||||
if (!func)
|
if (!func)
|
||||||
{
|
{
|
||||||
Con_Printf ("Can't find function %s\n", s);
|
Con_Printf ("Can't find function %s\n", s);
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
*(func_t *)d = func - pr_functions;
|
*(func_t *)d = func - pr_functions;
|
||||||
break;
|
break;
|
||||||
|
|
@ -821,7 +821,7 @@ qboolean ED_ParseEpair (void *base, ddef_t *key, char *s)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -841,7 +841,7 @@ char *ED_ParseEdict (char *data, edict_t *ent)
|
||||||
char keyname[256];
|
char keyname[256];
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
init = false;
|
init = qfalse;
|
||||||
|
|
||||||
// clear it
|
// clear it
|
||||||
if (ent != sv.edicts) // hack
|
if (ent != sv.edicts) // hack
|
||||||
|
|
@ -862,10 +862,10 @@ char *ED_ParseEdict (char *data, edict_t *ent)
|
||||||
if (!strcmp(com_token, "angle"))
|
if (!strcmp(com_token, "angle"))
|
||||||
{
|
{
|
||||||
strcpy (com_token, "angles");
|
strcpy (com_token, "angles");
|
||||||
anglehack = true;
|
anglehack = qtrue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
anglehack = false;
|
anglehack = qfalse;
|
||||||
|
|
||||||
// FIXME: change light to _light to get rid of this hack
|
// FIXME: change light to _light to get rid of this hack
|
||||||
if (!strcmp(com_token, "light"))
|
if (!strcmp(com_token, "light"))
|
||||||
|
|
@ -889,7 +889,7 @@ if (!strcmp(com_token, "light"))
|
||||||
if (com_token[0] == '}')
|
if (com_token[0] == '}')
|
||||||
Sys_Error ("ED_ParseEntity: closing brace without data");
|
Sys_Error ("ED_ParseEntity: closing brace without data");
|
||||||
|
|
||||||
init = true;
|
init = qtrue;
|
||||||
|
|
||||||
// keynames with a leading underscore are used for utility comments,
|
// keynames with a leading underscore are used for utility comments,
|
||||||
// and are immediately discarded by quake
|
// and are immediately discarded by quake
|
||||||
|
|
@ -915,7 +915,7 @@ sprintf (com_token, "0 %s 0", temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!init)
|
if (!init)
|
||||||
ent->free = true;
|
ent->free = qtrue;
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -380,7 +380,7 @@ void PR_ExecuteProgram (func_t fnum)
|
||||||
f = &pr_functions[fnum];
|
f = &pr_functions[fnum];
|
||||||
|
|
||||||
runaway = 100000;
|
runaway = 100000;
|
||||||
pr_trace = false;
|
pr_trace = qfalse;
|
||||||
|
|
||||||
// make a stack frame
|
// make a stack frame
|
||||||
exitdepth = pr_depth;
|
exitdepth = pr_depth;
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ void Sbar_ShowScores (void)
|
||||||
{
|
{
|
||||||
if (sb_showscores)
|
if (sb_showscores)
|
||||||
return;
|
return;
|
||||||
sb_showscores = true;
|
sb_showscores = qtrue;
|
||||||
sb_updates = 0;
|
sb_updates = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -89,7 +89,7 @@ Tab key up
|
||||||
*/
|
*/
|
||||||
void Sbar_DontShowScores (void)
|
void Sbar_DontShowScores (void)
|
||||||
{
|
{
|
||||||
sb_showscores = false;
|
sb_showscores = qfalse;
|
||||||
sb_updates = 0;
|
sb_updates = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ qboolean SNDDMA_Init(void)
|
||||||
shm->channels = config.playback.channels;
|
shm->channels = config.playback.channels;
|
||||||
shm->speed = config.sampleRate;
|
shm->speed = config.sampleRate;
|
||||||
|
|
||||||
shm->soundalive = true;
|
shm->soundalive = qtrue;
|
||||||
shm->samples = sizeof(dma_buffer) / (shm->samplebits/8);
|
shm->samples = sizeof(dma_buffer) / (shm->samplebits/8);
|
||||||
shm->samplepos = 0;
|
shm->samplepos = 0;
|
||||||
shm->submission_chunk = 1;
|
shm->submission_chunk = 1;
|
||||||
|
|
|
||||||
28
src/sound.c
28
src/sound.c
|
|
@ -37,7 +37,7 @@ int total_channels;
|
||||||
|
|
||||||
int snd_blocked = 0;
|
int snd_blocked = 0;
|
||||||
static qboolean snd_ambient = 1;
|
static qboolean snd_ambient = 1;
|
||||||
qboolean snd_initialized = false;
|
qboolean snd_initialized = qfalse;
|
||||||
|
|
||||||
// pointer should go away
|
// pointer should go away
|
||||||
volatile dma_t *shm = 0;
|
volatile dma_t *shm = 0;
|
||||||
|
|
@ -64,8 +64,8 @@ int desired_bits = 16;
|
||||||
|
|
||||||
int sound_started=0;
|
int sound_started=0;
|
||||||
|
|
||||||
cvar_t bgmvolume = {"bgmvolume", "1", true};
|
cvar_t bgmvolume = {"bgmvolume", "1", qtrue};
|
||||||
cvar_t volume = {"volume", "0.7", true};
|
cvar_t volume = {"volume", "0.7", qtrue};
|
||||||
|
|
||||||
cvar_t nosound = {"nosound", "0"};
|
cvar_t nosound = {"nosound", "0"};
|
||||||
cvar_t precache = {"precache", "1"};
|
cvar_t precache = {"precache", "1"};
|
||||||
|
|
@ -75,7 +75,7 @@ cvar_t ambient_level = {"ambient_level", "0.3"};
|
||||||
cvar_t ambient_fade = {"ambient_fade", "100"};
|
cvar_t ambient_fade = {"ambient_fade", "100"};
|
||||||
cvar_t snd_noextraupdate = {"snd_noextraupdate", "0"};
|
cvar_t snd_noextraupdate = {"snd_noextraupdate", "0"};
|
||||||
cvar_t snd_show = {"snd_show", "0"};
|
cvar_t snd_show = {"snd_show", "0"};
|
||||||
cvar_t _snd_mixahead = {"_snd_mixahead", "0.1", true};
|
cvar_t _snd_mixahead = {"_snd_mixahead", "0.1", qtrue};
|
||||||
|
|
||||||
|
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
|
|
@ -89,19 +89,19 @@ cvar_t _snd_mixahead = {"_snd_mixahead", "0.1", true};
|
||||||
// number of times S_Update() is called per second.
|
// number of times S_Update() is called per second.
|
||||||
//
|
//
|
||||||
|
|
||||||
qboolean fakedma = false;
|
qboolean fakedma = qfalse;
|
||||||
int fakedma_updates = 15;
|
int fakedma_updates = 15;
|
||||||
|
|
||||||
|
|
||||||
void S_AmbientOff (void)
|
void S_AmbientOff (void)
|
||||||
{
|
{
|
||||||
snd_ambient = false;
|
snd_ambient = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void S_AmbientOn (void)
|
void S_AmbientOn (void)
|
||||||
{
|
{
|
||||||
snd_ambient = true;
|
snd_ambient = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -169,7 +169,7 @@ void S_Init (void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (COM_CheckParm("-simsound"))
|
if (COM_CheckParm("-simsound"))
|
||||||
fakedma = true;
|
fakedma = qtrue;
|
||||||
|
|
||||||
Cmd_AddCommand("play", S_Play);
|
Cmd_AddCommand("play", S_Play);
|
||||||
Cmd_AddCommand("playvol", S_PlayVol);
|
Cmd_AddCommand("playvol", S_PlayVol);
|
||||||
|
|
@ -197,7 +197,7 @@ void S_Init (void)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
snd_initialized = true;
|
snd_initialized = qtrue;
|
||||||
|
|
||||||
S_Startup ();
|
S_Startup ();
|
||||||
|
|
||||||
|
|
@ -217,8 +217,8 @@ void S_Init (void)
|
||||||
shm->channels = 2;
|
shm->channels = 2;
|
||||||
shm->samples = 32768;
|
shm->samples = 32768;
|
||||||
shm->samplepos = 0;
|
shm->samplepos = 0;
|
||||||
shm->soundalive = true;
|
shm->soundalive = qtrue;
|
||||||
shm->gamealive = true;
|
shm->gamealive = qtrue;
|
||||||
shm->submission_chunk = 1;
|
shm->submission_chunk = 1;
|
||||||
shm->buffer = Hunk_AllocName(1<<16, "shmbuf");
|
shm->buffer = Hunk_AllocName(1<<16, "shmbuf");
|
||||||
}
|
}
|
||||||
|
|
@ -233,7 +233,7 @@ void S_Init (void)
|
||||||
ambient_sfx[AMBIENT_WATER] = S_PrecacheSound ("ambience/water1.wav");
|
ambient_sfx[AMBIENT_WATER] = S_PrecacheSound ("ambience/water1.wav");
|
||||||
ambient_sfx[AMBIENT_SKY] = S_PrecacheSound ("ambience/wind2.wav");
|
ambient_sfx[AMBIENT_SKY] = S_PrecacheSound ("ambience/wind2.wav");
|
||||||
|
|
||||||
S_StopAllSounds (true);
|
S_StopAllSounds (qtrue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -549,7 +549,7 @@ void S_StopAllSounds(qboolean clear)
|
||||||
|
|
||||||
void S_StopAllSoundsC (void)
|
void S_StopAllSoundsC (void)
|
||||||
{
|
{
|
||||||
S_StopAllSounds (true);
|
S_StopAllSounds (qtrue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void S_ClearBuffer (void)
|
void S_ClearBuffer (void)
|
||||||
|
|
@ -830,7 +830,7 @@ void GetSoundtime(void)
|
||||||
{ // time to chop things off to avoid 32 bit limits
|
{ // time to chop things off to avoid 32 bit limits
|
||||||
buffers = 0;
|
buffers = 0;
|
||||||
paintedtime = fullsamples;
|
paintedtime = fullsamples;
|
||||||
S_StopAllSounds (true);
|
S_StopAllSounds (qtrue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
oldsamplepos = samplepos;
|
oldsamplepos = samplepos;
|
||||||
|
|
|
||||||
|
|
@ -228,8 +228,8 @@ void SV_SendServerinfo (client_t *client)
|
||||||
MSG_WriteByte (&client->message, svc_signonnum);
|
MSG_WriteByte (&client->message, svc_signonnum);
|
||||||
MSG_WriteByte (&client->message, 1);
|
MSG_WriteByte (&client->message, 1);
|
||||||
|
|
||||||
client->sendsignon = true;
|
client->sendsignon = qtrue;
|
||||||
client->spawned = false; // need prespawn, spawn, etc
|
client->spawned = qfalse; // need prespawn, spawn, etc
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -266,17 +266,17 @@ void SV_ConnectClient (int clientnum)
|
||||||
client->netconnection = netconnection;
|
client->netconnection = netconnection;
|
||||||
|
|
||||||
strcpy (client->name, "unconnected");
|
strcpy (client->name, "unconnected");
|
||||||
client->active = true;
|
client->active = qtrue;
|
||||||
client->spawned = false;
|
client->spawned = qfalse;
|
||||||
client->edict = ent;
|
client->edict = ent;
|
||||||
client->message.data = client->msgbuf;
|
client->message.data = client->msgbuf;
|
||||||
client->message.maxsize = sizeof(client->msgbuf);
|
client->message.maxsize = sizeof(client->msgbuf);
|
||||||
client->message.allowoverflow = true; // we can catch it
|
client->message.allowoverflow = qtrue; // we can catch it
|
||||||
|
|
||||||
#ifdef IDGODS
|
#ifdef IDGODS
|
||||||
client->privileged = IsID(&client->netconnection->addr);
|
client->privileged = IsID(&client->netconnection->addr);
|
||||||
#else
|
#else
|
||||||
client->privileged = false;
|
client->privileged = qfalse;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (sv.loadgame)
|
if (sv.loadgame)
|
||||||
|
|
@ -741,11 +741,11 @@ qboolean SV_SendClientDatagram (client_t *client)
|
||||||
// send the datagram
|
// send the datagram
|
||||||
if (NET_SendUnreliableMessage (client->netconnection, &msg) == -1)
|
if (NET_SendUnreliableMessage (client->netconnection, &msg) == -1)
|
||||||
{
|
{
|
||||||
SV_DropClient (true);// if the message couldn't send, kick off
|
SV_DropClient (qtrue);// if the message couldn't send, kick off
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -807,7 +807,7 @@ void SV_SendNop (client_t *client)
|
||||||
MSG_WriteChar (&msg, svc_nop);
|
MSG_WriteChar (&msg, svc_nop);
|
||||||
|
|
||||||
if (NET_SendUnreliableMessage (client->netconnection, &msg) == -1)
|
if (NET_SendUnreliableMessage (client->netconnection, &msg) == -1)
|
||||||
SV_DropClient (true); // if the message couldn't send, kick off
|
SV_DropClient (qtrue); // if the message couldn't send, kick off
|
||||||
client->last_message = realtime;
|
client->last_message = realtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -854,8 +854,8 @@ void SV_SendClientMessages (void)
|
||||||
// changes level
|
// changes level
|
||||||
if (host_client->message.overflowed)
|
if (host_client->message.overflowed)
|
||||||
{
|
{
|
||||||
SV_DropClient (true);
|
SV_DropClient (qtrue);
|
||||||
host_client->message.overflowed = false;
|
host_client->message.overflowed = qfalse;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -868,15 +868,15 @@ void SV_SendClientMessages (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (host_client->dropasap)
|
if (host_client->dropasap)
|
||||||
SV_DropClient (false); // went to another level
|
SV_DropClient (qfalse); // went to another level
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (NET_SendMessage (host_client->netconnection
|
if (NET_SendMessage (host_client->netconnection
|
||||||
, &host_client->message) == -1)
|
, &host_client->message) == -1)
|
||||||
SV_DropClient (true); // if the message couldn't send, kick off
|
SV_DropClient (qtrue); // if the message couldn't send, kick off
|
||||||
SZ_Clear (&host_client->message);
|
SZ_Clear (&host_client->message);
|
||||||
host_client->last_message = realtime;
|
host_client->last_message = realtime;
|
||||||
host_client->sendsignon = false;
|
host_client->sendsignon = qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1056,7 +1056,7 @@ void SV_SpawnServer (char *server)
|
||||||
scr_centertime_off = 0;
|
scr_centertime_off = 0;
|
||||||
|
|
||||||
Con_DPrintf ("SpawnServer: %s\n",server);
|
Con_DPrintf ("SpawnServer: %s\n",server);
|
||||||
svs.changelevel_issued = false; // now safe to issue another
|
svs.changelevel_issued = qfalse; // now safe to issue another
|
||||||
|
|
||||||
//
|
//
|
||||||
// tell all connected clients that we are going to a new level
|
// tell all connected clients that we are going to a new level
|
||||||
|
|
@ -1121,17 +1121,17 @@ void SV_SpawnServer (char *server)
|
||||||
}
|
}
|
||||||
|
|
||||||
sv.state = ss_loading;
|
sv.state = ss_loading;
|
||||||
sv.paused = false;
|
sv.paused = qfalse;
|
||||||
|
|
||||||
sv.time = 1.0;
|
sv.time = 1.0;
|
||||||
|
|
||||||
strcpy (sv.name, server);
|
strcpy (sv.name, server);
|
||||||
sprintf (sv.modelname,"maps/%s.bsp", server);
|
sprintf (sv.modelname,"maps/%s.bsp", server);
|
||||||
sv.worldmodel = Mod_ForName (sv.modelname, false);
|
sv.worldmodel = Mod_ForName (sv.modelname, qfalse);
|
||||||
if (!sv.worldmodel)
|
if (!sv.worldmodel)
|
||||||
{
|
{
|
||||||
Con_Printf ("Couldn't spawn server %s\n", sv.modelname);
|
Con_Printf ("Couldn't spawn server %s\n", sv.modelname);
|
||||||
sv.active = false;
|
sv.active = qfalse;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sv.models[1] = sv.worldmodel;
|
sv.models[1] = sv.worldmodel;
|
||||||
|
|
@ -1148,7 +1148,7 @@ void SV_SpawnServer (char *server)
|
||||||
for (i=1 ; i<sv.worldmodel->numsubmodels ; i++)
|
for (i=1 ; i<sv.worldmodel->numsubmodels ; i++)
|
||||||
{
|
{
|
||||||
sv.model_precache[1+i] = localmodels[i];
|
sv.model_precache[1+i] = localmodels[i];
|
||||||
sv.models[i+1] = Mod_ForName (localmodels[i], false);
|
sv.models[i+1] = Mod_ForName (localmodels[i], qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -1156,7 +1156,7 @@ void SV_SpawnServer (char *server)
|
||||||
//
|
//
|
||||||
ent = EDICT_NUM(0);
|
ent = EDICT_NUM(0);
|
||||||
memset (&ent->v, 0, progs->entityfields * 4);
|
memset (&ent->v, 0, progs->entityfields * 4);
|
||||||
ent->free = false;
|
ent->free = qfalse;
|
||||||
ent->v.model = PR_SetEngineString(sv.worldmodel->name);
|
ent->v.model = PR_SetEngineString(sv.worldmodel->name);
|
||||||
ent->v.modelindex = 1; // world model
|
ent->v.modelindex = 1; // world model
|
||||||
ent->v.solid = SOLID_BSP;
|
ent->v.solid = SOLID_BSP;
|
||||||
|
|
@ -1177,7 +1177,7 @@ void SV_SpawnServer (char *server)
|
||||||
|
|
||||||
ED_LoadFromFile (sv.worldmodel->entities);
|
ED_LoadFromFile (sv.worldmodel->entities);
|
||||||
|
|
||||||
sv.active = true;
|
sv.active = qtrue;
|
||||||
|
|
||||||
// all setup is completed, any further precache statements are errors
|
// all setup is completed, any further precache statements are errors
|
||||||
sv.state = ss_active;
|
sv.state = ss_active;
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
=============
|
=============
|
||||||
SV_CheckBottom
|
SV_CheckBottom
|
||||||
|
|
||||||
Returns false if any part of the bottom of the entity is off an edge that
|
Returns qfalse if any part of the bottom of the entity is off an edge that
|
||||||
is not a staircase.
|
is not a staircase.
|
||||||
|
|
||||||
=============
|
=============
|
||||||
|
|
@ -58,7 +58,7 @@ qboolean SV_CheckBottom (edict_t *ent)
|
||||||
}
|
}
|
||||||
|
|
||||||
c_yes++;
|
c_yes++;
|
||||||
return true; // we got out easy
|
return qtrue; // we got out easy
|
||||||
|
|
||||||
realcheck:
|
realcheck:
|
||||||
c_no++;
|
c_no++;
|
||||||
|
|
@ -71,10 +71,10 @@ realcheck:
|
||||||
start[0] = stop[0] = (mins[0] + maxs[0])*0.5;
|
start[0] = stop[0] = (mins[0] + maxs[0])*0.5;
|
||||||
start[1] = stop[1] = (mins[1] + maxs[1])*0.5;
|
start[1] = stop[1] = (mins[1] + maxs[1])*0.5;
|
||||||
stop[2] = start[2] - 2*STEPSIZE;
|
stop[2] = start[2] - 2*STEPSIZE;
|
||||||
trace = SV_Move (start, vec3_origin, vec3_origin, stop, true, ent);
|
trace = SV_Move (start, vec3_origin, vec3_origin, stop, qtrue, ent);
|
||||||
|
|
||||||
if (trace.fraction == 1.0)
|
if (trace.fraction == 1.0)
|
||||||
return false;
|
return qfalse;
|
||||||
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
|
||||||
|
|
@ -84,16 +84,16 @@ realcheck:
|
||||||
start[0] = stop[0] = x ? maxs[0] : mins[0];
|
start[0] = stop[0] = x ? maxs[0] : mins[0];
|
||||||
start[1] = stop[1] = y ? maxs[1] : mins[1];
|
start[1] = stop[1] = y ? maxs[1] : mins[1];
|
||||||
|
|
||||||
trace = SV_Move (start, vec3_origin, vec3_origin, stop, true, ent);
|
trace = SV_Move (start, vec3_origin, vec3_origin, stop, qtrue, ent);
|
||||||
|
|
||||||
if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
|
if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
|
||||||
bottom = trace.endpos[2];
|
bottom = trace.endpos[2];
|
||||||
if (trace.fraction == 1.0 || mid - trace.endpos[2] > STEPSIZE)
|
if (trace.fraction == 1.0 || mid - trace.endpos[2] > STEPSIZE)
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
c_yes++;
|
c_yes++;
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -103,7 +103,7 @@ SV_movestep
|
||||||
|
|
||||||
Called by monster program code.
|
Called by monster program code.
|
||||||
The move will be adjusted for slopes and stairs, but if the move isn't
|
The move will be adjusted for slopes and stairs, but if the move isn't
|
||||||
possible, no move is done, false is returned, and
|
possible, no move is done, qfalse is returned, and
|
||||||
pr_global_struct->trace_normal is set to the normal of the blocking wall
|
pr_global_struct->trace_normal is set to the normal of the blocking wall
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
|
|
@ -135,24 +135,24 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
||||||
if (dz < 30)
|
if (dz < 30)
|
||||||
neworg[2] += 8;
|
neworg[2] += 8;
|
||||||
}
|
}
|
||||||
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, neworg, false, ent);
|
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, neworg, qfalse, ent);
|
||||||
|
|
||||||
if (trace.fraction == 1)
|
if (trace.fraction == 1)
|
||||||
{
|
{
|
||||||
if ( ((int)ent->v.flags & FL_SWIM) && SV_PointContents(trace.endpos) == CONTENTS_EMPTY )
|
if ( ((int)ent->v.flags & FL_SWIM) && SV_PointContents(trace.endpos) == CONTENTS_EMPTY )
|
||||||
return false; // swim monster left water
|
return qfalse; // swim monster left water
|
||||||
|
|
||||||
VectorCopy (trace.endpos, ent->v.origin);
|
VectorCopy (trace.endpos, ent->v.origin);
|
||||||
if (relink)
|
if (relink)
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy == sv.edicts)
|
if (enemy == sv.edicts)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
// push down from a step height above the wished position
|
// push down from a step height above the wished position
|
||||||
|
|
@ -160,17 +160,17 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
||||||
VectorCopy (neworg, end);
|
VectorCopy (neworg, end);
|
||||||
end[2] -= STEPSIZE*2;
|
end[2] -= STEPSIZE*2;
|
||||||
|
|
||||||
trace = SV_Move (neworg, ent->v.mins, ent->v.maxs, end, false, ent);
|
trace = SV_Move (neworg, ent->v.mins, ent->v.maxs, end, qfalse, ent);
|
||||||
|
|
||||||
if (trace.allsolid)
|
if (trace.allsolid)
|
||||||
return false;
|
return qfalse;
|
||||||
|
|
||||||
if (trace.startsolid)
|
if (trace.startsolid)
|
||||||
{
|
{
|
||||||
neworg[2] -= STEPSIZE;
|
neworg[2] -= STEPSIZE;
|
||||||
trace = SV_Move (neworg, ent->v.mins, ent->v.maxs, end, false, ent);
|
trace = SV_Move (neworg, ent->v.mins, ent->v.maxs, end, qfalse, ent);
|
||||||
if (trace.allsolid || trace.startsolid)
|
if (trace.allsolid || trace.startsolid)
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
if (trace.fraction == 1)
|
if (trace.fraction == 1)
|
||||||
{
|
{
|
||||||
|
|
@ -179,13 +179,13 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
||||||
{
|
{
|
||||||
VectorAdd (ent->v.origin, move, ent->v.origin);
|
VectorAdd (ent->v.origin, move, ent->v.origin);
|
||||||
if (relink)
|
if (relink)
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
|
ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
|
||||||
// Con_Printf ("fall down\n");
|
// Con_Printf ("fall down\n");
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false; // walked off an edge
|
return qfalse; // walked off an edge
|
||||||
}
|
}
|
||||||
|
|
||||||
// check point traces down for dangling corners
|
// check point traces down for dangling corners
|
||||||
|
|
@ -197,11 +197,11 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
||||||
{ // entity had floor mostly pulled out from underneath it
|
{ // entity had floor mostly pulled out from underneath it
|
||||||
// and is trying to correct
|
// and is trying to correct
|
||||||
if (relink)
|
if (relink)
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
VectorCopy (oldorg, ent->v.origin);
|
VectorCopy (oldorg, ent->v.origin);
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (int)ent->v.flags & FL_PARTIALGROUND )
|
if ( (int)ent->v.flags & FL_PARTIALGROUND )
|
||||||
|
|
@ -213,8 +213,8 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
||||||
|
|
||||||
// the move is ok
|
// the move is ok
|
||||||
if (relink)
|
if (relink)
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -244,19 +244,19 @@ qboolean SV_StepDirection (edict_t *ent, float yaw, float dist)
|
||||||
move[2] = 0;
|
move[2] = 0;
|
||||||
|
|
||||||
VectorCopy (ent->v.origin, oldorigin);
|
VectorCopy (ent->v.origin, oldorigin);
|
||||||
if (SV_movestep (ent, move, false))
|
if (SV_movestep (ent, move, qfalse))
|
||||||
{
|
{
|
||||||
delta = ent->v.angles[YAW] - ent->v.ideal_yaw;
|
delta = ent->v.angles[YAW] - ent->v.ideal_yaw;
|
||||||
if (delta > 45 && delta < 315)
|
if (delta > 45 && delta < 315)
|
||||||
{ // not turned far enough, so don't take the step
|
{ // not turned far enough, so don't take the step
|
||||||
VectorCopy (oldorigin, ent->v.origin);
|
VectorCopy (oldorigin, ent->v.origin);
|
||||||
}
|
}
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
|
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -377,11 +377,11 @@ qboolean SV_CloseEnough (edict_t *ent, edict_t *goal, float dist)
|
||||||
for (i=0 ; i<3 ; i++)
|
for (i=0 ; i<3 ; i++)
|
||||||
{
|
{
|
||||||
if (goal->v.absmin[i] > ent->v.absmax[i] + dist)
|
if (goal->v.absmin[i] > ent->v.absmax[i] + dist)
|
||||||
return false;
|
return qfalse;
|
||||||
if (goal->v.absmax[i] < ent->v.absmin[i] - dist)
|
if (goal->v.absmax[i] < ent->v.absmin[i] - dist)
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,9 @@ solid_edge items only clip against bsp models.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
cvar_t sv_friction = {"sv_friction","4",false,true};
|
cvar_t sv_friction = {"sv_friction","4",qfalse,qtrue};
|
||||||
cvar_t sv_stopspeed = {"sv_stopspeed","100"};
|
cvar_t sv_stopspeed = {"sv_stopspeed","100"};
|
||||||
cvar_t sv_gravity = {"sv_gravity","800",false,true};
|
cvar_t sv_gravity = {"sv_gravity","800",qfalse,qtrue};
|
||||||
cvar_t sv_maxvelocity = {"sv_maxvelocity","2000"};
|
cvar_t sv_maxvelocity = {"sv_maxvelocity","2000"};
|
||||||
cvar_t sv_nostep = {"sv_nostep","0"};
|
cvar_t sv_nostep = {"sv_nostep","0"};
|
||||||
|
|
||||||
|
|
@ -120,7 +120,7 @@ SV_RunThink
|
||||||
Runs thinking code if time. There is some play in the exact time the think
|
Runs thinking code if time. There is some play in the exact time the think
|
||||||
function will be called, because it is called before any movement is done
|
function will be called, because it is called before any movement is done
|
||||||
in a frame. Not used for pushmove objects, because they must be exact.
|
in a frame. Not used for pushmove objects, because they must be exact.
|
||||||
Returns false if the entity removed itself.
|
Returns qfalse if the entity removed itself.
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
qboolean SV_RunThink (edict_t *ent)
|
qboolean SV_RunThink (edict_t *ent)
|
||||||
|
|
@ -129,7 +129,7 @@ qboolean SV_RunThink (edict_t *ent)
|
||||||
|
|
||||||
thinktime = ent->v.nextthink;
|
thinktime = ent->v.nextthink;
|
||||||
if (thinktime <= 0 || thinktime > sv.time + host_frametime)
|
if (thinktime <= 0 || thinktime > sv.time + host_frametime)
|
||||||
return true;
|
return qtrue;
|
||||||
|
|
||||||
if (thinktime < sv.time)
|
if (thinktime < sv.time)
|
||||||
thinktime = sv.time; // don't let things stay in the past.
|
thinktime = sv.time; // don't let things stay in the past.
|
||||||
|
|
@ -257,7 +257,7 @@ int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
|
||||||
for (i=0 ; i<3 ; i++)
|
for (i=0 ; i<3 ; i++)
|
||||||
end[i] = ent->v.origin[i] + time_left * ent->v.velocity[i];
|
end[i] = ent->v.origin[i] + time_left * ent->v.velocity[i];
|
||||||
|
|
||||||
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, end, false, ent);
|
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, end, qfalse, ent);
|
||||||
|
|
||||||
if (trace.allsolid)
|
if (trace.allsolid)
|
||||||
{ // entity is trapped in another solid
|
{ // entity is trapped in another solid
|
||||||
|
|
@ -421,7 +421,7 @@ trace_t SV_PushEntity (edict_t *ent, vec3_t push)
|
||||||
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL, ent);
|
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL, ent);
|
||||||
|
|
||||||
VectorCopy (trace.endpos, ent->v.origin);
|
VectorCopy (trace.endpos, ent->v.origin);
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
|
|
||||||
if (trace.ent)
|
if (trace.ent)
|
||||||
SV_Impact (ent, trace.ent);
|
SV_Impact (ent, trace.ent);
|
||||||
|
|
@ -465,7 +465,7 @@ void SV_PushMove (edict_t *pusher, float movetime)
|
||||||
|
|
||||||
VectorAdd (pusher->v.origin, move, pusher->v.origin);
|
VectorAdd (pusher->v.origin, move, pusher->v.origin);
|
||||||
pusher->v.ltime += movetime;
|
pusher->v.ltime += movetime;
|
||||||
SV_LinkEdict (pusher, false);
|
SV_LinkEdict (pusher, qfalse);
|
||||||
|
|
||||||
|
|
||||||
// see if any solid entities are inside the final position
|
// see if any solid entities are inside the final position
|
||||||
|
|
@ -528,10 +528,10 @@ void SV_PushMove (edict_t *pusher, float movetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorCopy (entorig, check->v.origin);
|
VectorCopy (entorig, check->v.origin);
|
||||||
SV_LinkEdict (check, true);
|
SV_LinkEdict (check, qtrue);
|
||||||
|
|
||||||
VectorCopy (pushorig, pusher->v.origin);
|
VectorCopy (pushorig, pusher->v.origin);
|
||||||
SV_LinkEdict (pusher, false);
|
SV_LinkEdict (pusher, qfalse);
|
||||||
pusher->v.ltime -= movetime;
|
pusher->v.ltime -= movetime;
|
||||||
|
|
||||||
// if the pusher has a "blocked" function, call it
|
// if the pusher has a "blocked" function, call it
|
||||||
|
|
@ -547,7 +547,7 @@ void SV_PushMove (edict_t *pusher, float movetime)
|
||||||
for (i=0 ; i<num_moved ; i++)
|
for (i=0 ; i<num_moved ; i++)
|
||||||
{
|
{
|
||||||
VectorCopy (moved_from[i], moved_edict[i]->v.origin);
|
VectorCopy (moved_from[i], moved_edict[i]->v.origin);
|
||||||
SV_LinkEdict (moved_edict[i], false);
|
SV_LinkEdict (moved_edict[i], qfalse);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -593,7 +593,7 @@ void SV_PushRotate (edict_t *pusher, float movetime)
|
||||||
|
|
||||||
VectorAdd (pusher->v.angles, amove, pusher->v.angles);
|
VectorAdd (pusher->v.angles, amove, pusher->v.angles);
|
||||||
pusher->v.ltime += movetime;
|
pusher->v.ltime += movetime;
|
||||||
SV_LinkEdict (pusher, false);
|
SV_LinkEdict (pusher, qfalse);
|
||||||
|
|
||||||
|
|
||||||
// see if any solid entities are inside the final position
|
// see if any solid entities are inside the final position
|
||||||
|
|
@ -661,10 +661,10 @@ void SV_PushRotate (edict_t *pusher, float movetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorCopy (entorig, check->v.origin);
|
VectorCopy (entorig, check->v.origin);
|
||||||
SV_LinkEdict (check, true);
|
SV_LinkEdict (check, qtrue);
|
||||||
|
|
||||||
VectorCopy (pushorig, pusher->v.angles);
|
VectorCopy (pushorig, pusher->v.angles);
|
||||||
SV_LinkEdict (pusher, false);
|
SV_LinkEdict (pusher, qfalse);
|
||||||
pusher->v.ltime -= movetime;
|
pusher->v.ltime -= movetime;
|
||||||
|
|
||||||
// if the pusher has a "blocked" function, call it
|
// if the pusher has a "blocked" function, call it
|
||||||
|
|
@ -681,7 +681,7 @@ void SV_PushRotate (edict_t *pusher, float movetime)
|
||||||
{
|
{
|
||||||
VectorCopy (moved_from[i], moved_edict[i]->v.origin);
|
VectorCopy (moved_from[i], moved_edict[i]->v.origin);
|
||||||
VectorSubtract (moved_edict[i]->v.angles, amove, moved_edict[i]->v.angles);
|
VectorSubtract (moved_edict[i]->v.angles, amove, moved_edict[i]->v.angles);
|
||||||
SV_LinkEdict (moved_edict[i], false);
|
SV_LinkEdict (moved_edict[i], qfalse);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -776,7 +776,7 @@ void SV_CheckStuck (edict_t *ent)
|
||||||
if (!SV_TestEntityPosition(ent))
|
if (!SV_TestEntityPosition(ent))
|
||||||
{
|
{
|
||||||
Con_DPrintf ("Unstuck.\n");
|
Con_DPrintf ("Unstuck.\n");
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -790,7 +790,7 @@ void SV_CheckStuck (edict_t *ent)
|
||||||
if (!SV_TestEntityPosition(ent))
|
if (!SV_TestEntityPosition(ent))
|
||||||
{
|
{
|
||||||
Con_DPrintf ("Unstuck.\n");
|
Con_DPrintf ("Unstuck.\n");
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -810,7 +810,7 @@ qboolean SV_CheckWater (edict_t *ent)
|
||||||
vec3_t point;
|
vec3_t point;
|
||||||
int cont;
|
int cont;
|
||||||
#ifdef QUAKE2
|
#ifdef QUAKE2
|
||||||
int truecont;
|
int qtruecont;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
point[0] = ent->v.origin[0];
|
point[0] = ent->v.origin[0];
|
||||||
|
|
@ -823,7 +823,7 @@ qboolean SV_CheckWater (edict_t *ent)
|
||||||
if (cont <= CONTENTS_WATER)
|
if (cont <= CONTENTS_WATER)
|
||||||
{
|
{
|
||||||
#ifdef QUAKE2
|
#ifdef QUAKE2
|
||||||
truecont = SV_TruePointContents (point);
|
qtruecont = SV_TruePointContents (point);
|
||||||
#endif
|
#endif
|
||||||
ent->v.watertype = cont;
|
ent->v.watertype = cont;
|
||||||
ent->v.waterlevel = 1;
|
ent->v.waterlevel = 1;
|
||||||
|
|
@ -838,7 +838,7 @@ qboolean SV_CheckWater (edict_t *ent)
|
||||||
ent->v.waterlevel = 3;
|
ent->v.waterlevel = 3;
|
||||||
}
|
}
|
||||||
#ifdef QUAKE2
|
#ifdef QUAKE2
|
||||||
if (truecont <= CONTENTS_CURRENT_0 && truecont >= CONTENTS_CURRENT_DOWN)
|
if (qtruecont <= CONTENTS_CURRENT_0 && qtruecont >= CONTENTS_CURRENT_DOWN)
|
||||||
{
|
{
|
||||||
static vec3_t current_table[] =
|
static vec3_t current_table[] =
|
||||||
{
|
{
|
||||||
|
|
@ -850,7 +850,7 @@ qboolean SV_CheckWater (edict_t *ent)
|
||||||
{0, 0, -1}
|
{0, 0, -1}
|
||||||
};
|
};
|
||||||
|
|
||||||
VectorMA (ent->v.basevelocity, 150.0*ent->v.waterlevel/3.0, current_table[CONTENTS_CURRENT_0 - truecont], ent->v.basevelocity);
|
VectorMA (ent->v.basevelocity, 150.0*ent->v.waterlevel/3.0, current_table[CONTENTS_CURRENT_0 - qtruecont], ent->v.basevelocity);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -1123,7 +1123,7 @@ void SV_Physics_Client (edict_t *ent, int num)
|
||||||
//
|
//
|
||||||
// call standard player post-think
|
// call standard player post-think
|
||||||
//
|
//
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
|
|
||||||
pr_global_struct->time = sv.time;
|
pr_global_struct->time = sv.time;
|
||||||
pr_global_struct->self = EDICT_TO_PROG(ent);
|
pr_global_struct->self = EDICT_TO_PROG(ent);
|
||||||
|
|
@ -1158,7 +1158,7 @@ void SV_Physics_Follow (edict_t *ent)
|
||||||
// regular thinking
|
// regular thinking
|
||||||
SV_RunThink (ent);
|
SV_RunThink (ent);
|
||||||
VectorAdd (PROG_TO_EDICT(ent->v.aiment)->v.origin, ent->v.v_angle, ent->v.origin);
|
VectorAdd (PROG_TO_EDICT(ent->v.aiment)->v.origin, ent->v.v_angle, ent->v.origin);
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -1178,7 +1178,7 @@ void SV_Physics_Noclip (edict_t *ent)
|
||||||
VectorMA (ent->v.angles, host_frametime, ent->v.avelocity, ent->v.angles);
|
VectorMA (ent->v.angles, host_frametime, ent->v.avelocity, ent->v.angles);
|
||||||
VectorMA (ent->v.origin, host_frametime, ent->v.velocity, ent->v.origin);
|
VectorMA (ent->v.origin, host_frametime, ent->v.velocity, ent->v.origin);
|
||||||
|
|
||||||
SV_LinkEdict (ent, false);
|
SV_LinkEdict (ent, qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -1364,7 +1364,7 @@ void SV_Physics_Step (edict_t *ent)
|
||||||
{
|
{
|
||||||
qboolean wasonground;
|
qboolean wasonground;
|
||||||
qboolean inwater;
|
qboolean inwater;
|
||||||
qboolean hitsound = false;
|
qboolean hitsound = qfalse;
|
||||||
float *vel;
|
float *vel;
|
||||||
float speed, newspeed, control;
|
float speed, newspeed, control;
|
||||||
float friction;
|
float friction;
|
||||||
|
|
@ -1394,7 +1394,7 @@ void SV_Physics_Step (edict_t *ent)
|
||||||
if (!(((int)ent->v.flags & FL_SWIM) && (ent->v.waterlevel > 0)))
|
if (!(((int)ent->v.flags & FL_SWIM) && (ent->v.waterlevel > 0)))
|
||||||
{
|
{
|
||||||
if (ent->v.velocity[2] < sv_gravity.value*-0.1)
|
if (ent->v.velocity[2] < sv_gravity.value*-0.1)
|
||||||
hitsound = true;
|
hitsound = qtrue;
|
||||||
if (!inwater)
|
if (!inwater)
|
||||||
SV_AddGravity (ent);
|
SV_AddGravity (ent);
|
||||||
}
|
}
|
||||||
|
|
@ -1452,7 +1452,7 @@ void SV_Physics_Step (edict_t *ent)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
|
|
||||||
if ((int)ent->v.flags & FL_ONGROUND)
|
if ((int)ent->v.flags & FL_ONGROUND)
|
||||||
if (!wasonground)
|
if (!wasonground)
|
||||||
|
|
@ -1473,14 +1473,14 @@ void SV_Physics_Step (edict_t *ent)
|
||||||
if ( ! ((int)ent->v.flags & (FL_ONGROUND | FL_FLY | FL_SWIM) ) )
|
if ( ! ((int)ent->v.flags & (FL_ONGROUND | FL_FLY | FL_SWIM) ) )
|
||||||
{
|
{
|
||||||
if (ent->v.velocity[2] < sv_gravity.value*-0.1)
|
if (ent->v.velocity[2] < sv_gravity.value*-0.1)
|
||||||
hitsound = true;
|
hitsound = qtrue;
|
||||||
else
|
else
|
||||||
hitsound = false;
|
hitsound = qfalse;
|
||||||
|
|
||||||
SV_AddGravity (ent);
|
SV_AddGravity (ent);
|
||||||
SV_CheckVelocity (ent);
|
SV_CheckVelocity (ent);
|
||||||
SV_FlyMove (ent, host_frametime, NULL);
|
SV_FlyMove (ent, host_frametime, NULL);
|
||||||
SV_LinkEdict (ent, true);
|
SV_LinkEdict (ent, qtrue);
|
||||||
|
|
||||||
if ( (int)ent->v.flags & FL_ONGROUND ) // just hit ground
|
if ( (int)ent->v.flags & FL_ONGROUND ) // just hit ground
|
||||||
{
|
{
|
||||||
|
|
@ -1528,7 +1528,7 @@ void SV_Physics (void)
|
||||||
|
|
||||||
if (pr_global_struct->force_retouch)
|
if (pr_global_struct->force_retouch)
|
||||||
{
|
{
|
||||||
SV_LinkEdict (ent, true); // force retouch even for stationary
|
SV_LinkEdict (ent, qtrue); // force retouch even for stationary
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i > 0 && i <= svs.maxclients)
|
if (i > 0 && i <= svs.maxclients)
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ void SV_UserFriction (void)
|
||||||
start[2] = origin[2] + sv_player->v.mins[2];
|
start[2] = origin[2] + sv_player->v.mins[2];
|
||||||
stop[2] = start[2] - 34;
|
stop[2] = start[2] - 34;
|
||||||
|
|
||||||
trace = SV_Move (start, vec3_origin, vec3_origin, stop, true, sv_player);
|
trace = SV_Move (start, vec3_origin, vec3_origin, stop, qtrue, sv_player);
|
||||||
|
|
||||||
if (trace.fraction == 1.0)
|
if (trace.fraction == 1.0)
|
||||||
friction = sv_friction.value*sv_edgefriction.value;
|
friction = sv_friction.value*sv_edgefriction.value;
|
||||||
|
|
@ -164,7 +164,7 @@ void SV_UserFriction (void)
|
||||||
SV_Accelerate
|
SV_Accelerate
|
||||||
==============
|
==============
|
||||||
*/
|
*/
|
||||||
cvar_t sv_maxspeed = {"sv_maxspeed", "320", false, true};
|
cvar_t sv_maxspeed = {"sv_maxspeed", "320", qfalse, qtrue};
|
||||||
cvar_t sv_accelerate = {"sv_accelerate", "10"};
|
cvar_t sv_accelerate = {"sv_accelerate", "10"};
|
||||||
#if 0
|
#if 0
|
||||||
void SV_Accelerate (vec3_t wishvel)
|
void SV_Accelerate (vec3_t wishvel)
|
||||||
|
|
@ -476,7 +476,7 @@ void SV_ReadClientMove (usercmd_t *move)
|
||||||
===================
|
===================
|
||||||
SV_ReadClientMessage
|
SV_ReadClientMessage
|
||||||
|
|
||||||
Returns false if the client should be killed
|
Returns qfalse if the client should be killed
|
||||||
===================
|
===================
|
||||||
*/
|
*/
|
||||||
qboolean SV_ReadClientMessage (void)
|
qboolean SV_ReadClientMessage (void)
|
||||||
|
|
@ -492,22 +492,22 @@ nextmsg:
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
{
|
{
|
||||||
Sys_Printf ("SV_ReadClientMessage: NET_GetMessage failed\n");
|
Sys_Printf ("SV_ReadClientMessage: NET_GetMessage failed\n");
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return true;
|
return qtrue;
|
||||||
|
|
||||||
MSG_BeginReading ();
|
MSG_BeginReading ();
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (!host_client->active)
|
if (!host_client->active)
|
||||||
return false; // a command caused an error
|
return qfalse; // a command caused an error
|
||||||
|
|
||||||
if (msg_badread)
|
if (msg_badread)
|
||||||
{
|
{
|
||||||
Sys_Printf ("SV_ReadClientMessage: badread\n");
|
Sys_Printf ("SV_ReadClientMessage: badread\n");
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd = MSG_ReadChar ();
|
cmd = MSG_ReadChar ();
|
||||||
|
|
@ -519,7 +519,7 @@ nextmsg:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Sys_Printf ("SV_ReadClientMessage: unknown command char\n");
|
Sys_Printf ("SV_ReadClientMessage: unknown command char\n");
|
||||||
return false;
|
return qfalse;
|
||||||
|
|
||||||
case clc_nop:
|
case clc_nop:
|
||||||
// Sys_Printf ("clc_nop\n");
|
// Sys_Printf ("clc_nop\n");
|
||||||
|
|
@ -579,7 +579,7 @@ nextmsg:
|
||||||
|
|
||||||
case clc_disconnect:
|
case clc_disconnect:
|
||||||
// Sys_Printf ("SV_ReadClientMessage: client disconnected\n");
|
// Sys_Printf ("SV_ReadClientMessage: client disconnected\n");
|
||||||
return false;
|
return qfalse;
|
||||||
|
|
||||||
case clc_move:
|
case clc_move:
|
||||||
SV_ReadClientMove (&host_client->cmd);
|
SV_ReadClientMove (&host_client->cmd);
|
||||||
|
|
@ -588,7 +588,7 @@ nextmsg:
|
||||||
}
|
}
|
||||||
} while (ret == 1);
|
} while (ret == 1);
|
||||||
|
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -610,7 +610,7 @@ void SV_RunClients (void)
|
||||||
|
|
||||||
if (!SV_ReadClientMessage ())
|
if (!SV_ReadClientMessage ())
|
||||||
{
|
{
|
||||||
SV_DropClient (false); // client misbehaved...
|
SV_DropClient (qfalse); // client misbehaved...
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ static char end2[] =
|
||||||
void Sys_Quit (void)
|
void Sys_Quit (void)
|
||||||
{
|
{
|
||||||
Host_Shutdown();
|
Host_Shutdown();
|
||||||
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
|
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
|
||||||
#if 0
|
#if 0
|
||||||
if (registered.value)
|
if (registered.value)
|
||||||
printf("%s", end2);
|
printf("%s", end2);
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ static double curtime = 0.0;
|
||||||
static double lastcurtime = 0.0;
|
static double lastcurtime = 0.0;
|
||||||
static int lowshift;
|
static int lowshift;
|
||||||
qboolean isDedicated;
|
qboolean isDedicated;
|
||||||
static qboolean sc_return_on_enter = false;
|
static qboolean sc_return_on_enter = qfalse;
|
||||||
HANDLE hinput, houtput;
|
HANDLE hinput, houtput;
|
||||||
|
|
||||||
static char *tracking_tag = "Clams & Mooses";
|
static char *tracking_tag = "Clams & Mooses";
|
||||||
|
|
@ -337,9 +337,9 @@ void Sys_Init (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
|
if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
|
||||||
WinNT = true;
|
WinNT = qtrue;
|
||||||
else
|
else
|
||||||
WinNT = false;
|
WinNT = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -382,7 +382,7 @@ void Sys_Error (char *error, ...)
|
||||||
|
|
||||||
|
|
||||||
starttime = Sys_FloatTime ();
|
starttime = Sys_FloatTime ();
|
||||||
sc_return_on_enter = true; // so Enter will get us out of here
|
sc_return_on_enter = qtrue; // so Enter will get us out of here
|
||||||
|
|
||||||
while (!Sys_ConsoleInput () &&
|
while (!Sys_ConsoleInput () &&
|
||||||
((Sys_FloatTime () - starttime) < CONSOLE_ERROR_TIMEOUT))
|
((Sys_FloatTime () - starttime) < CONSOLE_ERROR_TIMEOUT))
|
||||||
|
|
|
||||||
66
src/view.c
66
src/view.c
|
|
@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
The view is allowed to move slightly from it's true position for bobbing,
|
The view is allowed to move slightly from it's qtrue position for bobbing,
|
||||||
but if it exceeds 8 pixels linear distance (spherical, not box), the list of
|
but if it exceeds 8 pixels linear distance (spherical, not box), the list of
|
||||||
entities sent from the server may not include everything in the pvs, especially
|
entities sent from the server may not include everything in the pvs, especially
|
||||||
when crossing a water boudnary.
|
when crossing a water boudnary.
|
||||||
|
|
@ -34,35 +34,35 @@ when crossing a water boudnary.
|
||||||
cvar_t lcd_x = {"lcd_x","0"};
|
cvar_t lcd_x = {"lcd_x","0"};
|
||||||
cvar_t lcd_yaw = {"lcd_yaw","0"};
|
cvar_t lcd_yaw = {"lcd_yaw","0"};
|
||||||
|
|
||||||
cvar_t scr_ofsx = {"scr_ofsx","0", false};
|
cvar_t scr_ofsx = {"scr_ofsx","0", qfalse};
|
||||||
cvar_t scr_ofsy = {"scr_ofsy","0", false};
|
cvar_t scr_ofsy = {"scr_ofsy","0", qfalse};
|
||||||
cvar_t scr_ofsz = {"scr_ofsz","0", false};
|
cvar_t scr_ofsz = {"scr_ofsz","0", qfalse};
|
||||||
|
|
||||||
cvar_t cl_rollspeed = {"cl_rollspeed", "200"};
|
cvar_t cl_rollspeed = {"cl_rollspeed", "200"};
|
||||||
cvar_t cl_rollangle = {"cl_rollangle", "2.0"};
|
cvar_t cl_rollangle = {"cl_rollangle", "2.0"};
|
||||||
|
|
||||||
cvar_t cl_bob = {"cl_bob","0.02", false};
|
cvar_t cl_bob = {"cl_bob","0.02", qfalse};
|
||||||
cvar_t cl_bobcycle = {"cl_bobcycle","0.6", false};
|
cvar_t cl_bobcycle = {"cl_bobcycle","0.6", qfalse};
|
||||||
cvar_t cl_bobup = {"cl_bobup","0.5", false};
|
cvar_t cl_bobup = {"cl_bobup","0.5", qfalse};
|
||||||
|
|
||||||
cvar_t v_kicktime = {"v_kicktime", "0.5", false};
|
cvar_t v_kicktime = {"v_kicktime", "0.5", qfalse};
|
||||||
cvar_t v_kickroll = {"v_kickroll", "0.6", false};
|
cvar_t v_kickroll = {"v_kickroll", "0.6", qfalse};
|
||||||
cvar_t v_kickpitch = {"v_kickpitch", "0.6", false};
|
cvar_t v_kickpitch = {"v_kickpitch", "0.6", qfalse};
|
||||||
|
|
||||||
cvar_t v_iyaw_cycle = {"v_iyaw_cycle", "2", false};
|
cvar_t v_iyaw_cycle = {"v_iyaw_cycle", "2", qfalse};
|
||||||
cvar_t v_iroll_cycle = {"v_iroll_cycle", "0.5", false};
|
cvar_t v_iroll_cycle = {"v_iroll_cycle", "0.5", qfalse};
|
||||||
cvar_t v_ipitch_cycle = {"v_ipitch_cycle", "1", false};
|
cvar_t v_ipitch_cycle = {"v_ipitch_cycle", "1", qfalse};
|
||||||
cvar_t v_iyaw_level = {"v_iyaw_level", "0.3", false};
|
cvar_t v_iyaw_level = {"v_iyaw_level", "0.3", qfalse};
|
||||||
cvar_t v_iroll_level = {"v_iroll_level", "0.1", false};
|
cvar_t v_iroll_level = {"v_iroll_level", "0.1", qfalse};
|
||||||
cvar_t v_ipitch_level = {"v_ipitch_level", "0.3", false};
|
cvar_t v_ipitch_level = {"v_ipitch_level", "0.3", qfalse};
|
||||||
|
|
||||||
cvar_t v_idlescale = {"v_idlescale", "0", false};
|
cvar_t v_idlescale = {"v_idlescale", "0", qfalse};
|
||||||
|
|
||||||
cvar_t crosshair = {"crosshair", "0", true};
|
cvar_t crosshair = {"crosshair", "0", qtrue};
|
||||||
cvar_t cl_crossx = {"cl_crossx", "0", false};
|
cvar_t cl_crossx = {"cl_crossx", "0", qfalse};
|
||||||
cvar_t cl_crossy = {"cl_crossy", "0", false};
|
cvar_t cl_crossy = {"cl_crossy", "0", qfalse};
|
||||||
|
|
||||||
cvar_t gl_cshiftpercent = {"gl_cshiftpercent", "100", false};
|
cvar_t gl_cshiftpercent = {"gl_cshiftpercent", "100", qfalse};
|
||||||
|
|
||||||
float v_dmg_time, v_dmg_roll, v_dmg_pitch;
|
float v_dmg_time, v_dmg_roll, v_dmg_pitch;
|
||||||
|
|
||||||
|
|
@ -139,7 +139,7 @@ float V_CalcBob (void)
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
|
|
||||||
cvar_t v_centermove = {"v_centermove", "0.15", false};
|
cvar_t v_centermove = {"v_centermove", "0.15", qfalse};
|
||||||
cvar_t v_centerspeed = {"v_centerspeed","500"};
|
cvar_t v_centerspeed = {"v_centerspeed","500"};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -154,7 +154,7 @@ void V_StartPitchDrift (void)
|
||||||
if (cl.nodrift || !cl.pitchvel)
|
if (cl.nodrift || !cl.pitchvel)
|
||||||
{
|
{
|
||||||
cl.pitchvel = v_centerspeed.value;
|
cl.pitchvel = v_centerspeed.value;
|
||||||
cl.nodrift = false;
|
cl.nodrift = qfalse;
|
||||||
cl.driftmove = 0;
|
cl.driftmove = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -162,7 +162,7 @@ void V_StartPitchDrift (void)
|
||||||
void V_StopPitchDrift (void)
|
void V_StopPitchDrift (void)
|
||||||
{
|
{
|
||||||
cl.laststop = cl.time;
|
cl.laststop = cl.time;
|
||||||
cl.nodrift = true;
|
cl.nodrift = qtrue;
|
||||||
cl.pitchvel = 0;
|
cl.pitchvel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -256,7 +256,7 @@ cshift_t cshift_water = { {130,80,50}, 128 };
|
||||||
cshift_t cshift_slime = { {0,25,5}, 150 };
|
cshift_t cshift_slime = { {0,25,5}, 150 };
|
||||||
cshift_t cshift_lava = { {255,80,0}, 150 };
|
cshift_t cshift_lava = { {255,80,0}, 150 };
|
||||||
|
|
||||||
cvar_t v_gamma = {"gamma", "1", true};
|
cvar_t v_gamma = {"gamma", "1", qtrue};
|
||||||
|
|
||||||
byte gammatable[256]; // palette is sent through this
|
byte gammatable[256]; // palette is sent through this
|
||||||
|
|
||||||
|
|
@ -297,13 +297,13 @@ qboolean V_CheckGamma (void)
|
||||||
static float oldgammavalue;
|
static float oldgammavalue;
|
||||||
|
|
||||||
if (v_gamma.value == oldgammavalue)
|
if (v_gamma.value == oldgammavalue)
|
||||||
return false;
|
return qfalse;
|
||||||
oldgammavalue = v_gamma.value;
|
oldgammavalue = v_gamma.value;
|
||||||
|
|
||||||
BuildGammaTable (v_gamma.value);
|
BuildGammaTable (v_gamma.value);
|
||||||
vid.recalc_refdef = 1; // force a surface cache flush
|
vid.recalc_refdef = 1; // force a surface cache flush
|
||||||
|
|
||||||
return true;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -536,19 +536,19 @@ void V_UpdatePalette (void)
|
||||||
|
|
||||||
V_CalcPowerupCshift ();
|
V_CalcPowerupCshift ();
|
||||||
|
|
||||||
new = false;
|
new = qfalse;
|
||||||
|
|
||||||
for (i=0 ; i<NUM_CSHIFTS ; i++)
|
for (i=0 ; i<NUM_CSHIFTS ; i++)
|
||||||
{
|
{
|
||||||
if (cl.cshifts[i].percent != cl.prev_cshifts[i].percent)
|
if (cl.cshifts[i].percent != cl.prev_cshifts[i].percent)
|
||||||
{
|
{
|
||||||
new = true;
|
new = qtrue;
|
||||||
cl.prev_cshifts[i].percent = cl.cshifts[i].percent;
|
cl.prev_cshifts[i].percent = cl.cshifts[i].percent;
|
||||||
}
|
}
|
||||||
for (j=0 ; j<3 ; j++)
|
for (j=0 ; j<3 ; j++)
|
||||||
if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j])
|
if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j])
|
||||||
{
|
{
|
||||||
new = true;
|
new = qtrue;
|
||||||
cl.prev_cshifts[i].destcolor[j] = cl.cshifts[i].destcolor[j];
|
cl.prev_cshifts[i].destcolor[j] = cl.cshifts[i].destcolor[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -622,19 +622,19 @@ void V_UpdatePalette (void)
|
||||||
|
|
||||||
V_CalcPowerupCshift ();
|
V_CalcPowerupCshift ();
|
||||||
|
|
||||||
new = false;
|
new = qfalse;
|
||||||
|
|
||||||
for (i=0 ; i<NUM_CSHIFTS ; i++)
|
for (i=0 ; i<NUM_CSHIFTS ; i++)
|
||||||
{
|
{
|
||||||
if (cl.cshifts[i].percent != cl.prev_cshifts[i].percent)
|
if (cl.cshifts[i].percent != cl.prev_cshifts[i].percent)
|
||||||
{
|
{
|
||||||
new = true;
|
new = qtrue;
|
||||||
cl.prev_cshifts[i].percent = cl.cshifts[i].percent;
|
cl.prev_cshifts[i].percent = cl.cshifts[i].percent;
|
||||||
}
|
}
|
||||||
for (j=0 ; j<3 ; j++)
|
for (j=0 ; j<3 ; j++)
|
||||||
if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j])
|
if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j])
|
||||||
{
|
{
|
||||||
new = true;
|
new = qtrue;
|
||||||
cl.prev_cshifts[i].destcolor[j] = cl.cshifts[i].destcolor[j];
|
cl.prev_cshifts[i].destcolor[j] = cl.cshifts[i].destcolor[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
26
src/world.c
26
src/world.c
|
|
@ -594,15 +594,15 @@ qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec
|
||||||
{
|
{
|
||||||
if (num != CONTENTS_SOLID)
|
if (num != CONTENTS_SOLID)
|
||||||
{
|
{
|
||||||
trace->allsolid = false;
|
trace->allsolid = qfalse;
|
||||||
if (num == CONTENTS_EMPTY)
|
if (num == CONTENTS_EMPTY)
|
||||||
trace->inopen = true;
|
trace->inopen = qtrue;
|
||||||
else
|
else
|
||||||
trace->inwater = true;
|
trace->inwater = qtrue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
trace->startsolid = true;
|
trace->startsolid = qtrue;
|
||||||
return true; // empty
|
return qtrue; // empty
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num < hull->firstclipnode || num > hull->lastclipnode)
|
if (num < hull->firstclipnode || num > hull->lastclipnode)
|
||||||
|
|
@ -655,14 +655,14 @@ qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec
|
||||||
|
|
||||||
// move up to the node
|
// move up to the node
|
||||||
if (!SV_RecursiveHullCheck (hull, node->children[side], p1f, midf, p1, mid, trace) )
|
if (!SV_RecursiveHullCheck (hull, node->children[side], p1f, midf, p1, mid, trace) )
|
||||||
return false;
|
return qfalse;
|
||||||
|
|
||||||
#ifdef PARANOID
|
#ifdef PARANOID
|
||||||
if (SV_HullPointContents (sv_hullmodel, mid, node->children[side])
|
if (SV_HullPointContents (sv_hullmodel, mid, node->children[side])
|
||||||
== CONTENTS_SOLID)
|
== CONTENTS_SOLID)
|
||||||
{
|
{
|
||||||
Con_Printf ("mid PointInHullSolid\n");
|
Con_Printf ("mid PointInHullSolid\n");
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -672,7 +672,7 @@ qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec
|
||||||
return SV_RecursiveHullCheck (hull, node->children[side^1], midf, p2f, mid, p2, trace);
|
return SV_RecursiveHullCheck (hull, node->children[side^1], midf, p2f, mid, p2, trace);
|
||||||
|
|
||||||
if (trace->allsolid)
|
if (trace->allsolid)
|
||||||
return false; // never got out of the solid area
|
return qfalse; // never got out of the solid area
|
||||||
|
|
||||||
//==================
|
//==================
|
||||||
// the other side of the node is solid, this is the impact point
|
// the other side of the node is solid, this is the impact point
|
||||||
|
|
@ -697,7 +697,7 @@ qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec
|
||||||
trace->fraction = midf;
|
trace->fraction = midf;
|
||||||
VectorCopy (mid, trace->endpos);
|
VectorCopy (mid, trace->endpos);
|
||||||
Con_DPrintf ("backup past 0\n");
|
Con_DPrintf ("backup past 0\n");
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
midf = p1f + (p2f - p1f)*frac;
|
midf = p1f + (p2f - p1f)*frac;
|
||||||
for (i=0 ; i<3 ; i++)
|
for (i=0 ; i<3 ; i++)
|
||||||
|
|
@ -707,7 +707,7 @@ qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec
|
||||||
trace->fraction = midf;
|
trace->fraction = midf;
|
||||||
VectorCopy (mid, trace->endpos);
|
VectorCopy (mid, trace->endpos);
|
||||||
|
|
||||||
return false;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -729,7 +729,7 @@ trace_t SV_ClipMoveToEntity (edict_t *ent, vec3_t start, vec3_t mins, vec3_t max
|
||||||
// fill in a default trace
|
// fill in a default trace
|
||||||
memset (&trace, 0, sizeof(trace_t));
|
memset (&trace, 0, sizeof(trace_t));
|
||||||
trace.fraction = 1;
|
trace.fraction = 1;
|
||||||
trace.allsolid = true;
|
trace.allsolid = qtrue;
|
||||||
VectorCopy (end, trace.endpos);
|
VectorCopy (end, trace.endpos);
|
||||||
|
|
||||||
// get the clipping hull
|
// get the clipping hull
|
||||||
|
|
@ -865,13 +865,13 @@ void SV_ClipToLinks ( areanode_t *node, moveclip_t *clip )
|
||||||
if (clip->trace.startsolid)
|
if (clip->trace.startsolid)
|
||||||
{
|
{
|
||||||
clip->trace = trace;
|
clip->trace = trace;
|
||||||
clip->trace.startsolid = true;
|
clip->trace.startsolid = qtrue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
clip->trace = trace;
|
clip->trace = trace;
|
||||||
}
|
}
|
||||||
else if (trace.startsolid)
|
else if (trace.startsolid)
|
||||||
clip->trace.startsolid = true;
|
clip->trace.startsolid = qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// recurse down both sides
|
// recurse down both sides
|
||||||
|
|
|
||||||
14
src/zone.c
14
src/zone.c
|
|
@ -453,7 +453,7 @@ int Hunk_HighMark (void)
|
||||||
{
|
{
|
||||||
if (hunk_tempactive)
|
if (hunk_tempactive)
|
||||||
{
|
{
|
||||||
hunk_tempactive = false;
|
hunk_tempactive = qfalse;
|
||||||
Hunk_FreeToHighMark (hunk_tempmark);
|
Hunk_FreeToHighMark (hunk_tempmark);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -464,7 +464,7 @@ void Hunk_FreeToHighMark (int mark)
|
||||||
{
|
{
|
||||||
if (hunk_tempactive)
|
if (hunk_tempactive)
|
||||||
{
|
{
|
||||||
hunk_tempactive = false;
|
hunk_tempactive = qfalse;
|
||||||
Hunk_FreeToHighMark (hunk_tempmark);
|
Hunk_FreeToHighMark (hunk_tempmark);
|
||||||
}
|
}
|
||||||
if (mark < 0 || mark > hunk_high_used)
|
if (mark < 0 || mark > hunk_high_used)
|
||||||
|
|
@ -489,7 +489,7 @@ void *Hunk_HighAllocName (int size, char *name)
|
||||||
if (hunk_tempactive)
|
if (hunk_tempactive)
|
||||||
{
|
{
|
||||||
Hunk_FreeToHighMark (hunk_tempmark);
|
Hunk_FreeToHighMark (hunk_tempmark);
|
||||||
hunk_tempactive = false;
|
hunk_tempactive = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PARANOID
|
#ifdef PARANOID
|
||||||
|
|
@ -534,14 +534,14 @@ void *Hunk_TempAlloc (int size)
|
||||||
if (hunk_tempactive)
|
if (hunk_tempactive)
|
||||||
{
|
{
|
||||||
Hunk_FreeToHighMark (hunk_tempmark);
|
Hunk_FreeToHighMark (hunk_tempmark);
|
||||||
hunk_tempactive = false;
|
hunk_tempactive = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
hunk_tempmark = Hunk_HighMark ();
|
hunk_tempmark = Hunk_HighMark ();
|
||||||
|
|
||||||
buf = Hunk_HighAllocName (size, "temp");
|
buf = Hunk_HighAllocName (size, "temp");
|
||||||
|
|
||||||
hunk_tempactive = true;
|
hunk_tempactive = qtrue;
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
@ -577,7 +577,7 @@ void Cache_Move ( cache_system_t *c)
|
||||||
cache_system_t *new;
|
cache_system_t *new;
|
||||||
|
|
||||||
// we are clearing up space at the bottom, so only allocate it late
|
// we are clearing up space at the bottom, so only allocate it late
|
||||||
new = Cache_TryAlloc (c->size, true);
|
new = Cache_TryAlloc (c->size, qtrue);
|
||||||
if (new)
|
if (new)
|
||||||
{
|
{
|
||||||
// Con_Printf ("cache_move ok\n");
|
// Con_Printf ("cache_move ok\n");
|
||||||
|
|
@ -883,7 +883,7 @@ void *Cache_Alloc (cache_user_t *c, int size, char *name)
|
||||||
// find memory for it
|
// find memory for it
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
cs = Cache_TryAlloc (size, false);
|
cs = Cache_TryAlloc (size, qfalse);
|
||||||
if (cs)
|
if (cs)
|
||||||
{
|
{
|
||||||
strncpy (cs->name, name, sizeof(cs->name)-1);
|
strncpy (cs->name, name, sizeof(cs->name)-1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue