diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc1f6ab --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.o +/mwquake diff --git a/include/common.h b/include/common.h index f74fed1..f569299 100644 --- a/include/common.h +++ b/include/common.h @@ -24,17 +24,17 @@ typedef unsigned char byte; #define BYTE_DEFINED 1 #endif -#undef true -#undef false +#undef qtrue +#undef qfalse -typedef enum {false, true} qboolean; +typedef enum {qfalse, qtrue} qboolean; //============================================================================ typedef struct sizebuf_s { - qboolean allowoverflow; // if false, do a Sys_Error - qboolean overflowed; // set to true if the buffer size failed + qboolean allowoverflow; // if qfalse, do a Sys_Error + qboolean overflowed; // set to qtrue if the buffer size failed byte *data; int maxsize; int cursize; diff --git a/include/cvar.h b/include/cvar.h index 009b747..be25426 100644 --- a/include/cvar.h +++ b/include/cvar.h @@ -25,11 +25,11 @@ cvar_t variables are used to hold scalar or string variables that can be changed in C code. 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: 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: Cvar_RegisterVariable (&host_framerate); @@ -57,7 +57,7 @@ typedef struct cvar_s { char *name; 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 float value; struct cvar_s *next; @@ -85,12 +85,12 @@ char *Cvar_CompleteVariable (char *partial); qboolean Cvar_Command (void); // 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) void Cvar_WriteVariables (FILE *f); // 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); diff --git a/include/d_iface.h b/include/d_iface.h index 0096c39..4b4d2dd 100644 --- a/include/d_iface.h +++ b/include/d_iface.h @@ -117,7 +117,7 @@ extern qboolean r_drawculledpolys; // 1 if driver wants clipped polygons that extern qboolean r_worldpolysbacktofront; // 1 if driver wants polygons // delivered back to front rather // 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 // and vertex drawing via // D_PolysetDrawFinalVerts() past diff --git a/include/gl_model.h b/include/gl_model.h index ae576b8..8edfaba 100644 --- a/include/gl_model.h +++ b/include/gl_model.h @@ -148,7 +148,7 @@ typedef struct msurface_s int lightmaptexturenum; byte styles[MAXLIGHTMAPS]; 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] } msurface_t; diff --git a/include/miniaudio.h b/include/miniaudio.h index c74bebe..b4cfea5 100644 --- a/include/miniaudio.h +++ b/include/miniaudio.h @@ -495,9 +495,9 @@ your entitlements.xcent file: ``` com.apple.security.cs.allow-dyld-environment-variables - + com.apple.security.cs.allow-unsigned-executable-memory - + ``` 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. 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 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 @@ -2531,7 +2531,7 @@ an example for loading a decoder from a file: ma_decoder decoder; ma_result result = ma_decoder_init_file("MySong.mp3", NULL, &decoder); 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 ma_result result = ma_decoder_seek_to_pcm_frame(pDecoder, targetFrame); 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 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 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 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` -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 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 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 will result in miniaudio's internal resampler being used instead which will in turn enable the use of low-latency shared mode. @@ -3709,11 +3709,11 @@ See below for some tips on improving performance. 16.1. Low Level API ------------------- - 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. - 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 - `noPreSilence` config option in the device config to true. + `noPreSilence` config option in the device config to qtrue. 16.2. High Level API -------------------- @@ -4976,7 +4976,7 @@ typedef struct ma_uint32 channels; ma_uint32 sampleRate; 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 dry; /* 0..1. Default = 1. */ 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 { 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; typedef struct @@ -5519,7 +5519,7 @@ typedef struct const ma_channel* pChannelMapIn; const ma_channel* pChannelMapOut; 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. */ } ma_channel_converter_config; @@ -5572,7 +5572,7 @@ typedef struct ma_channel* pChannelMapOut; ma_dither_mode ditherMode; 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. */ ma_bool32 allowDynamicSampleRate; ma_resampler_config resampling; @@ -5905,7 +5905,7 @@ typedef struct { ma_audio_buffer_ref ref; 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_audio_buffer; @@ -6722,7 +6722,7 @@ ma_device_job_thread_post(). The thread will do the processing of the job. */ 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 jobQueueFlags; } ma_device_job_thread_config; @@ -7078,10 +7078,10 @@ struct ma_device_config ma_uint32 periodSizeInMilliseconds; ma_uint32 periods; 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 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 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 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 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_notification_proc notificationCallback; ma_stop_proc stopCallback; @@ -7094,7 +7094,7 @@ struct ma_device_config ma_uint32 channels; ma_channel* pChannelMap; 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; } playback; struct @@ -7104,19 +7104,19 @@ struct ma_device_config ma_uint32 channels; ma_channel* pChannelMap; 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; } capture; struct { 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 noDefaultQualitySRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */ + ma_bool8 noAutoConvertSRC; /* When set to qtrue, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */ + 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 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_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; 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 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 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 @@ -7303,8 +7303,8 @@ struct ma_context_config { ma_ios_session_category sessionCategory; 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 noAudioSessionDeactivate; /* iOS only. When set to true, does not perform an explicit [[AVAudioSession sharedInstace] setActive:false] on uninitialization. */ + 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 qtrue, does not perform an explicit [[AVAudioSession sharedInstace] setActive:qfalse] on uninitialization. */ } coreaudio; struct { @@ -7764,7 +7764,7 @@ struct ma_device ma_event stopEvent; ma_thread thread; 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 noClip; 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_uint32 loopbackProcessID; ma_bool8 loopbackProcessExclude; - ma_bool8 noAutoConvertSRC; /* When set to true, 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 noAutoConvertSRC; /* When set to qtrue, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */ + ma_bool8 noDefaultQualitySRC; /* When set to qtrue, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */ ma_bool8 noHardwareOffloading; ma_bool8 allowCaptureAutoStreamRouting; ma_bool8 allowPlaybackAutoStreamRouting; @@ -7952,8 +7952,8 @@ struct ma_device ma_performance_profile originalPerformanceProfile; ma_bool32 isDefaultPlaybackDevice; 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 isSwitchingCaptureDevice; /* <-- 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 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. */ } coreaudio; #endif @@ -8164,7 +8164,7 @@ can then be set directly on the structure. Below are the members of the `ma_cont 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 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 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()`. 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 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 - 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 - 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 The name of the client to pass to `jack_client_open()`. 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 @@ -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, 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 @@ -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. 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 callback will write to every sample in the output buffer, or if you are doing your own clearing. 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 - 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 + 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 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. 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 - 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 - consistent frame count as specified by `periodSizeInFrames` or `periodSizeInMilliseconds`. When set to true, miniaudio will fire the callback with + 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 qtrue, miniaudio will fire the callback with whatever the backend requests, which could be anything. 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. 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 only. Only used when `wasapi.noAutoConvertSRC` is set to false. When set to true, disables the use of `AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY`. - You should usually leave this set to false, which is the default. + 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 qfalse, which is the default. 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 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 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 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 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 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 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 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 - 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 - 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 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 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. @@ -9211,7 +9211,7 @@ pDevice (in) Return Value ------------ -True if the device is started, false otherwise. +True if the device is started, qfalse otherwise. 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_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_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_buffer_node* pParent; 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. */ 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) 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. */ }; @@ -10756,7 +10756,7 @@ struct ma_node_base ma_node_input_bus _inputBuses[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. */ - 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); @@ -11145,8 +11145,8 @@ typedef struct 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 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) isSpatializationDisabled; /* Set to false by default. When set to false, will not have spatialisation applied. */ + 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 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. */ /* 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 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_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 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 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 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_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. */ @@ -17389,7 +17389,7 @@ MA_API ma_result ma_slot_allocator_free(ma_slot_allocator* pAllocator, ma_uint64 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) { /* CAS */ @@ -27127,14 +27127,14 @@ static ma_bool32 ma_is_device_name_in_hw_format__alsa(const char* hwid) 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) { if (hwid[i] < '0' || hwid[i] > '9') { 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; while (dev[i] != '\0') { 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); ppNextDeviceHint += 1; - /* We need to stop enumeration if the callback returned false. */ + /* We need to stop enumeration if the callback returned qfalse. */ if (stopEnumeration) { 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 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 - 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 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. @@ -34997,7 +34997,7 @@ static ma_result ma_context_uninit__coreaudio(ma_context* pContext) #if defined(MA_APPLE_MOBILE) 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."); 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 (![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."); 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 audioContext = emscriptenGetAudioObject($1); - navigator.mediaDevices.getUserMedia({audio:true, video:false}) + navigator.mediaDevices.getUserMedia({audio:qtrue, video:qfalse}) .then(function(stream) { audioContext.streamNode = audioContext.createMediaStreamSource(stream); 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. */ 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) { device.streamNode = device.webaudio.createMediaStreamSource(stream); device.streamNode.connect(device.scriptNode); @@ -40783,7 +40783,7 @@ static ma_result ma_context_uninit__webaudio(ma_context* pContext) EM_ASM({ if (typeof(window.miniaudio) !== 'undefined') { 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; @@ -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) { - document.removeEventListener(event_type, miniaudio.unlock, true); + document.removeEventListener(event_type, miniaudio.unlock, qtrue); }); }; 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 ilpf1; 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) { 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 ihpf1; 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) { 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_uint32 bpf2Count; 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) { 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. */ @@ -61277,7 +61277,7 @@ static ma_result ma_decoder__init_data_converter(ma_decoder* pDecoder, const ma_ converterConfig.pChannelMapOut = pConfig->pChannelMap; converterConfig.channelMixMode = pConfig->channelMixMode; 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; 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 (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)); @@ -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 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 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 diff --git a/include/net.h b/include/net.h index af46125..08be981 100644 --- a/include/net.h +++ b/include/net.h @@ -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 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. int NET_GetMessage (struct qsocket_s *sock); diff --git a/include/quakedef.h b/include/quakedef.h index cbb74f8..770232c 100644 --- a/include/quakedef.h +++ b/include/quakedef.h @@ -293,7 +293,7 @@ extern cvar_t sys_ticrate; extern cvar_t sys_nostdout; 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 byte *host_basepal; extern byte *host_colormap; diff --git a/include/server.h b/include/server.h index 2d4dfeb..7d38d8e 100644 --- a/include/server.h +++ b/include/server.h @@ -34,7 +34,7 @@ typedef enum {ss_loading, ss_active} server_state_t; typedef struct { - qboolean active; // false if only a net client + qboolean active; // qfalse if only a net client qboolean paused; qboolean loadgame; // handle connections specially @@ -77,8 +77,8 @@ typedef struct typedef struct client_s { - qboolean active; // false = client is free - qboolean spawned; // false = don't send datagrams + qboolean active; // qfalse = client is free + qboolean spawned; // qfalse = don't send datagrams qboolean dropasap; // has been told to go to another level qboolean privileged; // can execute any host command qboolean sendsignon; // only valid before spawned diff --git a/include/vid.h b/include/vid.h index 1708ba8..25d2a39 100644 --- a/include/vid.h +++ b/include/vid.h @@ -42,7 +42,7 @@ typedef struct unsigned height; float aspect; // width / height -- < 0 is taller than wide int numpages; - int recalc_refdef; // if true, recalc vid-based stuff + int recalc_refdef; // if qtrue, recalc vid-based stuff pixel_t *conbuffer; int conrowbytes; unsigned conwidth; diff --git a/include/world.h b/include/world.h index 7e1c6f2..08b8388 100644 --- a/include/world.h +++ b/include/world.h @@ -27,8 +27,8 @@ typedef struct typedef struct { - qboolean allsolid; // if true, plane is not valid - qboolean startsolid; // if true, the initial point was in a solid area + qboolean allsolid; // if qtrue, plane is not valid + qboolean startsolid; // if qtrue, the initial point was in a solid area qboolean inopen, inwater; float fraction; // time completed, 1.0 = didn't hit anything vec3_t endpos; // final position @@ -62,7 +62,7 @@ int SV_PointContents (vec3_t p); int SV_TruePointContents (vec3_t p); // returns the CONTENTS_* value from the world at the given point. // 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); diff --git a/src/cl_demo.c b/src/cl_demo.c index 3c3eba7..70cd0da 100644 --- a/src/cl_demo.c +++ b/src/cl_demo.c @@ -48,7 +48,7 @@ void CL_StopPlayback (void) return; fclose (cls.demofile); - cls.demoplayback = false; + cls.demoplayback = qfalse; cls.demofile = NULL; cls.state = ca_disconnected; @@ -182,7 +182,7 @@ void CL_Stop_f (void) // finish up fclose (cls.demofile); cls.demofile = NULL; - cls.demorecording = false; + cls.demorecording = qfalse; Con_Printf ("Completed demo\n"); } @@ -254,7 +254,7 @@ void CL_Record_f (void) cls.forcetrack = track; 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]; int c; - qboolean neg = false; + qboolean neg = qfalse; if (cmd_source != src_command) return; @@ -300,13 +300,13 @@ void CL_PlayDemo_f (void) return; } - cls.demoplayback = true; + cls.demoplayback = qtrue; cls.state = ca_connected; cls.forcetrack = 0; while ((c = getc(cls.demofile)) != '\n') if (c == '-') - neg = true; + neg = qtrue; else cls.forcetrack = cls.forcetrack * 10 + (c - '0'); @@ -327,7 +327,7 @@ void CL_FinishTimeDemo (void) int frames; float time; - cls.timedemo = false; + cls.timedemo = qfalse; // the first frame didn't count 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 // all the loading time doesn't get counted - cls.timedemo = true; + cls.timedemo = qtrue; cls.td_startframe = host_framecount; cls.td_lastframe = -1; // get a new message this frame } diff --git a/src/cl_input.c b/src/cl_input.c index bfb6432..caca383 100644 --- a/src/cl_input.c +++ b/src/cl_input.c @@ -218,8 +218,8 @@ float CL_KeyState (kbutton_t *key) //========================================================================== cvar_t cl_upspeed = {"cl_upspeed","200"}; -cvar_t cl_forwardspeed = {"cl_forwardspeed","200", true}; -cvar_t cl_backspeed = {"cl_backspeed","200", true}; +cvar_t cl_forwardspeed = {"cl_forwardspeed","200", qtrue}; +cvar_t cl_backspeed = {"cl_backspeed","200", qtrue}; cvar_t cl_sidespeed = {"cl_sidespeed","350"}; cvar_t cl_movespeedkey = {"cl_movespeedkey","2.0"}; diff --git a/src/cl_main.c b/src/cl_main.c index 5812143..e49a8a9 100644 --- a/src/cl_main.c +++ b/src/cl_main.c @@ -25,20 +25,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // references them even when on a unix system. // these two are not intended to be set directly -cvar_t cl_name = {"_cl_name", "player", true}; -cvar_t cl_color = {"_cl_color", "0", true}; +cvar_t cl_name = {"_cl_name", "player", qtrue}; +cvar_t cl_color = {"_cl_color", "0", qtrue}; cvar_t cl_shownet = {"cl_shownet","0"}; // can be 0, 1, or 2 cvar_t cl_nolerp = {"cl_nolerp","0"}; -cvar_t lookspring = {"lookspring","0", true}; -cvar_t lookstrafe = {"lookstrafe","0", true}; -cvar_t sensitivity = {"sensitivity","3", true}; +cvar_t lookspring = {"lookspring","0", qtrue}; +cvar_t lookstrafe = {"lookstrafe","0", qtrue}; +cvar_t sensitivity = {"sensitivity","3", qtrue}; -cvar_t m_pitch = {"m_pitch","0.022", true}; -cvar_t m_yaw = {"m_yaw","0.022", true}; -cvar_t m_forward = {"m_forward","1", true}; -cvar_t m_side = {"m_side","0.8", true}; +cvar_t m_pitch = {"m_pitch","0.022", qtrue}; +cvar_t m_yaw = {"m_yaw","0.022", qtrue}; +cvar_t m_forward = {"m_forward","1", qtrue}; +cvar_t m_side = {"m_side","0.8", qtrue}; 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) { // stop sounds (especially looping!) - S_StopAllSounds (true); + S_StopAllSounds (qtrue); // bring the console down and fade the colors back to normal // SCR_BringDownConsole (); @@ -121,10 +121,10 @@ void CL_Disconnect (void) cls.state = ca_disconnected; if (sv.active) - Host_ShutdownServer(false); + Host_ShutdownServer(qfalse); } - cls.demoplayback = cls.timedemo = false; + cls.demoplayback = cls.timedemo = qfalse; cls.signon = 0; } @@ -132,7 +132,7 @@ void CL_Disconnect_f (void) { CL_Disconnect (); if (sv.active) - Host_ShutdownServer (false); + Host_ShutdownServer (qfalse); } @@ -573,7 +573,7 @@ void CL_RelinkEntities (void) VectorCopy (ent->origin, dl->origin); dl->radius = 200.0 + (rand()&31); dl->die = cl.time + 0.001; - dl->dark = true; + dl->dark = qtrue; } if (ent->effects & EF_LIGHT) { @@ -605,7 +605,7 @@ void CL_RelinkEntities (void) else if (ent->model->flags & EF_TRACER3) R_RocketTrail (oldorg, ent->origin, 6); - ent->forcelink = false; + ent->forcelink = qfalse; if (i == cl.viewentity && !chase_active.value) continue; diff --git a/src/cl_parse.c b/src/cl_parse.c index 13a31ea..f71fadf 100644 --- a/src/cl_parse.c +++ b/src/cl_parse.c @@ -287,7 +287,7 @@ void CL_ParseServerInfo (void) for (i=1 ; imsgtime != cl.mtime[1]) - forcelink = true; // no previous frame to lerp from + forcelink = qtrue; // no previous frame to lerp from else - forcelink = false; + forcelink = qfalse; ent->msgtime = cl.mtime[0]; @@ -392,7 +392,7 @@ if (bits&(1<syncbase = 0.0; } else - forcelink = true; // hack to make null model players work + forcelink = qtrue; // hack to make null model players work #ifdef GLQUAKE if (num > 0 && num <= cl.maxclients) R_TranslatePlayerSkin (num - 1); @@ -473,7 +473,7 @@ if (bits&(1<msg_angles[0][2] = ent->baseline.angles[2]; if ( bits & U_NOLERP ) - ent->forcelink = true; + ent->forcelink = qtrue; if ( forcelink ) { // didn't have an update last message @@ -481,7 +481,7 @@ if (bits&(1<msg_origins[0], ent->origin); VectorCopy (ent->msg_angles[0], ent->msg_angles[1]); 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) Con_Printf ("------------------\n"); - cl.onground = false; // unless the server says otherwise + cl.onground = qfalse; // unless the server says otherwise // // parse the message // @@ -809,7 +809,7 @@ void CL_ParseServerMessage (void) case svc_serverinfo: CL_ParseServerInfo (); - vid.recalc_refdef = true; // leave intermission full screen + vid.recalc_refdef = qtrue; // leave intermission full screen break; case svc_setangle: @@ -887,14 +887,14 @@ void CL_ParseServerMessage (void) { CDAudio_Pause (); #ifdef WINQUAKE - VID_HandlePause (true); + VID_HandlePause (qtrue); #endif } else { CDAudio_Resume (); #ifdef WINQUAKE - VID_HandlePause (false); + VID_HandlePause (qfalse); #endif } } @@ -931,28 +931,28 @@ void CL_ParseServerMessage (void) cl.cdtrack = MSG_ReadByte (); cl.looptrack = MSG_ReadByte (); if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) ) - CDAudio_Play ((byte)cls.forcetrack, true); + CDAudio_Play ((byte)cls.forcetrack, qtrue); else - CDAudio_Play ((byte)cl.cdtrack, true); + CDAudio_Play ((byte)cl.cdtrack, qtrue); break; case svc_intermission: cl.intermission = 1; cl.completed_time = cl.time; - vid.recalc_refdef = true; // go to full screen + vid.recalc_refdef = qtrue; // go to full screen break; case svc_finale: cl.intermission = 2; 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 ()); break; case svc_cutscene: cl.intermission = 3; 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 ()); break; diff --git a/src/cl_tent.c b/src/cl_tent.c index 546e832..ba8283d 100644 --- a/src/cl_tent.c +++ b/src/cl_tent.c @@ -214,20 +214,20 @@ void CL_ParseTEnt (void) break; case TE_LIGHTNING1: // lightning bolts - CL_ParseBeam (Mod_ForName("progs/bolt.mdl", true)); + CL_ParseBeam (Mod_ForName("progs/bolt.mdl", qtrue)); break; case TE_LIGHTNING2: // lightning bolts - CL_ParseBeam (Mod_ForName("progs/bolt2.mdl", true)); + CL_ParseBeam (Mod_ForName("progs/bolt2.mdl", qtrue)); break; case TE_LIGHTNING3: // lightning bolts - CL_ParseBeam (Mod_ForName("progs/bolt3.mdl", true)); + CL_ParseBeam (Mod_ForName("progs/bolt3.mdl", qtrue)); break; // PGM 01/21/97 case TE_BEAM: // grappling hook beam - CL_ParseBeam (Mod_ForName("progs/beam.mdl", true)); + CL_ParseBeam (Mod_ForName("progs/beam.mdl", qtrue)); break; // PGM 01/21/97 diff --git a/src/cmd.c b/src/cmd.c index 0778c5e..1cfca99 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -52,7 +52,7 @@ bind g "impulse 5 ; +attack ; wait ; -attack ; impulse 2" */ void Cmd_Wait_f (void) { - cmd_wait = true; + cmd_wait = qtrue; } /* @@ -186,7 +186,7 @@ void Cbuf_Execute (void) if (cmd_wait) { // skip out while text still remains in buffer, leaving it // for next frame - cmd_wait = false; + cmd_wait = qfalse; break; } } @@ -572,10 +572,10 @@ qboolean Cmd_Exists (char *cmd_name) for (cmd=cmd_functions ; cmd ; cmd=cmd->next) { if (!Q_strcmp (cmd_name,cmd->name)) - return true; + return qtrue; } - return false; + return qfalse; } diff --git a/src/common.c b/src/common.c index d2dfa9f..d7396ac 100644 --- a/src/common.c +++ b/src/common.c @@ -30,9 +30,9 @@ static char *safeargvs[NUM_SAFE_ARGVS] = {"-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse", "-dibonly"}; 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; @@ -53,7 +53,7 @@ char **com_argv; #define CMDLINE_LENGTH 256 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 unsigned short pop[] = @@ -600,7 +600,7 @@ qboolean msg_badread; void MSG_BeginReading (void) { msg_readcount = 0; - msg_badread = false; + msg_badread = qfalse; } // 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) { - msg_badread = true; + msg_badread = qtrue; return -1; } @@ -626,7 +626,7 @@ int MSG_ReadByte (void) if (msg_readcount+1 > net_message.cursize) { - msg_badread = true; + msg_badread = qtrue; return -1; } @@ -642,7 +642,7 @@ int MSG_ReadShort (void) if (msg_readcount+2 > net_message.cursize) { - msg_badread = true; + msg_badread = qtrue; return -1; } @@ -660,7 +660,7 @@ int MSG_ReadLong (void) if (msg_readcount+4 > net_message.cursize) { - msg_badread = true; + msg_badread = qtrue; return -1; } @@ -763,7 +763,7 @@ void *SZ_GetSpace (sizebuf_t *buf, int length) if (length > buf->maxsize) Sys_Error ("SZ_GetSpace: %i is > full buffer size", length); - buf->overflowed = true; + buf->overflowed = qtrue; Con_Printf ("SZ_GetSpace: overflow"); SZ_Clear (buf); } @@ -1079,14 +1079,14 @@ void COM_InitArgv (int argc, char **argv) com_cmdline[n] = 0; - safe = false; + safe = qfalse; for (com_argc=0 ; (com_argcname, v->string); - return true; + return qtrue; } Cvar_Set (v->name, Cmd_Argv(1)); - return true; + return qtrue; } @@ -210,7 +210,7 @@ qboolean Cvar_Command (void) Cvar_WriteVariables 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) diff --git a/src/gl.c b/src/gl.c index 2f26bdc..95d1681 100644 --- a/src/gl.c +++ b/src/gl.c @@ -52,14 +52,14 @@ static qboolean mouse_active; static int mx, my; static int old_mouse_x, old_mouse_y; -qboolean dgamouse = false; -qboolean vidmode_ext = false; +qboolean dgamouse = qfalse; +qboolean vidmode_ext = qfalse; static int scr_width, scr_height; static int default_dotclock_vidmode; 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; -qboolean is8bit = false; -qboolean isPermedia = false; -qboolean gl_mtexable = false; +qboolean is8bit = qfalse; +qboolean isPermedia = qfalse; +qboolean gl_mtexable = qfalse; /*-----------------------------------------------------------------------*/ void D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height) @@ -101,7 +101,7 @@ static void install_grabs(void) { MwHideCursor(opengl); MwGrabPointer(opengl, 1); - mouse_active = true; + mouse_active = qtrue; } static void uninstall_grabs(void) @@ -111,7 +111,7 @@ static void uninstall_grabs(void) MwGrabPointer(opengl, 0); - mouse_active = false; + mouse_active = qfalse; } static int MilskoToQuakeKey(int key){ @@ -190,7 +190,7 @@ void focusout(MwWidget handle, void* user, void* call){ static void HandleEvents(void) { int b; - qboolean dowarp = false; + qboolean dowarp = qfalse; int mwx = vid.width/2; int mwy = vid.height/2; @@ -209,7 +209,7 @@ static void IN_DeactivateMouse( void ) if (mouse_active) { uninstall_grabs(); - mouse_active = false; + mouse_active = qfalse; } } @@ -221,7 +221,7 @@ static void IN_ActivateMouse( void ) if (!mouse_active) { mx = my = 0; // don't spazz install_grabs(); - mouse_active = true; + mouse_active = qtrue; } } @@ -232,7 +232,7 @@ void VID_Shutdown(void) if (win) { MwDestroyWidget(win); } - vidmode_active = false; + vidmode_active = qfalse; win = NULL; } @@ -426,7 +426,7 @@ void VID_Init(unsigned char *palette) char gldir[MAX_OSPATH]; int width = 640, height = 480; unsigned long mask; - qboolean fullscreen = true; + qboolean fullscreen = qtrue; int MajorVersion, MinorVersion; int actualWidth, actualHeight; MwSizeHints sh; @@ -443,7 +443,7 @@ void VID_Init(unsigned char *palette) // set vid parameters if ((i = COM_CheckParm("-window")) != 0) - fullscreen = false; + fullscreen = qfalse; if ((i = COM_CheckParm("-width")) != 0) width = atoi(com_argv[i+1]); diff --git a/src/gl_draw.c b/src/gl_draw.c index c11d92d..fdb6ef7 100644 --- a/src/gl_draw.c +++ b/src/gl_draw.c @@ -160,9 +160,9 @@ void Scrap_Upload (void) for (texnum=0 ; texnumwidth, p->height, &x, &y); - scrap_dirty = true; + scrap_dirty = qtrue; k = 0; for (i=0 ; iheight ; i++) for (j=0 ; jwidth ; j++, k++) @@ -402,7 +402,7 @@ void Draw_Init (void) draw_chars[i] = 255; // proper transparent color // 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(); @@ -461,7 +461,7 @@ void Draw_Init (void) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 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->sh = 1; 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 if (alpha) { - noalpha = true; + noalpha = qtrue; for (i=0 ; iwidth, pic->height, pic->data, false, true); + return GL_LoadTexture ("", pic->width, pic->height, pic->data, qfalse, qtrue); } /****************************************/ diff --git a/src/gl_model.c b/src/gl_model.c index 21ef130..1a7f137 100644 --- a/src/gl_model.c +++ b/src/gl_model.c @@ -38,7 +38,7 @@ byte mod_novis[MAX_MAP_LEAFS/8]; model_t mod_known[MAX_MOD_KNOWN]; 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) return r; - Mod_LoadModel (mod, true); + Mod_LoadModel (mod, qtrue); if (!mod->cache.data) Sys_Error ("Mod_Extradata: caching failed"); @@ -172,7 +172,7 @@ void Mod_ClearAll (void) for (i=0 , mod=mod_known ; itype != mod_alias) - mod->needload = true; + mod->needload = qtrue; } /* @@ -201,7 +201,7 @@ model_t *Mod_FindName (char *name) if (mod_numknown == MAX_MOD_KNOWN) Sys_Error ("mod_numknown == MAX_MOD_KNOWN"); strcpy (mod->name, name); - mod->needload = true; + mod->needload = qtrue; mod_numknown++; } @@ -283,7 +283,7 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash) // // call the apropriate loader - mod->needload = false; + mod->needload = qfalse; switch (LittleLong(*(unsigned *)buf)) { @@ -388,7 +388,7 @@ void Mod_LoadTextures (lump_t *l) else { 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; } } @@ -1444,7 +1444,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype) pheader->gl_texturenum[i][2] = pheader->gl_texturenum[i][3] = 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); } else { // 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); pheader->gl_texturenum[i][j&3] = GL_LoadTexture (name, pheader->skinwidth, - pheader->skinheight, (byte *)(pskintype), true, false); + pheader->skinheight, (byte *)(pskintype), qtrue, qfalse); pskintype = (daliasskintype_t *)((byte *)(pskintype) + s); } k = j; @@ -1684,7 +1684,7 @@ void * Mod_LoadSpriteFrame (void * pin, mspriteframe_t **ppframe, int framenum) pspriteframe->right = width + origin[0]; 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); } diff --git a/src/gl_rmain.c b/src/gl_rmain.c index 6680b36..1cf293a 100644 --- a/src/gl_rmain.c +++ b/src/gl_rmain.c @@ -35,7 +35,7 @@ mplane_t frustum[4]; 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 @@ -105,7 +105,7 @@ extern cvar_t gl_ztrick; ================= 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) @@ -114,8 +114,8 @@ qboolean R_CullBox (vec3_t mins, vec3_t maxs) for (i=0 ; i<4 ; i++) if (BoxOnPlaneSide (mins, maxs, &frustum[i]) == 2) - return true; - return false; + return qtrue; + return qfalse; } @@ -833,7 +833,7 @@ void R_SetupFrame (void) V_SetContentsColor (r_viewleaf->contents); V_CalcBlend (); - r_cache_thrash = false; + r_cache_thrash = qfalse; c_brush_polys = 0; c_alias_polys = 0; @@ -1099,7 +1099,7 @@ void R_RenderView (void) c_alias_polys = 0; } - mirror = false; + mirror = qfalse; if (gl_finish.value) glFinish (); diff --git a/src/gl_rmisc.c b/src/gl_rmisc.c index c9719b5..df5c934 100644 --- a/src/gl_rmisc.c +++ b/src/gl_rmisc.c @@ -110,7 +110,7 @@ void R_Envmap_f (void) glDrawBuffer (GL_FRONT); glReadBuffer (GL_FRONT); - envmap = true; + envmap = qtrue; r_refdef.vrect.x = 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); COM_WriteFile ("env5.rgb", buffer, sizeof(buffer)); - envmap = false; + envmap = qfalse; glDrawBuffer (GL_BACK); glReadBuffer (GL_BACK); GL_EndRendering (); @@ -304,7 +304,7 @@ void R_TranslatePlayerSkin (int playernum) // 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 scaled_width = gl_max_size.value < 512 ? gl_max_size.value : 512; 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; } diff --git a/src/gl_rsurf.c b/src/gl_rsurf.c index b994f0e..51bc998 100644 --- a/src/gl_rsurf.c +++ b/src/gl_rsurf.c @@ -279,7 +279,7 @@ void DrawGLWaterPolyLightmap (glpoly_t *p); lpMTexFUNC qglMTexCoord2fSGIS = NULL; lpSelTexFUNC qglSelectTextureSGIS = NULL; -qboolean mtexenabled = false; +qboolean mtexenabled = qfalse; void GL_SelectTexture (GLenum target); @@ -288,7 +288,7 @@ void GL_DisableMultitexture(void) if (mtexenabled) { glDisable(GL_TEXTURE_2D); GL_SelectTexture(TEXTURE0_SGIS); - mtexenabled = false; + mtexenabled = qfalse; } } @@ -297,7 +297,7 @@ void GL_EnableMultitexture(void) if (gl_mtexable) { GL_SelectTexture(TEXTURE1_SGIS); glEnable(GL_TEXTURE_2D); - mtexenabled = true; + mtexenabled = qtrue; } } @@ -439,7 +439,7 @@ void R_DrawSequentialPoly (msurface_t *s) i = s->lightmaptexturenum; if (lightmap_modified[i]) { - lightmap_modified[i] = false; + lightmap_modified[i] = qfalse; theRect = &lightmap_rectchange[i]; glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t, BLOCK_WIDTH, theRect->h, gl_lightmap_format, GL_UNSIGNED_BYTE, @@ -541,7 +541,7 @@ void R_DrawSequentialPoly (msurface_t *s) i = s->lightmaptexturenum; if (lightmap_modified[i]) { - lightmap_modified[i] = false; + lightmap_modified[i] = qfalse; theRect = &lightmap_rectchange[i]; glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t, BLOCK_WIDTH, theRect->h, gl_lightmap_format, GL_UNSIGNED_BYTE, @@ -700,7 +700,7 @@ void R_BlendLightmaps (void) GL_Bind(lightmap_textures+i); if (lightmap_modified[i]) { - lightmap_modified[i] = false; + lightmap_modified[i] = qfalse; theRect = &lightmap_rectchange[i]; // glTexImage2D (GL_TEXTURE_2D, 0, lightmap_bytes // , BLOCK_WIDTH, BLOCK_HEIGHT, 0, @@ -798,7 +798,7 @@ void R_RenderBrushPoly (msurface_t *fa) dynamic: if (r_dynamic.value) { - lightmap_modified[fa->lightmaptexturenum] = true; + lightmap_modified[fa->lightmaptexturenum] = qtrue; theRect = &lightmap_rectchange[fa->lightmaptexturenum]; if (fa->light_t < theRect->t) { if (theRect->h) @@ -857,7 +857,7 @@ void R_RenderDynamicLightmaps (msurface_t *fa) dynamic: if (r_dynamic.value) { - lightmap_modified[fa->lightmaptexturenum] = true; + lightmap_modified[fa->lightmaptexturenum] = qtrue; theRect = &lightmap_rectchange[fa->lightmaptexturenum]; if (fa->light_t < theRect->t) { if (theRect->h) @@ -891,7 +891,7 @@ void R_MirrorChain (msurface_t *s) { if (mirror) return; - mirror = true; + mirror = qtrue; mirror_plane = s->plane; } @@ -1090,7 +1090,7 @@ void R_DrawBrushModel (entity_t *e) if (e->angles[0] || e->angles[1] || e->angles[2]) { - rotated = true; + rotated = qtrue; for (i=0 ; i<3 ; i++) { mins[i] = e->origin[i] - clmodel->radius; @@ -1099,7 +1099,7 @@ void R_DrawBrushModel (entity_t *e) } else { - rotated = false; + rotated = qfalse; VectorAdd (e->origin, clmodel->mins, mins); VectorAdd (e->origin, clmodel->maxs, maxs); } @@ -1674,7 +1674,7 @@ void GL_BuildLightmaps (void) { if (!allocated[i][0]) break; // no more used - lightmap_modified[i] = false; + lightmap_modified[i] = qfalse; lightmap_rectchange[i].l = BLOCK_WIDTH; lightmap_rectchange[i].t = BLOCK_HEIGHT; lightmap_rectchange[i].w = 0; diff --git a/src/gl_screen.c b/src/gl_screen.c index cc49828..080df53 100644 --- a/src/gl_screen.c +++ b/src/gl_screen.c @@ -80,7 +80,7 @@ float scr_con_current; float scr_conlines; // lines of console to display 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_conspeed = {"scr_conspeed","300"}; 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_showpause = {"showpause","1"}; 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; @@ -257,7 +257,7 @@ static void SCR_CalcRefdef (void) vrect_t vrect; float size; int h; - qboolean full = false; + qboolean full = qfalse; scr_fullupdate = 0; // force a background redraw @@ -294,13 +294,13 @@ static void SCR_CalcRefdef (void) sb_lines = 24+16+8; if (scr_viewsize.value >= 100.0) { - full = true; + full = qtrue; size = 100.0; } else size = scr_viewsize.value; if (cl.intermission) { - full = true; + full = qtrue; size = 100; sb_lines = 0; } @@ -391,7 +391,7 @@ void SCR_Init (void) scr_net = Draw_PicFromWad ("net"); scr_turtle = Draw_PicFromWad ("turtle"); - scr_initialized = true; + scr_initialized = qtrue; } @@ -556,7 +556,7 @@ void SCR_DrawConsole (void) if (scr_con_current) { scr_copyeverything = 1; - Con_DrawConsole (scr_con_current, true); + Con_DrawConsole (scr_con_current, qtrue); clearconsole = 0; } else @@ -652,7 +652,7 @@ SCR_BeginLoadingPlaque */ void SCR_BeginLoadingPlaque (void) { - S_StopAllSounds (true); + S_StopAllSounds (qtrue); if (cls.state != ca_connected) return; @@ -664,13 +664,13 @@ void SCR_BeginLoadingPlaque (void) scr_centertime_off = 0; scr_con_current = 0; - scr_drawloading = true; + scr_drawloading = qtrue; scr_fullupdate = 0; Sbar_Changed (); SCR_UpdateScreen (); - scr_drawloading = false; + scr_drawloading = qfalse; - scr_disabled_for_loading = true; + scr_disabled_for_loading = qtrue; scr_disabled_time = realtime; scr_fullupdate = 0; } @@ -683,7 +683,7 @@ SCR_EndLoadingPlaque */ void SCR_EndLoadingPlaque (void) { - scr_disabled_for_loading = false; + scr_disabled_for_loading = qfalse; scr_fullupdate = 0; Con_ClearNotify (); } @@ -736,15 +736,15 @@ keypress. int SCR_ModalMessage (char *text) { if (cls.state == ca_dedicated) - return true; + return qtrue; scr_notifystring = text; // draw a fresh screen scr_fullupdate = 0; - scr_drawdialog = true; + scr_drawdialog = qtrue; SCR_UpdateScreen (); - scr_drawdialog = false; + scr_drawdialog = qfalse; S_ClearBuffer (); // so dma doesn't loop current sound @@ -835,7 +835,7 @@ void SCR_UpdateScreen (void) { if (realtime - scr_disabled_time > 60) { - scr_disabled_for_loading = false; + scr_disabled_for_loading = qfalse; Con_Printf ("load failed.\n"); } else @@ -854,13 +854,13 @@ void SCR_UpdateScreen (void) if (oldfov != scr_fov.value) { oldfov = scr_fov.value; - vid.recalc_refdef = true; + vid.recalc_refdef = qtrue; } if (oldscreensize != scr_viewsize.value) { oldscreensize = scr_viewsize.value; - vid.recalc_refdef = true; + vid.recalc_refdef = qtrue; } if (vid.recalc_refdef) @@ -885,7 +885,7 @@ void SCR_UpdateScreen (void) Sbar_Draw (); Draw_FadeScreen (); SCR_DrawNotifyString (); - scr_copyeverything = true; + scr_copyeverything = qtrue; } else if (scr_drawloading) { diff --git a/src/gl_test.c b/src/gl_test.c index a3b1027..206b208 100644 --- a/src/gl_test.c +++ b/src/gl_test.c @@ -52,7 +52,7 @@ plane_t *HitPlane (vec3_t start, vec3_t end) // fill in a default trace memset (&trace, 0, sizeof(trace_t)); trace.fraction = 1; - trace.allsolid = true; + trace.allsolid = qtrue; VectorCopy (end, trace.endpos); SV_RecursiveHullCheck (cl.worldmodel->hulls, 0, 0, 1, start, end, &trace); diff --git a/src/gl_warp.c b/src/gl_warp.c index e8b96af..deaedd2 100644 --- a/src/gl_warp.c +++ b/src/gl_warp.c @@ -816,19 +816,19 @@ void ClipSkyPolygon (int nump, vec3_t vecs, int stage) return; } - front = back = false; + front = back = qfalse; norm = skyclip[stage]; for (i=0, v = vecs ; i ON_EPSILON) { - front = true; + front = qtrue; sides[i] = SIDE_FRONT; } else if (d < ON_EPSILON) { - back = true; + back = qtrue; sides[i] = SIDE_BACK; } else diff --git a/src/host.c b/src/host.c index 603f6b3..ece1066 100644 --- a/src/host.c +++ b/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; -qboolean host_initialized; // true if into command execution +qboolean host_initialized; // qtrue if into command execution double host_frametime; 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 serverprofile = {"serverprofile","0"}; -cvar_t fraglimit = {"fraglimit","0",false,true}; -cvar_t timelimit = {"timelimit","0",false,true}; -cvar_t teamplay = {"teamplay","0",false,true}; +cvar_t fraglimit = {"fraglimit","0",qfalse,qtrue}; +cvar_t timelimit = {"timelimit","0",qfalse,qtrue}; +cvar_t teamplay = {"teamplay","0",qfalse,qtrue}; cvar_t samelevel = {"samelevel","0"}; -cvar_t noexit = {"noexit","0",false,true}; +cvar_t noexit = {"noexit","0",qfalse,qtrue}; #ifdef QUAKE2 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); if (sv.active) - Host_ShutdownServer (false); + Host_ShutdownServer (qfalse); if (cls.state == ca_dedicated) Sys_Error ("Host_EndGame: %s\n",string); // dedicated servers exit @@ -122,11 +122,11 @@ void Host_Error (char *error, ...) { va_list argptr; char string[1024]; - static qboolean inerror = false; + static qboolean inerror = qfalse; if (inerror) Sys_Error ("Host_Error: recursively entered"); - inerror = true; + inerror = qtrue; SCR_EndLoadingPlaque (); // reenable screen updates @@ -136,7 +136,7 @@ void Host_Error (char *error, ...) Con_Printf ("Host_Error: %s\n",string); if (sv.active) - Host_ShutdownServer (false); + Host_ShutdownServer (qfalse); if (cls.state == ca_dedicated) Sys_Error ("Host_Error: %s\n",string); // dedicated servers exit @@ -144,7 +144,7 @@ void Host_Error (char *error, ...) CL_Disconnect (); cls.demonum = -1; - inerror = false; + inerror = qfalse; longjmp (host_abortserver, 1); } @@ -337,7 +337,7 @@ void Host_ClientCommands (char *fmt, ...) SV_DropClient 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) @@ -373,7 +373,7 @@ void SV_DropClient (qboolean crash) host_client->netconnection = NULL; // free the client (the body stays around) - host_client->active = false; + host_client->active = qfalse; host_client->name[0] = 0; host_client->old_frags = -999999; net_activeconnections--; @@ -413,7 +413,7 @@ void Host_ShutdownServer(qboolean crash) if (!sv.active) return; - sv.active = false; + sv.active = qfalse; // stop all client sounds immediately if (cls.state == ca_connected) @@ -495,7 +495,7 @@ void Host_ClearMemory (void) =================== 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) @@ -503,7 +503,7 @@ qboolean Host_FilterTime (float time) realtime += time; 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; oldrealtime = realtime; @@ -518,7 +518,7 @@ qboolean Host_FilterTime (float time) host_frametime = 0.001; } - return true; + return qtrue; } @@ -915,7 +915,7 @@ void Host_Init (quakeparms_t *parms) Hunk_AllocName (0, "-HOST_HUNKLEVEL-"); host_hunklevel = Hunk_LowMark (); - host_initialized = true; + host_initialized = qtrue; 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) { - static qboolean isdown = false; + static qboolean isdown = qfalse; if (isdown) { printf ("recursive shutdown\n"); return; } - isdown = true; + isdown = qtrue; // keep Con_Printf from trying to update the screen - scr_disabled_for_loading = true; + scr_disabled_for_loading = qtrue; Host_WriteConfiguration (); diff --git a/src/host_cmd.c b/src/host_cmd.c index 690dc45..bb0f9d3 100644 --- a/src/host_cmd.c +++ b/src/host_cmd.c @@ -42,7 +42,7 @@ void Host_Quit_f (void) return; } CL_Disconnect (); - Host_ShutdownServer(false); + Host_ShutdownServer(qfalse); Sys_Quit (); } @@ -161,13 +161,13 @@ void Host_Noclip_f (void) if (sv_player->v.movetype != MOVETYPE_NOCLIP) { - noclip_anglehack = true; + noclip_anglehack = qtrue; sv_player->v.movetype = MOVETYPE_NOCLIP; SV_ClientPrintf ("noclip ON\n"); } else { - noclip_anglehack = false; + noclip_anglehack = qfalse; sv_player->v.movetype = MOVETYPE_WALK; SV_ClientPrintf ("noclip OFF\n"); } @@ -264,7 +264,7 @@ void Host_Map_f (void) cls.demonum = -1; // stop demo loop in case this fails CL_Disconnect (); - Host_ShutdownServer(false); + Host_ShutdownServer(qfalse); key_dest = key_game; // remove console or menu SCR_BeginLoadingPlaque (); @@ -633,8 +633,8 @@ void Host_Loadgame_f (void) Con_Printf ("Couldn't load map\n"); return; } - sv.paused = true; // pause until all clients connect - sv.loadgame = true; + sv.paused = qtrue; // pause until all clients connect + sv.loadgame = qtrue; // load the light styles @@ -680,12 +680,12 @@ void Host_Loadgame_f (void) ent = EDICT_NUM(entnum); memset (&ent->v, 0, progs->entityfields * 4); - ent->free = false; + ent->free = qfalse; ED_ParseEdict (start, ent); // link it into the bsp tree if (!ent->free) - SV_LinkEdict (ent, false); + SV_LinkEdict (ent, qfalse); } entnum++; @@ -843,12 +843,12 @@ int LoadGamestate(char *level, char *startspot) ent = EDICT_NUM(entnum); memset (&ent->v, 0, progs->entityfields * 4); - ent->free = false; + ent->free = qfalse; ED_ParseEdict (start, ent); // link it into the bsp tree if (!ent->free) - SV_LinkEdict (ent, false); + SV_LinkEdict (ent, qfalse); } // sv.num_edicts = entnum; @@ -971,13 +971,13 @@ void Host_Please_f (void) cl = &svs.clients[j]; 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.movetype = MOVETYPE_WALK; - noclip_anglehack = false; + noclip_anglehack = qfalse; } else - cl->privileged = true; + cl->privileged = qtrue; } if (Cmd_Argc () != 2) @@ -991,13 +991,13 @@ void Host_Please_f (void) { 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.movetype = MOVETYPE_WALK; - noclip_anglehack = false; + noclip_anglehack = qfalse; } else - cl->privileged = true; + cl->privileged = qtrue; break; } } @@ -1012,14 +1012,14 @@ void Host_Say(qboolean teamonly) int j; char *p; unsigned char text[64]; - qboolean fromServer = false; + qboolean fromServer = qfalse; if (cmd_source == src_command) { if (cls.state == ca_dedicated) { - fromServer = true; - teamonly = false; + fromServer = qtrue; + teamonly = qfalse; } else { @@ -1071,13 +1071,13 @@ void Host_Say(qboolean teamonly) void Host_Say_f(void) { - Host_Say(false); + Host_Say(qfalse); } 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); MSG_WriteByte (&host_client->message, svc_signonnum); 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) { // loaded games are fully inited allready // if this is the last client to be connected, unpause - sv.paused = false; + sv.paused = qfalse; } else { @@ -1392,7 +1392,7 @@ void Host_Spawn_f (void) MSG_WriteByte (&host_client->message, svc_signonnum); MSG_WriteByte (&host_client->message, 3); - host_client->sendsignon = true; + host_client->sendsignon = qtrue; } /* @@ -1408,7 +1408,7 @@ void Host_Begin_f (void) return; } - host_client->spawned = true; + host_client->spawned = qtrue; } //=========================================================================== @@ -1427,7 +1427,7 @@ void Host_Kick_f (void) char *message = NULL; client_t *save; int i; - qboolean byNumber = false; + qboolean byNumber = qfalse; if (cmd_source == src_command) { @@ -1450,7 +1450,7 @@ void Host_Kick_f (void) if (!svs.clients[i].active) return; host_client = &svs.clients[i]; - byNumber = true; + byNumber = qtrue; } else { @@ -1494,7 +1494,7 @@ void Host_Kick_f (void) SV_ClientPrintf ("Kicked by %s: %s\n", who, message); else SV_ClientPrintf ("Kicked by %s\n", who); - SV_DropClient (false); + SV_DropClient (qfalse); } host_client = save; @@ -1696,7 +1696,7 @@ void Host_Viewmodel_f (void) if (!e) return; - m = Mod_ForName (Cmd_Argv(1), false); + m = Mod_ForName (Cmd_Argv(1), qfalse); if (!m) { Con_Printf ("Can't load %s\n", Cmd_Argv(1)); diff --git a/src/keys.c b/src/keys.c index 6e48ad4..2d55ae3 100644 --- a/src/keys.c +++ b/src/keys.c @@ -29,7 +29,7 @@ key up events are sent even if in console mode #define MAXCMDLINE 256 char key_lines[32][MAXCMDLINE]; int key_linepos; -int shift_down=false; +int shift_down=qfalse; int key_lastpress; int edit_line=0; @@ -40,8 +40,8 @@ keydest_t key_dest; int key_count; // incremented every key event char *keybindings[256]; -qboolean consolekeys[256]; // if true, can't be rebound while in console -qboolean menubound[256]; // if true, can't be rebound while in menu +qboolean consolekeys[256]; // if qtrue, can't be rebound while in console +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 key_repeats[256]; // if > 1, it is autorepeating qboolean keydown[256]; @@ -277,7 +277,7 @@ void Key_Console (int key) //============================================================================ char chat_buffer[32]; -qboolean team_message = false; +qboolean team_message = qfalse; void Key_Message (int key) { @@ -532,21 +532,21 @@ void Key_Init (void) // init ascii characters in console mode // for (i=32 ; i<128 ; i++) - consolekeys[i] = true; - consolekeys[K_ENTER] = true; - consolekeys[K_TAB] = true; - consolekeys[K_LEFTARROW] = true; - consolekeys[K_RIGHTARROW] = true; - consolekeys[K_UPARROW] = true; - consolekeys[K_DOWNARROW] = true; - consolekeys[K_BACKSPACE] = true; - consolekeys[K_PGUP] = true; - consolekeys[K_PGDN] = true; - consolekeys[K_SHIFT] = true; - consolekeys[K_MWHEELUP] = true; - consolekeys[K_MWHEELDOWN] = true; - consolekeys['`'] = false; - consolekeys['~'] = false; + consolekeys[i] = qtrue; + consolekeys[K_ENTER] = qtrue; + consolekeys[K_TAB] = qtrue; + consolekeys[K_LEFTARROW] = qtrue; + consolekeys[K_RIGHTARROW] = qtrue; + consolekeys[K_UPARROW] = qtrue; + consolekeys[K_DOWNARROW] = qtrue; + consolekeys[K_BACKSPACE] = qtrue; + consolekeys[K_PGUP] = qtrue; + consolekeys[K_PGDN] = qtrue; + consolekeys[K_SHIFT] = qtrue; + consolekeys[K_MWHEELUP] = qtrue; + consolekeys[K_MWHEELDOWN] = qtrue; + consolekeys['`'] = qfalse; + consolekeys['~'] = qfalse; for (i=0 ; i<256 ; i++) keyshift[i] = i; @@ -574,9 +574,9 @@ void Key_Init (void) keyshift['`'] = '~'; keyshift['\\'] = '|'; - menubound[K_ESCAPE] = true; + menubound[K_ESCAPE] = qtrue; for (i=0 ; i<12 ; i++) - menubound[K_F1+i] = true; + menubound[K_F1+i] = qtrue; // // register our functions @@ -752,7 +752,7 @@ void Key_ClearStates (void) for (i=0 ; i<256 ; i++) { - keydown[i] = false; + keydown[i] = qfalse; key_repeats[i] = 0; } } diff --git a/src/menu.c b/src/menu.c index 76e48f0..7488d73 100644 --- a/src/menu.c +++ b/src/menu.c @@ -240,7 +240,7 @@ M_ToggleMenu_f */ void M_ToggleMenu_f (void) { - m_entersound = true; + m_entersound = qtrue; if (key_dest == key_menu) { @@ -280,7 +280,7 @@ void M_Menu_Main_f (void) } key_dest = key_menu; m_state = m_main; - m_entersound = true; + m_entersound = qtrue; } @@ -325,7 +325,7 @@ void M_Main_Key (int key) break; case K_ENTER: - m_entersound = true; + m_entersound = qtrue; switch (m_main_cursor) { @@ -363,7 +363,7 @@ void M_Menu_SinglePlayer_f (void) { key_dest = key_menu; m_state = m_singleplayer; - m_entersound = true; + m_entersound = qtrue; } @@ -404,7 +404,7 @@ void M_SinglePlayer_Key (int key) break; case K_ENTER: - m_entersound = true; + m_entersound = qtrue; switch (m_singleplayer_cursor) { @@ -449,7 +449,7 @@ void M_ScanSaves (void) for (i=0 ; i> 4; @@ -796,7 +796,7 @@ forward: Cvar_Set("hostname", setup_hostname); if (setup_top != setup_oldtop || setup_bottom != setup_oldbottom) Cbuf_AddText( va ("color %i %i\n", setup_top, setup_bottom) ); - m_entersound = true; + m_entersound = qtrue; M_Menu_MultiPlayer_f (); break; @@ -882,7 +882,7 @@ void M_Menu_Net_f (void) { key_dest = key_menu; m_state = m_net; - m_entersound = true; + m_entersound = qtrue; m_net_items = 4; if (m_net_cursor >= m_net_items) @@ -993,7 +993,7 @@ again: break; case K_ENTER: - m_entersound = true; + m_entersound = qtrue; switch (m_net_cursor) { @@ -1046,7 +1046,7 @@ void M_Menu_Options_f (void) { key_dest = key_menu; m_state = m_options; - m_entersound = true; + m_entersound = qtrue; #ifdef WINQUAKE if ((options_cursor == 13) && (modestate != MS_WINDOWED)) @@ -1241,7 +1241,7 @@ void M_Options_Key (int k) break; case K_ENTER: - m_entersound = true; + m_entersound = qtrue; switch (options_cursor) { case 0: @@ -1339,7 +1339,7 @@ void M_Menu_Keys_f (void) { key_dest = key_menu; 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"); if (k == K_ESCAPE) { - bind_grab = false; + bind_grab = qfalse; } else if (k != '`') { @@ -1457,7 +1457,7 @@ void M_Keys_Key (int k) Cbuf_InsertText (cmd); } - bind_grab = false; + bind_grab = qfalse; return; } @@ -1488,7 +1488,7 @@ void M_Keys_Key (int k) S_LocalSound ("misc/menu2.wav"); if (keys[1] != -1) M_UnbindCommand (bindnames[keys_cursor][0]); - bind_grab = true; + bind_grab = qtrue; break; case K_BACKSPACE: // delete bindings @@ -1506,7 +1506,7 @@ void M_Menu_Video_f (void) { key_dest = key_menu; m_state = m_video; - m_entersound = true; + m_entersound = qtrue; } @@ -1532,7 +1532,7 @@ void M_Menu_Help_f (void) { key_dest = key_menu; m_state = m_help; - m_entersound = true; + m_entersound = qtrue; help_page = 0; } @@ -1554,14 +1554,14 @@ void M_Help_Key (int key) case K_UPARROW: case K_RIGHTARROW: - m_entersound = true; + m_entersound = qtrue; if (++help_page >= NUM_HELP_PAGES) help_page = 0; break; case K_DOWNARROW: case K_LEFTARROW: - m_entersound = true; + m_entersound = qtrue; if (--help_page < 0) help_page = NUM_HELP_PAGES-1; break; @@ -1587,7 +1587,7 @@ char *quitMessage [] = " Milord, methinks that ", " thou art a lowly ", - " quitter. Is this true? ", + " quitter. Is this qtrue? ", " ", " Do I need to bust your ", @@ -1630,7 +1630,7 @@ void M_Menu_Quit_f (void) key_dest = key_menu; m_quit_prevstate = m_state; m_state = m_quit; - m_entersound = true; + m_entersound = qtrue; msgNumber = rand()&7; } @@ -1645,7 +1645,7 @@ void M_Quit_Key (int key) if (wasInMenus) { m_state = m_quit_prevstate; - m_entersound = true; + m_entersound = qtrue; } else { @@ -1672,7 +1672,7 @@ void M_Quit_Draw (void) if (wasInMenus) { m_state = m_quit_prevstate; - m_recursiveDraw = true; + m_recursiveDraw = qtrue; M_Draw (); m_state = m_quit; } @@ -1735,7 +1735,7 @@ void M_Menu_SerialConfig_f (void) key_dest = key_menu; m_state = m_serialconfig; - m_entersound = true; + m_entersound = qtrue; if (JoiningGame && SerialConfig) serialConfig_cursor = 4; else @@ -1762,7 +1762,7 @@ void M_Menu_SerialConfig_f (void) n = 5; serialConfig_baud = n; - m_return_onerror = false; + m_return_onerror = qfalse; m_return_reason[0] = 0; } @@ -1925,7 +1925,7 @@ forward: if (serialConfig_cursor < 3) goto forward; - m_entersound = true; + m_entersound = qtrue; if (serialConfig_cursor == 3) { @@ -1953,7 +1953,7 @@ forward: } m_return_state = m_state; - m_return_onerror = true; + m_return_onerror = qtrue; key_dest = key_game; m_state = m_none; @@ -2014,7 +2014,7 @@ void M_Menu_ModemConfig_f (void) { key_dest = key_menu; m_state = m_modemconfig; - m_entersound = true; + m_entersound = qtrue; (*GetModemConfig) (0, &modemConfig_dialing, modemConfig_clear, modemConfig_init, modemConfig_hangup); } @@ -2103,13 +2103,13 @@ void M_ModemConfig_Key (int key) modemConfig_dialing = 'T'; else modemConfig_dialing = 'P'; - m_entersound = true; + m_entersound = qtrue; } if (modemConfig_cursor == 4) { (*SetModemConfig) (0, va ("%c", modemConfig_dialing), modemConfig_clear, modemConfig_init, modemConfig_hangup); - m_entersound = true; + m_entersound = qtrue; M_Menu_SerialConfig_f (); } break; @@ -2185,7 +2185,7 @@ void M_Menu_LanConfig_f (void) { key_dest = key_menu; m_state = m_lanconfig; - m_entersound = true; + m_entersound = qtrue; if (lanConfig_cursor == -1) { if (JoiningGame && TCPIPConfig) @@ -2198,7 +2198,7 @@ void M_Menu_LanConfig_f (void) lanConfig_port = DEFAULTnet_hostport; sprintf(lanConfig_portname, "%u", lanConfig_port); - m_return_onerror = false; + m_return_onerror = qfalse; m_return_reason[0] = 0; } @@ -2290,7 +2290,7 @@ void M_LanConfig_Key (int key) if (lanConfig_cursor == 0) break; - m_entersound = true; + m_entersound = qtrue; M_ConfigureNetSubsystem (); @@ -2308,7 +2308,7 @@ void M_LanConfig_Key (int key) if (lanConfig_cursor == 2) { m_return_state = m_state; - m_return_onerror = true; + m_return_onerror = qtrue; key_dest = key_game; m_state = m_none; Cbuf_AddText ( va ("connect \"%s\"\n", lanConfig_joinname) ); @@ -2522,14 +2522,14 @@ episode_t rogueepisodes[] = int startepisode; int startlevel; int maxplayers; -qboolean m_serverInfoMessage = false; +qboolean m_serverInfoMessage = qfalse; double m_serverInfoMessageTime; void M_Menu_GameOptions_f (void) { key_dest = key_menu; m_state = m_gameoptions; - m_entersound = true; + m_entersound = qtrue; if (maxplayers == 0) maxplayers = svs.maxclients; if (maxplayers < 2) @@ -2660,7 +2660,7 @@ void M_GameOptions_Draw (void) } else { - m_serverInfoMessage = false; + m_serverInfoMessage = qfalse; } } } @@ -2677,7 +2677,7 @@ void M_NetStart_Change (int dir) if (maxplayers > svs.maxclientslimit) { maxplayers = svs.maxclientslimit; - m_serverInfoMessage = true; + m_serverInfoMessage = qtrue; m_serverInfoMessageTime = realtime; } if (maxplayers < 2) @@ -2832,17 +2832,17 @@ void M_GameOptions_Key (int key) //============================================================================= /* SEARCH MENU */ -qboolean searchComplete = false; +qboolean searchComplete = qfalse; double searchCompleteTime; void M_Menu_Search_f (void) { key_dest = key_menu; m_state = m_search; - m_entersound = false; - slistSilent = true; - slistLocal = false; - searchComplete = false; + m_entersound = qfalse; + slistSilent = qtrue; + slistLocal = qfalse; + searchComplete = qfalse; NET_Slist_f(); } @@ -2867,7 +2867,7 @@ void M_Search_Draw (void) if (! searchComplete) { - searchComplete = true; + searchComplete = qtrue; searchCompleteTime = realtime; } @@ -2899,11 +2899,11 @@ void M_Menu_ServerList_f (void) { key_dest = key_menu; m_state = m_slist; - m_entersound = true; + m_entersound = qtrue; slist_cursor = 0; - m_return_onerror = false; + m_return_onerror = qfalse; 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)); } } - slist_sorted = true; + slist_sorted = qtrue; } p = Draw_CachePic ("gfx/p_multi.lmp"); @@ -2979,8 +2979,8 @@ void M_ServerList_Key (int k) case K_ENTER: S_LocalSound ("misc/menu2.wav"); m_return_state = m_state; - m_return_onerror = true; - slist_sorted = false; + m_return_onerror = qtrue; + slist_sorted = qfalse; key_dest = key_game; m_state = m_none; Cbuf_AddText ( va ("connect \"%s\"\n", hostcache[slist_cursor].cname) ); @@ -3037,7 +3037,7 @@ void M_Draw (void) } else { - m_recursiveDraw = false; + m_recursiveDraw = qfalse; } switch (m_state) @@ -3121,7 +3121,7 @@ void M_Draw (void) if (m_entersound) { S_LocalSound ("misc/menu2.wav"); - m_entersound = false; + m_entersound = qfalse; } VID_UnlockBuffer (); diff --git a/src/net_bsd.c b/src/net_bsd.c index 79d62f8..4831885 100644 --- a/src/net_bsd.c +++ b/src/net_bsd.c @@ -26,7 +26,7 @@ net_driver_t net_drivers[MAX_NET_DRIVERS] = { { "Loopback", - false, + qfalse, Loop_Init, Loop_Listen, Loop_SearchForHosts, @@ -43,7 +43,7 @@ net_driver_t net_drivers[MAX_NET_DRIVERS] = , { "Datagram", - false, + qfalse, Datagram_Init, Datagram_Listen, Datagram_SearchForHosts, @@ -67,7 +67,7 @@ net_landriver_t net_landrivers[MAX_NET_DRIVERS] = { { "UDP", - false, + qfalse, 0, UDP_Init, UDP_Shutdown, diff --git a/src/net_dgrm.c b/src/net_dgrm.c index 095e212..0985eea 100644 --- a/src/net_dgrm.c +++ b/src/net_dgrm.c @@ -171,8 +171,8 @@ int Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data) if (data->cursize > NET_MAXMESSAGE) Sys_Error("Datagram_SendMessage: message too big %u\n", data->cursize); - if (sock->canSend == false) - Sys_Error("SendMessage: called with canSend == false\n"); + if (sock->canSend == qfalse) + Sys_Error("SendMessage: called with canSend == qfalse\n"); #endif 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++); Q_memcpy (packetBuffer.data, sock->sendMessage, dataLen); - sock->canSend = false; + sock->canSend = qfalse; if (sfunc.Write (sock->socket, (byte *)&packetBuffer, packetLen, &sock->addr) == -1) return -1; @@ -227,7 +227,7 @@ int SendMessageNext (qsocket_t *sock) packetBuffer.sequence = BigLong(sock->sendSequence++); Q_memcpy (packetBuffer.data, sock->sendMessage, dataLen); - sock->sendNext = false; + sock->sendNext = qfalse; if (sfunc.Write (sock->socket, (byte *)&packetBuffer, packetLen, &sock->addr) == -1) return -1; @@ -260,7 +260,7 @@ int ReSendMessage (qsocket_t *sock) packetBuffer.sequence = BigLong(sock->sendSequence - 1); Q_memcpy (packetBuffer.data, sock->sendMessage, dataLen); - sock->sendNext = false; + sock->sendNext = qfalse; if (sfunc.Write (sock->socket, (byte *)&packetBuffer, packetLen, &sock->addr) == -1) return -1; @@ -282,7 +282,7 @@ qboolean Datagram_CanSendMessage (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) { Q_memcpy(sock->sendMessage, sock->sendMessage+MAX_DATAGRAM, sock->sendMessageLength); - sock->sendNext = true; + sock->sendNext = qtrue; } else { sock->sendMessageLength = 0; - sock->canSend = true; + sock->canSend = qtrue; } continue; } @@ -511,7 +511,7 @@ void NET_Stats_f (void) } -static qboolean testInProgress = false; +static qboolean testInProgress = qfalse; static int testPollCount; static int testDriver; static int testSocket; @@ -572,7 +572,7 @@ static void Test_Poll(void) else { dfunc.CloseSocket(testSocket); - testInProgress = false; + testInProgress = qfalse; } } @@ -621,7 +621,7 @@ JustDoIt: if (testSocket == -1) return; - testInProgress = true; + testInProgress = qtrue; testPollCount = 20; testDriver = net_landriverlevel; @@ -640,7 +640,7 @@ JustDoIt: } -static qboolean test2InProgress = false; +static qboolean test2InProgress = qfalse; static int test2Driver; static int test2Socket; @@ -701,7 +701,7 @@ Error: Con_Printf("Unexpected repsonse to Rule Info request\n"); Done: dfunc.CloseSocket(test2Socket); - test2InProgress = false; + test2InProgress = qfalse; return; } @@ -748,7 +748,7 @@ JustDoIt: if (test2Socket == -1) return; - test2InProgress = true; + test2InProgress = qtrue; test2Driver = net_landriverlevel; SZ_Clear(&net_message); @@ -783,7 +783,7 @@ int Datagram_Init (void) csock = net_landrivers[i].Init (); if (csock == -1) continue; - net_landrivers[i].initialized = true; + net_landrivers[i].initialized = qtrue; net_landrivers[i].controlSock = csock; } @@ -809,7 +809,7 @@ void Datagram_Shutdown (void) if (net_landrivers[i].initialized) { 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; } - m_return_onerror = false; + m_return_onerror = qfalse; return sock; ErrorReturn: @@ -1377,7 +1377,7 @@ ErrorReturn2: { key_dest = key_menu; m_state = m_return_state; - m_return_onerror = false; + m_return_onerror = qfalse; } return NULL; } diff --git a/src/net_loop.c b/src/net_loop.c index 35aa370..d3252bb 100644 --- a/src/net_loop.c +++ b/src/net_loop.c @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" #include "net_loop.h" -qboolean localconnectpending = false; +qboolean localconnectpending = qfalse; qsocket_t *loop_client = NULL; qsocket_t *loop_server = NULL; @@ -67,7 +67,7 @@ qsocket_t *Loop_Connect (char *host) if (Q_strcmp(host,"local") != 0) return NULL; - localconnectpending = true; + localconnectpending = qtrue; if (!loop_client) { @@ -80,7 +80,7 @@ qsocket_t *Loop_Connect (char *host) } loop_client->receiveMessageLength = 0; loop_client->sendMessageLength = 0; - loop_client->canSend = true; + loop_client->canSend = qtrue; if (!loop_server) { @@ -93,7 +93,7 @@ qsocket_t *Loop_Connect (char *host) } loop_server->receiveMessageLength = 0; loop_server->sendMessageLength = 0; - loop_server->canSend = true; + loop_server->canSend = qtrue; loop_client->driverdata = (void *)loop_server; loop_server->driverdata = (void *)loop_client; @@ -107,13 +107,13 @@ qsocket_t *Loop_CheckNewConnections (void) if (!localconnectpending) return NULL; - localconnectpending = false; + localconnectpending = qfalse; loop_server->sendMessageLength = 0; loop_server->receiveMessageLength = 0; - loop_server->canSend = true; + loop_server->canSend = qtrue; loop_client->sendMessageLength = 0; loop_client->receiveMessageLength = 0; - loop_client->canSend = true; + loop_client->canSend = qtrue; return loop_server; } @@ -145,7 +145,7 @@ int Loop_GetMessage (qsocket_t *sock) Q_memcpy(sock->receiveMessage, &sock->receiveMessage[length], sock->receiveMessageLength); if (sock->driverdata && ret == 1) - ((qsocket_t *)sock->driverdata)->canSend = true; + ((qsocket_t *)sock->driverdata)->canSend = qtrue; return ret; } @@ -180,7 +180,7 @@ int Loop_SendMessage (qsocket_t *sock, sizebuf_t *data) Q_memcpy(buffer, data->data, data->cursize); *bufferLength = IntAlign(*bufferLength + data->cursize + 4); - sock->canSend = false; + sock->canSend = qfalse; return 1; } @@ -220,14 +220,14 @@ int Loop_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data) qboolean Loop_CanSendMessage (qsocket_t *sock) { if (!sock->driverdata) - return false; + return qfalse; return sock->canSend; } 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; sock->receiveMessageLength = 0; sock->sendMessageLength = 0; - sock->canSend = true; + sock->canSend = qtrue; if (sock == loop_client) loop_client = NULL; else diff --git a/src/net_main.c b/src/net_main.c index 5f5d2cf..26b03b6 100644 --- a/src/net_main.c +++ b/src/net_main.c @@ -26,9 +26,9 @@ qsocket_t *net_activeSockets = NULL; qsocket_t *net_freeSockets = NULL; int net_numsockets = 0; -qboolean serialAvailable = false; -qboolean ipxAvailable = false; -qboolean tcpipAvailable = false; +qboolean serialAvailable = qfalse; +qboolean ipxAvailable = qfalse; +qboolean tcpipAvailable = qfalse; int net_hostport; 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 (*SetModemConfig) (int portNumber, char *dialType, char *clear, char *init, char *hangup); -static qboolean listening = false; +static qboolean listening = qfalse; -qboolean slistInProgress = false; -qboolean slistSilent = false; -qboolean slistLocal = true; +qboolean slistInProgress = qfalse; +qboolean slistSilent = qfalse; +qboolean slistLocal = qtrue; static double slistStartTime; static int slistLastShown; @@ -66,22 +66,22 @@ int unreliableMessagesReceived = 0; cvar_t net_messagetimeout = {"net_messagetimeout","300"}; cvar_t hostname = {"hostname", "UNNAMED"}; -qboolean configRestored = false; -cvar_t config_com_port = {"_config_com_port", "0x3f8", true}; -cvar_t config_com_irq = {"_config_com_irq", "4", true}; -cvar_t config_com_baud = {"_config_com_baud", "57600", true}; -cvar_t config_com_modem = {"_config_com_modem", "1", true}; -cvar_t config_modem_dialtype = {"_config_modem_dialtype", "T", true}; -cvar_t config_modem_clear = {"_config_modem_clear", "ATZ", true}; -cvar_t config_modem_init = {"_config_modem_init", "", true}; -cvar_t config_modem_hangup = {"_config_modem_hangup", "AT H", true}; +qboolean configRestored = qfalse; +cvar_t config_com_port = {"_config_com_port", "0x3f8", qtrue}; +cvar_t config_com_irq = {"_config_com_irq", "4", qtrue}; +cvar_t config_com_baud = {"_config_com_baud", "57600", qtrue}; +cvar_t config_com_modem = {"_config_com_modem", "1", qtrue}; +cvar_t config_modem_dialtype = {"_config_modem_dialtype", "T", qtrue}; +cvar_t config_modem_clear = {"_config_modem_clear", "ATZ", qtrue}; +cvar_t config_modem_init = {"_config_modem_init", "", qtrue}; +cvar_t config_modem_hangup = {"_config_modem_hangup", "AT H", qtrue}; #ifdef IDGODS cvar_t idgods = {"idgods", "0"}; #endif int vcrFile = -1; -qboolean recording = false; +qboolean recording = qfalse; // these two macros are to make the code more readable #define sfunc net_drivers[sock->driver] @@ -125,14 +125,14 @@ qsocket_t *NET_NewQSocket (void) sock->next = net_activeSockets; net_activeSockets = sock; - sock->disconnected = false; + sock->disconnected = qfalse; sock->connecttime = net_time; Q_strcpy (sock->address,"UNSET ADDRESS"); sock->driver = net_driverlevel; sock->socket = 0; sock->driverdata = NULL; - sock->canSend = true; - sock->sendNext = false; + sock->canSend = qtrue; + sock->sendNext = qfalse; sock->lastMessageTime = net_time; sock->ackSequence = 0; sock->sendSequence = 0; @@ -168,7 +168,7 @@ void NET_FreeQSocket(qsocket_t *sock) // add it to free list sock->next = net_freeSockets; net_freeSockets = sock; - sock->disconnected = true; + sock->disconnected = qtrue; } @@ -180,11 +180,11 @@ static void NET_Listen_f (void) return; } - listening = Q_atoi(Cmd_Argv(1)) ? true : false; + listening = Q_atoi(Cmd_Argv(1)) ? qtrue : qfalse; for (net_driverlevel=0 ; net_driverleveldisconnected) - return false; + return qfalse; SetNetTime(); @@ -736,18 +736,18 @@ int NET_SendToAll(sizebuf_t *data, int blocktime) if (host_client->netconnection->driver == 0) { NET_SendMessage(host_client->netconnection, data); - state1[i] = true; - state2[i] = true; + state1[i] = qtrue; + state2[i] = qtrue; continue; } count++; - state1[i] = false; - state2[i] = false; + state1[i] = qfalse; + state2[i] = qfalse; } else { - state1[i] = true; - state2[i] = true; + state1[i] = qtrue; + state2[i] = qtrue; } } @@ -761,7 +761,7 @@ int NET_SendToAll(sizebuf_t *data, int blocktime) { if (NET_CanSendMessage (host_client->netconnection)) { - state1[i] = true; + state1[i] = qtrue; NET_SendMessage(host_client->netconnection, data); } else @@ -776,7 +776,7 @@ int NET_SendToAll(sizebuf_t *data, int blocktime) { if (NET_CanSendMessage (host_client->netconnection)) { - state2[i] = true; + state2[i] = qtrue; } else { @@ -814,7 +814,7 @@ void NET_Init (void) } if (COM_CheckParm("-record")) - recording = true; + recording = qtrue; i = COM_CheckParm ("-port"); if (!i) @@ -832,7 +832,7 @@ void NET_Init (void) net_hostport = DEFAULTnet_hostport; if (COM_CheckParm("-listen") || cls.state == ca_dedicated) - listening = true; + listening = qtrue; net_numsockets = svs.maxclientslimit; if (cls.state != ca_dedicated) net_numsockets++; @@ -844,7 +844,7 @@ void NET_Init (void) s = (qsocket_t *)Hunk_AllocName(sizeof(qsocket_t), "qsocket"); s->next = net_freeSockets; net_freeSockets = s; - s->disconnected = true; + s->disconnected = qtrue; } // allocate space for network message buffer @@ -875,10 +875,10 @@ void NET_Init (void) controlSocket = net_drivers[net_driverlevel].Init(); if (controlSocket == -1) continue; - net_drivers[net_driverlevel].initialized = true; + net_drivers[net_driverlevel].initialized = qtrue; net_drivers[net_driverlevel].controlSock = controlSocket; if (listening) - net_drivers[net_driverlevel].Listen (true); + net_drivers[net_driverlevel].Listen (qtrue); } if (*my_ipx_address) @@ -907,10 +907,10 @@ void NET_Shutdown (void) // 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].initialized = false; + net_drivers[net_driverlevel].initialized = qfalse; } } @@ -934,13 +934,13 @@ void NET_Poll(void) if (serialAvailable) { if (config_com_modem.value == 1.0) - useModem = true; + useModem = qtrue; else - useModem = false; + useModem = qfalse; 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); } - configRestored = true; + configRestored = qtrue; } SetNetTime(); @@ -985,13 +985,13 @@ void SchedulePollProcedure(PollProcedure *proc, double timeOffset) qboolean IsID(struct qsockaddr *addr) { if (idgods.value == 0.0) - return false; + return qfalse; if (addr->sa_family != 2) - return false; + return qfalse; if ((BigLong(*(int *)&addr->sa_data[2]) & 0xffffff00) == IDNET) - return true; - return false; + return qtrue; + return qfalse; } #endif diff --git a/src/net_udp.c b/src/net_udp.c index bf34fe0..86ca367 100644 --- a/src/net_udp.c +++ b/src/net_udp.c @@ -102,7 +102,7 @@ int UDP_Init (void) *colon = 0; Con_Printf("UDP Initialized\n"); - tcpipAvailable = true; + tcpipAvailable = qtrue; return net_controlsocket; } @@ -111,7 +111,7 @@ int UDP_Init (void) void UDP_Shutdown (void) { - UDP_Listen (false); + UDP_Listen (qfalse); UDP_CloseSocket (net_controlsocket); } @@ -142,16 +142,16 @@ int UDP_OpenSocket (int port) { int newsocket; struct sockaddr_in address; - qboolean _true = true; + qboolean _qtrue = qtrue; if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) return -1; #ifdef _WIN32 - if (ioctl (newsocket, FIONBIO, (u_long*)&_true) == -1) + if (ioctl (newsocket, FIONBIO, (u_long*)&_qtrue) == -1) goto ErrorReturn; #else - if (ioctl (newsocket, FIONBIO, (char *)&_true) == -1) + if (ioctl (newsocket, FIONBIO, (char *)&_qtrue) == -1) goto ErrorReturn; #endif diff --git a/src/pr_cmds.c b/src/pr_cmds.c index 82b214c..967b477 100644 --- a/src/pr_cmds.c +++ b/src/pr_cmds.c @@ -125,7 +125,7 @@ void PF_setorigin (void) e = G_EDICT(OFS_PARM0); org = G_VECTOR(OFS_PARM1); 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]) PR_RunError ("backwards mins/maxs"); - rotate = false; // FIXME: implement rotation properly again + rotate = qfalse; // FIXME: implement rotation properly again if (!rotate) { @@ -200,7 +200,7 @@ void SetMinMaxSize (edict_t *e, float *min, float *max, qboolean rotate) VectorCopy (rmax, e->v.maxs); 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); min = G_VECTOR(OFS_PARM1); 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.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) - SetMinMaxSize (e, mod->mins, mod->maxs, true); + SetMinMaxSize (e, mod->mins, mod->maxs, qtrue); 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 -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. FIXME: make work... scalar checkpos (entity, vector) @@ -1106,7 +1106,7 @@ void PF_precache_model (void) if (!sv.model_precache[i]) { sv.model_precache[i] = s; - sv.models[i] = Mod_ForName (s, true); + sv.models[i] = Mod_ForName (s, qtrue); return; } if (!strcmp(sv.model_precache[i], s)) @@ -1123,12 +1123,12 @@ void PF_coredump (void) void PF_traceon (void) { - pr_trace = true; + pr_trace = qtrue; } void PF_traceoff (void) { - pr_trace = false; + pr_trace = qfalse; } void PF_eprint (void) @@ -1171,7 +1171,7 @@ void PF_walkmove (void) oldf = pr_xfunction; 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 @@ -1197,14 +1197,14 @@ void PF_droptofloor (void) VectorCopy (ent->v.origin, end); 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) G_FLOAT(OFS_RETURN) = 0; else { 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.groundentity = EDICT_TO_PROG(trace.ent); G_FLOAT(OFS_RETURN) = 1; @@ -1348,7 +1348,7 @@ void PF_aim (void) // try sending a trace straight VectorCopy (pr_global_struct->v_forward, dir); 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 && (!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); if (dist < bestdist) 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) { // can shoot at this one bestdist = dist; @@ -1642,7 +1642,7 @@ void PF_changelevel (void) if (svs.changelevel_issued) return; - svs.changelevel_issued = true; + svs.changelevel_issued = qtrue; s1 = G_STRING(OFS_PARM0); s2 = G_STRING(OFS_PARM1); @@ -1657,7 +1657,7 @@ void PF_changelevel (void) // make sure we don't issue two changelevels if (svs.changelevel_issued) return; - svs.changelevel_issued = true; + svs.changelevel_issued = qtrue; s = G_STRING(OFS_PARM0); Cbuf_AddText (va("changelevel %s\n",s)); diff --git a/src/pr_edict.c b/src/pr_edict.c index a1b58b9..47e62e9 100644 --- a/src/pr_edict.c +++ b/src/pr_edict.c @@ -46,11 +46,11 @@ cvar_t scratch1 = {"scratch1", "0"}; cvar_t scratch2 = {"scratch2", "0"}; cvar_t scratch3 = {"scratch3", "0"}; cvar_t scratch4 = {"scratch4", "0"}; -cvar_t savedgamecfg = {"savedgamecfg", "0", true}; -cvar_t saved1 = {"saved1", "0", true}; -cvar_t saved2 = {"saved2", "0", true}; -cvar_t saved3 = {"saved3", "0", true}; -cvar_t saved4 = {"saved4", "0", true}; +cvar_t savedgamecfg = {"savedgamecfg", "0", qtrue}; +cvar_t saved1 = {"saved1", "0", qtrue}; +cvar_t saved2 = {"saved2", "0", qtrue}; +cvar_t saved3 = {"saved3", "0", qtrue}; +cvar_t saved4 = {"saved4", "0", qtrue}; #define MAX_FIELD_LEN 64 #define GEFV_CACHESIZE 2 @@ -104,7 +104,7 @@ Sets everything to NULL void ED_ClearEdict (edict_t *e) { 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 - ed->free = true; + ed->free = qtrue; ed->v.model = 0; ed->v.takedamage = 0; ed->v.modelindex = 0; @@ -756,7 +756,7 @@ static string_t ED_NewString (const char *string) ED_ParseEval Can parse either fields or globals -returns false if error +returns qfalse if error ============= */ 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) { Con_Printf ("Can't find field %s\n", s); - return false; + return qfalse; } *(int *)d = G_INT(def->ofs); break; @@ -813,7 +813,7 @@ qboolean ED_ParseEpair (void *base, ddef_t *key, char *s) if (!func) { Con_Printf ("Can't find function %s\n", s); - return false; + return qfalse; } *(func_t *)d = func - pr_functions; break; @@ -821,7 +821,7 @@ qboolean ED_ParseEpair (void *base, ddef_t *key, char *s) default: break; } - return true; + return qtrue; } /* @@ -841,7 +841,7 @@ char *ED_ParseEdict (char *data, edict_t *ent) char keyname[256]; int n; - init = false; + init = qfalse; // clear it if (ent != sv.edicts) // hack @@ -862,10 +862,10 @@ char *ED_ParseEdict (char *data, edict_t *ent) if (!strcmp(com_token, "angle")) { strcpy (com_token, "angles"); - anglehack = true; + anglehack = qtrue; } else - anglehack = false; + anglehack = qfalse; // FIXME: change light to _light to get rid of this hack if (!strcmp(com_token, "light")) @@ -889,7 +889,7 @@ if (!strcmp(com_token, "light")) if (com_token[0] == '}') Sys_Error ("ED_ParseEntity: closing brace without data"); - init = true; + init = qtrue; // keynames with a leading underscore are used for utility comments, // and are immediately discarded by quake @@ -915,7 +915,7 @@ sprintf (com_token, "0 %s 0", temp); } if (!init) - ent->free = true; + ent->free = qtrue; return data; } diff --git a/src/pr_exec.c b/src/pr_exec.c index e71d060..4331093 100644 --- a/src/pr_exec.c +++ b/src/pr_exec.c @@ -380,7 +380,7 @@ void PR_ExecuteProgram (func_t fnum) f = &pr_functions[fnum]; runaway = 100000; - pr_trace = false; + pr_trace = qfalse; // make a stack frame exitdepth = pr_depth; diff --git a/src/sbar.c b/src/sbar.c index be9ec9c..b5fb18c 100644 --- a/src/sbar.c +++ b/src/sbar.c @@ -76,7 +76,7 @@ void Sbar_ShowScores (void) { if (sb_showscores) return; - sb_showscores = true; + sb_showscores = qtrue; sb_updates = 0; } @@ -89,7 +89,7 @@ Tab key up */ void Sbar_DontShowScores (void) { - sb_showscores = false; + sb_showscores = qfalse; sb_updates = 0; } diff --git a/src/snd_ma.c b/src/snd_ma.c index 06309f8..6d3b51d 100644 --- a/src/snd_ma.c +++ b/src/snd_ma.c @@ -143,7 +143,7 @@ qboolean SNDDMA_Init(void) shm->channels = config.playback.channels; shm->speed = config.sampleRate; - shm->soundalive = true; + shm->soundalive = qtrue; shm->samples = sizeof(dma_buffer) / (shm->samplebits/8); shm->samplepos = 0; shm->submission_chunk = 1; diff --git a/src/sound.c b/src/sound.c index 700f4f4..4c1ce1c 100644 --- a/src/sound.c +++ b/src/sound.c @@ -37,7 +37,7 @@ int total_channels; int snd_blocked = 0; static qboolean snd_ambient = 1; -qboolean snd_initialized = false; +qboolean snd_initialized = qfalse; // pointer should go away volatile dma_t *shm = 0; @@ -64,8 +64,8 @@ int desired_bits = 16; int sound_started=0; -cvar_t bgmvolume = {"bgmvolume", "1", true}; -cvar_t volume = {"volume", "0.7", true}; +cvar_t bgmvolume = {"bgmvolume", "1", qtrue}; +cvar_t volume = {"volume", "0.7", qtrue}; cvar_t nosound = {"nosound", "0"}; 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 snd_noextraupdate = {"snd_noextraupdate", "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. // -qboolean fakedma = false; +qboolean fakedma = qfalse; int fakedma_updates = 15; void S_AmbientOff (void) { - snd_ambient = false; + snd_ambient = qfalse; } void S_AmbientOn (void) { - snd_ambient = true; + snd_ambient = qtrue; } @@ -169,7 +169,7 @@ void S_Init (void) return; if (COM_CheckParm("-simsound")) - fakedma = true; + fakedma = qtrue; Cmd_AddCommand("play", S_Play); Cmd_AddCommand("playvol", S_PlayVol); @@ -197,7 +197,7 @@ void S_Init (void) - snd_initialized = true; + snd_initialized = qtrue; S_Startup (); @@ -217,8 +217,8 @@ void S_Init (void) shm->channels = 2; shm->samples = 32768; shm->samplepos = 0; - shm->soundalive = true; - shm->gamealive = true; + shm->soundalive = qtrue; + shm->gamealive = qtrue; shm->submission_chunk = 1; 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_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) { - S_StopAllSounds (true); + S_StopAllSounds (qtrue); } void S_ClearBuffer (void) @@ -830,7 +830,7 @@ void GetSoundtime(void) { // time to chop things off to avoid 32 bit limits buffers = 0; paintedtime = fullsamples; - S_StopAllSounds (true); + S_StopAllSounds (qtrue); } } oldsamplepos = samplepos; diff --git a/src/sv_main.c b/src/sv_main.c index 5561a97..ce28972 100644 --- a/src/sv_main.c +++ b/src/sv_main.c @@ -228,8 +228,8 @@ void SV_SendServerinfo (client_t *client) MSG_WriteByte (&client->message, svc_signonnum); MSG_WriteByte (&client->message, 1); - client->sendsignon = true; - client->spawned = false; // need prespawn, spawn, etc + client->sendsignon = qtrue; + client->spawned = qfalse; // need prespawn, spawn, etc } /* @@ -266,17 +266,17 @@ void SV_ConnectClient (int clientnum) client->netconnection = netconnection; strcpy (client->name, "unconnected"); - client->active = true; - client->spawned = false; + client->active = qtrue; + client->spawned = qfalse; client->edict = ent; client->message.data = 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 client->privileged = IsID(&client->netconnection->addr); #else - client->privileged = false; + client->privileged = qfalse; #endif if (sv.loadgame) @@ -741,11 +741,11 @@ qboolean SV_SendClientDatagram (client_t *client) // send the datagram if (NET_SendUnreliableMessage (client->netconnection, &msg) == -1) { - SV_DropClient (true);// if the message couldn't send, kick off - return false; + SV_DropClient (qtrue);// if the message couldn't send, kick off + return qfalse; } - return true; + return qtrue; } /* @@ -807,7 +807,7 @@ void SV_SendNop (client_t *client) MSG_WriteChar (&msg, svc_nop); 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; } @@ -854,8 +854,8 @@ void SV_SendClientMessages (void) // changes level if (host_client->message.overflowed) { - SV_DropClient (true); - host_client->message.overflowed = false; + SV_DropClient (qtrue); + host_client->message.overflowed = qfalse; continue; } @@ -868,15 +868,15 @@ void SV_SendClientMessages (void) } if (host_client->dropasap) - SV_DropClient (false); // went to another level + SV_DropClient (qfalse); // went to another level else { if (NET_SendMessage (host_client->netconnection , &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); 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; 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 @@ -1121,17 +1121,17 @@ void SV_SpawnServer (char *server) } sv.state = ss_loading; - sv.paused = false; + sv.paused = qfalse; sv.time = 1.0; strcpy (sv.name, 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) { Con_Printf ("Couldn't spawn server %s\n", sv.modelname); - sv.active = false; + sv.active = qfalse; return; } sv.models[1] = sv.worldmodel; @@ -1148,7 +1148,7 @@ void SV_SpawnServer (char *server) for (i=1 ; inumsubmodels ; 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); memset (&ent->v, 0, progs->entityfields * 4); - ent->free = false; + ent->free = qfalse; ent->v.model = PR_SetEngineString(sv.worldmodel->name); ent->v.modelindex = 1; // world model ent->v.solid = SOLID_BSP; @@ -1177,7 +1177,7 @@ void SV_SpawnServer (char *server) ED_LoadFromFile (sv.worldmodel->entities); - sv.active = true; + sv.active = qtrue; // all setup is completed, any further precache statements are errors sv.state = ss_active; diff --git a/src/sv_move.c b/src/sv_move.c index a0078b9..b7a6e59 100644 --- a/src/sv_move.c +++ b/src/sv_move.c @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ============= 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. ============= @@ -58,7 +58,7 @@ qboolean SV_CheckBottom (edict_t *ent) } c_yes++; - return true; // we got out easy + return qtrue; // we got out easy realcheck: c_no++; @@ -71,10 +71,10 @@ realcheck: start[0] = stop[0] = (mins[0] + maxs[0])*0.5; start[1] = stop[1] = (mins[1] + maxs[1])*0.5; 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) - return false; + return qfalse; mid = bottom = trace.endpos[2]; // the corners must be within 16 of the midpoint @@ -84,16 +84,16 @@ realcheck: start[0] = stop[0] = x ? maxs[0] : mins[0]; 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) bottom = trace.endpos[2]; if (trace.fraction == 1.0 || mid - trace.endpos[2] > STEPSIZE) - return false; + return qfalse; } c_yes++; - return true; + return qtrue; } @@ -103,7 +103,7 @@ SV_movestep Called by monster program code. 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 ============= */ @@ -135,24 +135,24 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink) if (dz < 30) 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 ( ((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); if (relink) - SV_LinkEdict (ent, true); - return true; + SV_LinkEdict (ent, qtrue); + return qtrue; } if (enemy == sv.edicts) break; } - return false; + return qfalse; } // 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); 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) - return false; + return qfalse; if (trace.startsolid) { 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) - return false; + return qfalse; } 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); if (relink) - SV_LinkEdict (ent, true); + SV_LinkEdict (ent, qtrue); ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND; // 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 @@ -197,11 +197,11 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink) { // entity had floor mostly pulled out from underneath it // and is trying to correct if (relink) - SV_LinkEdict (ent, true); - return true; + SV_LinkEdict (ent, qtrue); + return qtrue; } VectorCopy (oldorg, ent->v.origin); - return false; + return qfalse; } 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 if (relink) - SV_LinkEdict (ent, true); - return true; + SV_LinkEdict (ent, qtrue); + return qtrue; } @@ -244,19 +244,19 @@ qboolean SV_StepDirection (edict_t *ent, float yaw, float dist) move[2] = 0; 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; if (delta > 45 && delta < 315) { // not turned far enough, so don't take the step VectorCopy (oldorigin, ent->v.origin); } - SV_LinkEdict (ent, true); - return true; + SV_LinkEdict (ent, qtrue); + 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++) { if (goal->v.absmin[i] > ent->v.absmax[i] + dist) - return false; + return qfalse; if (goal->v.absmax[i] < ent->v.absmin[i] - dist) - return false; + return qfalse; } - return true; + return qtrue; } /* diff --git a/src/sv_phys.c b/src/sv_phys.c index 52ebe3d..c02541b 100644 --- a/src/sv_phys.c +++ b/src/sv_phys.c @@ -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_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_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 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. -Returns false if the entity removed itself. +Returns qfalse if the entity removed itself. ============= */ qboolean SV_RunThink (edict_t *ent) @@ -129,7 +129,7 @@ qboolean SV_RunThink (edict_t *ent) thinktime = ent->v.nextthink; if (thinktime <= 0 || thinktime > sv.time + host_frametime) - return true; + return qtrue; if (thinktime < sv.time) 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++) 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) { // 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); VectorCopy (trace.endpos, ent->v.origin); - SV_LinkEdict (ent, true); + SV_LinkEdict (ent, qtrue); if (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); pusher->v.ltime += movetime; - SV_LinkEdict (pusher, false); + SV_LinkEdict (pusher, qfalse); // 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); - SV_LinkEdict (check, true); + SV_LinkEdict (check, qtrue); VectorCopy (pushorig, pusher->v.origin); - SV_LinkEdict (pusher, false); + SV_LinkEdict (pusher, qfalse); pusher->v.ltime -= movetime; // if the pusher has a "blocked" function, call it @@ -547,7 +547,7 @@ void SV_PushMove (edict_t *pusher, float movetime) for (i=0 ; iv.origin); - SV_LinkEdict (moved_edict[i], false); + SV_LinkEdict (moved_edict[i], qfalse); } return; } @@ -593,7 +593,7 @@ void SV_PushRotate (edict_t *pusher, float movetime) VectorAdd (pusher->v.angles, amove, pusher->v.angles); pusher->v.ltime += movetime; - SV_LinkEdict (pusher, false); + SV_LinkEdict (pusher, qfalse); // 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); - SV_LinkEdict (check, true); + SV_LinkEdict (check, qtrue); VectorCopy (pushorig, pusher->v.angles); - SV_LinkEdict (pusher, false); + SV_LinkEdict (pusher, qfalse); pusher->v.ltime -= movetime; // 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); 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; } @@ -776,7 +776,7 @@ void SV_CheckStuck (edict_t *ent) if (!SV_TestEntityPosition(ent)) { Con_DPrintf ("Unstuck.\n"); - SV_LinkEdict (ent, true); + SV_LinkEdict (ent, qtrue); return; } @@ -790,7 +790,7 @@ void SV_CheckStuck (edict_t *ent) if (!SV_TestEntityPosition(ent)) { Con_DPrintf ("Unstuck.\n"); - SV_LinkEdict (ent, true); + SV_LinkEdict (ent, qtrue); return; } } @@ -810,7 +810,7 @@ qboolean SV_CheckWater (edict_t *ent) vec3_t point; int cont; #ifdef QUAKE2 - int truecont; + int qtruecont; #endif point[0] = ent->v.origin[0]; @@ -823,7 +823,7 @@ qboolean SV_CheckWater (edict_t *ent) if (cont <= CONTENTS_WATER) { #ifdef QUAKE2 - truecont = SV_TruePointContents (point); + qtruecont = SV_TruePointContents (point); #endif ent->v.watertype = cont; ent->v.waterlevel = 1; @@ -838,7 +838,7 @@ qboolean SV_CheckWater (edict_t *ent) ent->v.waterlevel = 3; } #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[] = { @@ -850,7 +850,7 @@ qboolean SV_CheckWater (edict_t *ent) {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 } @@ -1123,7 +1123,7 @@ void SV_Physics_Client (edict_t *ent, int num) // // call standard player post-think // - SV_LinkEdict (ent, true); + SV_LinkEdict (ent, qtrue); pr_global_struct->time = sv.time; pr_global_struct->self = EDICT_TO_PROG(ent); @@ -1158,7 +1158,7 @@ void SV_Physics_Follow (edict_t *ent) // regular thinking SV_RunThink (ent); 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 @@ -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.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 inwater; - qboolean hitsound = false; + qboolean hitsound = qfalse; float *vel; float speed, newspeed, control; 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 (ent->v.velocity[2] < sv_gravity.value*-0.1) - hitsound = true; + hitsound = qtrue; if (!inwater) 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 (!wasonground) @@ -1473,14 +1473,14 @@ void SV_Physics_Step (edict_t *ent) if ( ! ((int)ent->v.flags & (FL_ONGROUND | FL_FLY | FL_SWIM) ) ) { if (ent->v.velocity[2] < sv_gravity.value*-0.1) - hitsound = true; + hitsound = qtrue; else - hitsound = false; + hitsound = qfalse; SV_AddGravity (ent); SV_CheckVelocity (ent); SV_FlyMove (ent, host_frametime, NULL); - SV_LinkEdict (ent, true); + SV_LinkEdict (ent, qtrue); if ( (int)ent->v.flags & FL_ONGROUND ) // just hit ground { @@ -1528,7 +1528,7 @@ void SV_Physics (void) 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) diff --git a/src/sv_user.c b/src/sv_user.c index 1163949..4261554 100644 --- a/src/sv_user.c +++ b/src/sv_user.c @@ -139,7 +139,7 @@ void SV_UserFriction (void) start[2] = origin[2] + sv_player->v.mins[2]; 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) friction = sv_friction.value*sv_edgefriction.value; @@ -164,7 +164,7 @@ void SV_UserFriction (void) 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"}; #if 0 void SV_Accelerate (vec3_t wishvel) @@ -476,7 +476,7 @@ void SV_ReadClientMove (usercmd_t *move) =================== SV_ReadClientMessage -Returns false if the client should be killed +Returns qfalse if the client should be killed =================== */ qboolean SV_ReadClientMessage (void) @@ -492,22 +492,22 @@ nextmsg: if (ret == -1) { Sys_Printf ("SV_ReadClientMessage: NET_GetMessage failed\n"); - return false; + return qfalse; } if (!ret) - return true; + return qtrue; MSG_BeginReading (); while (1) { if (!host_client->active) - return false; // a command caused an error + return qfalse; // a command caused an error if (msg_badread) { Sys_Printf ("SV_ReadClientMessage: badread\n"); - return false; + return qfalse; } cmd = MSG_ReadChar (); @@ -519,7 +519,7 @@ nextmsg: default: Sys_Printf ("SV_ReadClientMessage: unknown command char\n"); - return false; + return qfalse; case clc_nop: // Sys_Printf ("clc_nop\n"); @@ -579,7 +579,7 @@ nextmsg: case clc_disconnect: // Sys_Printf ("SV_ReadClientMessage: client disconnected\n"); - return false; + return qfalse; case clc_move: SV_ReadClientMove (&host_client->cmd); @@ -588,7 +588,7 @@ nextmsg: } } while (ret == 1); - return true; + return qtrue; } @@ -610,7 +610,7 @@ void SV_RunClients (void) if (!SV_ReadClientMessage ()) { - SV_DropClient (false); // client misbehaved... + SV_DropClient (qfalse); // client misbehaved... continue; } diff --git a/src/sys.c b/src/sys.c index bf006f0..b1d55d9 100644 --- a/src/sys.c +++ b/src/sys.c @@ -118,7 +118,7 @@ static char end2[] = void Sys_Quit (void) { 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 (registered.value) printf("%s", end2); diff --git a/src/sys_win.c b/src/sys_win.c index 3d26f8f..e9834b7 100644 --- a/src/sys_win.c +++ b/src/sys_win.c @@ -40,7 +40,7 @@ static double curtime = 0.0; static double lastcurtime = 0.0; static int lowshift; qboolean isDedicated; -static qboolean sc_return_on_enter = false; +static qboolean sc_return_on_enter = qfalse; HANDLE hinput, houtput; static char *tracking_tag = "Clams & Mooses"; @@ -337,9 +337,9 @@ void Sys_Init (void) } if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) - WinNT = true; + WinNT = qtrue; else - WinNT = false; + WinNT = qfalse; } @@ -382,7 +382,7 @@ void Sys_Error (char *error, ...) 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 () && ((Sys_FloatTime () - starttime) < CONSOLE_ERROR_TIMEOUT)) diff --git a/src/view.c b/src/view.c index ececf8c..d2dd464 100644 --- a/src/view.c +++ b/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 entities sent from the server may not include everything in the pvs, especially when crossing a water boudnary. @@ -34,35 +34,35 @@ when crossing a water boudnary. cvar_t lcd_x = {"lcd_x","0"}; cvar_t lcd_yaw = {"lcd_yaw","0"}; -cvar_t scr_ofsx = {"scr_ofsx","0", false}; -cvar_t scr_ofsy = {"scr_ofsy","0", false}; -cvar_t scr_ofsz = {"scr_ofsz","0", false}; +cvar_t scr_ofsx = {"scr_ofsx","0", qfalse}; +cvar_t scr_ofsy = {"scr_ofsy","0", qfalse}; +cvar_t scr_ofsz = {"scr_ofsz","0", qfalse}; cvar_t cl_rollspeed = {"cl_rollspeed", "200"}; cvar_t cl_rollangle = {"cl_rollangle", "2.0"}; -cvar_t cl_bob = {"cl_bob","0.02", false}; -cvar_t cl_bobcycle = {"cl_bobcycle","0.6", false}; -cvar_t cl_bobup = {"cl_bobup","0.5", false}; +cvar_t cl_bob = {"cl_bob","0.02", qfalse}; +cvar_t cl_bobcycle = {"cl_bobcycle","0.6", qfalse}; +cvar_t cl_bobup = {"cl_bobup","0.5", qfalse}; -cvar_t v_kicktime = {"v_kicktime", "0.5", false}; -cvar_t v_kickroll = {"v_kickroll", "0.6", false}; -cvar_t v_kickpitch = {"v_kickpitch", "0.6", false}; +cvar_t v_kicktime = {"v_kicktime", "0.5", qfalse}; +cvar_t v_kickroll = {"v_kickroll", "0.6", qfalse}; +cvar_t v_kickpitch = {"v_kickpitch", "0.6", qfalse}; -cvar_t v_iyaw_cycle = {"v_iyaw_cycle", "2", false}; -cvar_t v_iroll_cycle = {"v_iroll_cycle", "0.5", false}; -cvar_t v_ipitch_cycle = {"v_ipitch_cycle", "1", false}; -cvar_t v_iyaw_level = {"v_iyaw_level", "0.3", false}; -cvar_t v_iroll_level = {"v_iroll_level", "0.1", false}; -cvar_t v_ipitch_level = {"v_ipitch_level", "0.3", false}; +cvar_t v_iyaw_cycle = {"v_iyaw_cycle", "2", qfalse}; +cvar_t v_iroll_cycle = {"v_iroll_cycle", "0.5", qfalse}; +cvar_t v_ipitch_cycle = {"v_ipitch_cycle", "1", qfalse}; +cvar_t v_iyaw_level = {"v_iyaw_level", "0.3", qfalse}; +cvar_t v_iroll_level = {"v_iroll_level", "0.1", qfalse}; +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 cl_crossx = {"cl_crossx", "0", false}; -cvar_t cl_crossy = {"cl_crossy", "0", false}; +cvar_t crosshair = {"crosshair", "0", qtrue}; +cvar_t cl_crossx = {"cl_crossx", "0", qfalse}; +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; @@ -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"}; @@ -154,7 +154,7 @@ void V_StartPitchDrift (void) if (cl.nodrift || !cl.pitchvel) { cl.pitchvel = v_centerspeed.value; - cl.nodrift = false; + cl.nodrift = qfalse; cl.driftmove = 0; } } @@ -162,7 +162,7 @@ void V_StartPitchDrift (void) void V_StopPitchDrift (void) { cl.laststop = cl.time; - cl.nodrift = true; + cl.nodrift = qtrue; 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_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 @@ -297,13 +297,13 @@ qboolean V_CheckGamma (void) static float oldgammavalue; if (v_gamma.value == oldgammavalue) - return false; + return qfalse; oldgammavalue = v_gamma.value; BuildGammaTable (v_gamma.value); vid.recalc_refdef = 1; // force a surface cache flush - return true; + return qtrue; } @@ -536,19 +536,19 @@ void V_UpdatePalette (void) V_CalcPowerupCshift (); - new = false; + new = qfalse; for (i=0 ; iallsolid = false; + trace->allsolid = qfalse; if (num == CONTENTS_EMPTY) - trace->inopen = true; + trace->inopen = qtrue; else - trace->inwater = true; + trace->inwater = qtrue; } else - trace->startsolid = true; - return true; // empty + trace->startsolid = qtrue; + return qtrue; // empty } 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 if (!SV_RecursiveHullCheck (hull, node->children[side], p1f, midf, p1, mid, trace) ) - return false; + return qfalse; #ifdef PARANOID if (SV_HullPointContents (sv_hullmodel, mid, node->children[side]) == CONTENTS_SOLID) { Con_Printf ("mid PointInHullSolid\n"); - return false; + return qfalse; } #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); 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 @@ -697,7 +697,7 @@ qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec trace->fraction = midf; VectorCopy (mid, trace->endpos); Con_DPrintf ("backup past 0\n"); - return false; + return qfalse; } midf = p1f + (p2f - p1f)*frac; 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; 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 memset (&trace, 0, sizeof(trace_t)); trace.fraction = 1; - trace.allsolid = true; + trace.allsolid = qtrue; VectorCopy (end, trace.endpos); // get the clipping hull @@ -865,13 +865,13 @@ void SV_ClipToLinks ( areanode_t *node, moveclip_t *clip ) if (clip->trace.startsolid) { clip->trace = trace; - clip->trace.startsolid = true; + clip->trace.startsolid = qtrue; } else clip->trace = trace; } else if (trace.startsolid) - clip->trace.startsolid = true; + clip->trace.startsolid = qtrue; } // recurse down both sides diff --git a/src/zone.c b/src/zone.c index e30d7f8..eaa7eb9 100644 --- a/src/zone.c +++ b/src/zone.c @@ -453,7 +453,7 @@ int Hunk_HighMark (void) { if (hunk_tempactive) { - hunk_tempactive = false; + hunk_tempactive = qfalse; Hunk_FreeToHighMark (hunk_tempmark); } @@ -464,7 +464,7 @@ void Hunk_FreeToHighMark (int mark) { if (hunk_tempactive) { - hunk_tempactive = false; + hunk_tempactive = qfalse; Hunk_FreeToHighMark (hunk_tempmark); } if (mark < 0 || mark > hunk_high_used) @@ -489,7 +489,7 @@ void *Hunk_HighAllocName (int size, char *name) if (hunk_tempactive) { Hunk_FreeToHighMark (hunk_tempmark); - hunk_tempactive = false; + hunk_tempactive = qfalse; } #ifdef PARANOID @@ -534,14 +534,14 @@ void *Hunk_TempAlloc (int size) if (hunk_tempactive) { Hunk_FreeToHighMark (hunk_tempmark); - hunk_tempactive = false; + hunk_tempactive = qfalse; } hunk_tempmark = Hunk_HighMark (); buf = Hunk_HighAllocName (size, "temp"); - hunk_tempactive = true; + hunk_tempactive = qtrue; return buf; } @@ -577,7 +577,7 @@ void Cache_Move ( cache_system_t *c) cache_system_t *new; // 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) { // 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 while (1) { - cs = Cache_TryAlloc (size, false); + cs = Cache_TryAlloc (size, qfalse); if (cs) { strncpy (cs->name, name, sizeof(cs->name)-1);