Nuclide
Software Development Kit for id Tech
defs.h File Reference
#include "text.h"
#include "textmenu.h"
#include "efx.h"
#include "font.h"
#include "fade.h"
#include "cmd.h"
#include "util.h"
#include "NSView.h"
#include "NSRadar.h"
#include "crosshair.h"
#include "../shared/weapons.h"
#include "../shared/weapon_common.h"

Go to the source code of this file.

Macros

#define PRINTFLAG(x)
 
#define READENTITY_BYTE(field, changedflag)
 
#define READENTITY_SHORT(field, changedflag)
 
#define READENTITY_FLOAT(field, changedflag)
 
#define READENTITY_INT(field, changedflag)
 
#define READENTITY_STRING(field, changedflag)
 
#define READENTITY_COORD(field, changedflag)
 
#define READENTITY_ANGLE(field, changedflag)
 
#define READENTITY_ENTITY(field, changedflag)
 
#define READENTITY_ENTNUM(field, changedflag)
 
#define READENTITY_COLOR(field, changedflag)
 
#define PRINT_LOW   0
 
#define PRINT_MEDIUM   1
 
#define PRINT_HIGH   2
 
#define PRINT_CHAT   3
 

Enumerations

enum  movementStance_t { STANCE_DEFAULT = 0 , STANCE_CROUCH = 1 , STANCE_PRONE = 2 }
 

Functions

bool Util_IsFocused (void)
 
int Util_GetMaxPlayers (void)
 
 string (string modelname, int frame, float frametime) spriteframe
 
void CSQC_UpdateSeat (void)
 Updates our seat pointers. More...
 
void drawstring_r (vector p, string t, vector s, vector c, float a, float f)
 Like drawstring() but aligns text to the right from the specified screen coordinates. More...
 
void GameMessage_Setup (string, int)
 
void View_SetMuzzleflash (int)
 
void Event_Callback (float mtime, __inout float btime)
 
void View_AddEvent (void(void) pCallback, float flTime)
 
void View_PlayAnimation (int)
 
void View_EnableViewmodel (void)
 
void View_DisableViewmodel (void)
 
void View_SetViewmodelSkin (float)
 
void drawrect (vector pos, vector sz, float thickness, vector rgb, float al, optional float dfl)
 Draws a non-filled rectangle with a specified outline. More...
 
void drawpic3d (vector worldpos, string mat, vector sz, vector rgb, float alpha)
 Like drawpic, but instead of screen coords, it will take world coords. More...
 
void drawcone (vector vecOrigin, vector vecAngle, int iDivisions, float flLength, float flRadius, vector vecColor, float flAlpha)
 Draws a (debug) cone in 3D space. More...
 
void precache_cubemap (string path)
 Like precache_pic, but will precache sky/cube map images (_bk, _dn etc.) More...
 

Variables

var bool g_net_debug = false
 
var bool g_cheats = false
 
var bool g_dlight_cached = false
 
var bool g_client_world_loaded = false
 
const float MASK_GLOWS = 16
 
var bool g_focus
 
var int g_numplayerslots
 
font_s FONT_16
 
font_s FONT_20
 
font_s FONT_CON
 
var float g_shellchromeshader
 
var float g_shellchromeshader_cull
 
var float autocvar_in_zoomSensitivity = 1.0f
 
var int autocvar_pm_stairSmoothing = TRUE
 
var int autocvar_pm_thirdPerson = FALSE
 
var int autocvar_cg_viewmodelFlip = FALSE
 
var vector autocvar_con_color = [255,150,0]
 
var vector autocvar_vgui_color = [255,170,0]
 
var vector autocvar_cg_viewmodelOffset = [0,0,0]
 
var int autocvar_cg_viewmodelPass = 0
 
var float autocvar_cg_viewmodelFov = 90.0f
 
var float autocvar_cg_viewmodelScale = 1.0f
 
var float autocvar_cg_hudAspect = 0.0f
 
var bool autocvar_pm_crouchToggle = false
 
var float PART_DUSTMOTE
 
var float PART_BURNING
 
vector video_mins
 
vector video_res
 
vector mouse_pos
 
int g_iIntermission
 
float clframetime
 
struct {
   entity   m_eViewModel
 
   entity   m_eMuzzleflash
 
   int   m_iVMBones
 
   entity   m_eViewModelL
 
   entity   m_eMuzzleflashL
 
   int   m_iVMBonesL
 
   float   m_flEventTime
 
   float   m_flEventFrame
 
   float   m_flEventMdl
 
   int   m_iEventWeapon
 
   int   m_iLastWeapon
 
   int   m_iOldWeapon
 
   float   m_flDamageAlpha
 
   vector   m_vecDamagePos
 
   int   m_iDamageFlags
 
   int   m_iZoomed
 
   float   m_flZoomTime
 
   entity   m_ePlayer
 
   vector   m_vecPredictedOrigin
 
   vector   m_vecPredictedOriginOld
 
   vector   m_vecPredictedVelocity
 
   float   m_flPredictedFlags
 
   vector   m_vecCameraOrigin
 
   vector   m_vecCameraAngle
 
   float   m_flCameraTime
 
   int   m_iHUDWeaponSelected
 
   float   m_flHUDWeaponSelectTime
 
   int   m_iScoresVisible
 
   int   m_iSaturnMenu
 
   float   m_flCenterprintAlpha
 
   float   m_flCenterprintTime
 
   float   m_iCenterprintLines
 
   string   m_strCenterprintBuffer [18]
 
   float   m_flPrintTime
 
   string   m_strPrintBuffer [5]
 
   int   m_iPrintLines
 
   bool   m_iInputAttack
 
   bool   m_iInputAttack2
 
   bool   m_iInputReload
 
   bool   m_iInputUse
 
   bool   m_iInputDuck
 
   bool   m_iInputSprint
 
   bool   m_iInputProne
 
   bool   m_iInputJump
 
   movementStance_t   m_dForceStance
 
   float   m_flInputBlockTime
 
   float   m_flFadeDuration
 
   float   m_flFadeHold
 
   float   m_flFadeMaxAlpha
 
   float   m_flFadeStyle
 
   float   m_flFadeAlpha
 
   float   m_flFadeTime
 
   float   m_flSprintLerp
 
   vector   m_vecFadeColor
 
   int   m_iFadeActive
 
   float   m_flShakeFreq
 
   float   m_flShakeDuration
 
   float   m_flShakeTime
 
   float   m_flShakeAmp
 
   vector   m_vecLag
 
   float   m_flVehTransition
 
   vector   m_vecVehEntry
 
   bool   m_bMoveForward
 
   bool   m_bInterfaceFocused
 
   bool   m_bSpecInput
 
   int   m_iLeanDir
 
   float   m_flLeaning
 
   int   m_iSprinting
 
g_seats [4]
 
struct {
   entity   m_eViewModel
 
   entity   m_eMuzzleflash
 
   int   m_iVMBones
 
   entity   m_eViewModelL
 
   entity   m_eMuzzleflashL
 
   int   m_iVMBonesL
 
   float   m_flEventTime
 
   float   m_flEventFrame
 
   float   m_flEventMdl
 
   int   m_iEventWeapon
 
   int   m_iLastWeapon
 
   int   m_iOldWeapon
 
   float   m_flDamageAlpha
 
   vector   m_vecDamagePos
 
   int   m_iDamageFlags
 
   int   m_iZoomed
 
   float   m_flZoomTime
 
   entity   m_ePlayer
 
   vector   m_vecPredictedOrigin
 
   vector   m_vecPredictedOriginOld
 
   vector   m_vecPredictedVelocity
 
   float   m_flPredictedFlags
 
   vector   m_vecCameraOrigin
 
   vector   m_vecCameraAngle
 
   float   m_flCameraTime
 
   int   m_iHUDWeaponSelected
 
   float   m_flHUDWeaponSelectTime
 
   int   m_iScoresVisible
 
   int   m_iSaturnMenu
 
   float   m_flCenterprintAlpha
 
   float   m_flCenterprintTime
 
   float   m_iCenterprintLines
 
   string   m_strCenterprintBuffer [18]
 
   float   m_flPrintTime
 
   string   m_strPrintBuffer [5]
 
   int   m_iPrintLines
 
   bool   m_iInputAttack
 
   bool   m_iInputAttack2
 
   bool   m_iInputReload
 
   bool   m_iInputUse
 
   bool   m_iInputDuck
 
   bool   m_iInputSprint
 
   bool   m_iInputProne
 
   bool   m_iInputJump
 
   movementStance_t   m_dForceStance
 
   float   m_flInputBlockTime
 
   float   m_flFadeDuration
 
   float   m_flFadeHold
 
   float   m_flFadeMaxAlpha
 
   float   m_flFadeStyle
 
   float   m_flFadeAlpha
 
   float   m_flFadeTime
 
   float   m_flSprintLerp
 
   vector   m_vecFadeColor
 
   int   m_iFadeActive
 
   float   m_flShakeFreq
 
   float   m_flShakeDuration
 
   float   m_flShakeTime
 
   float   m_flShakeAmp
 
   vector   m_vecLag
 
   float   m_flVehTransition
 
   vector   m_vecVehEntry
 
   bool   m_bMoveForward
 
   bool   m_bInterfaceFocused
 
   bool   m_bSpecInput
 
   int   m_iLeanDir
 
   float   m_flLeaning
 
   int   m_iSprinting
 
} * pSeat [4]
 
var vector g_vecMousePos
 
var vector g_hudmins
 
var vector g_hudres
 
var NSRadar g_overview
 

Macro Definition Documentation

◆ PRINT_CHAT

#define PRINT_CHAT   3

◆ PRINT_HIGH

#define PRINT_HIGH   2

◆ PRINT_LOW

#define PRINT_LOW   0

◆ PRINT_MEDIUM

#define PRINT_MEDIUM   1

◆ PRINTFLAG

#define PRINTFLAG (   x)
Value:
if (cvar("net_showUpdates") || g_net_debug) \
print(sprintf("%f %s read update %s\n", time, classname, #x));
var bool g_net_debug
Definition: defs.h:30
float time
Definition: fteextensions.qc:509
string classname
Definition: ui.qc:342

◆ READENTITY_ANGLE

#define READENTITY_ANGLE (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag) {\
field = readangle();\
PRINTFLAG(changedflag); \
}\
}

◆ READENTITY_BYTE

#define READENTITY_BYTE (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag) {\
field = readbyte();\
PRINTFLAG(changedflag); \
}\
}

◆ READENTITY_COLOR

#define READENTITY_COLOR (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag) {\
field = readbyte() / 255;\
PRINTFLAG(changedflag); \
}\
}

◆ READENTITY_COORD

#define READENTITY_COORD (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag) {\
field = readcoord();\
PRINTFLAG(changedflag); \
}\
}

◆ READENTITY_ENTITY

#define READENTITY_ENTITY (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag) {\
field = findfloat(world, ::entnum, readentitynum());\
PRINTFLAG(changedflag); \
}\
}

◆ READENTITY_ENTNUM

#define READENTITY_ENTNUM (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag) {\
field = readentitynum();\
PRINTFLAG(changedflag); \
}\
}

◆ READENTITY_FLOAT

#define READENTITY_FLOAT (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag) {\
field = readfloat();\
PRINTFLAG(changedflag); \
}\
}

◆ READENTITY_INT

#define READENTITY_INT (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag) {\
field = readint();\
PRINTFLAG(changedflag); \
}\
}

◆ READENTITY_SHORT

#define READENTITY_SHORT (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag) {\
field = readshort();\
PRINTFLAG(changedflag); \
}\
}

◆ READENTITY_STRING

#define READENTITY_STRING (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag) {\
field = readstring();\
PRINTFLAG(changedflag); \
}\
}

Enumeration Type Documentation

◆ movementStance_t

Enumerator
STANCE_DEFAULT 
STANCE_CROUCH 
STANCE_PRONE 

Function Documentation

◆ CSQC_UpdateSeat()

void CSQC_UpdateSeat ( void  )

Updates our seat pointers.

Call this when you need to verify we're getting the current player's info and not someone elses on the same machine (splitscreen).

◆ drawcone()

void drawcone ( vector  vecOrigin,
vector  vecAngle,
int  iDivisions,
float  flLength,
float  flRadius,
vector  vecColor,
float  flAlpha 
)

Draws a (debug) cone in 3D space.

◆ drawpic3d()

void drawpic3d ( vector  worldpos,
string  mat,
vector  sz,
vector  rgb,
float  alpha 
)

Like drawpic, but instead of screen coords, it will take world coords.

Will project the 2D image relative to the active NSView that we're currently rendering in (g_view). So it may only be called within certain contexts.

◆ drawrect()

void drawrect ( vector  pos,
vector  sz,
float  thickness,
vector  rgb,
float  al,
optional float  dfl 
)

Draws a non-filled rectangle with a specified outline.

◆ drawstring_r()

void drawstring_r ( vector  p,
string  t,
vector  s,
vector  c,
float  a,
float  f 
)

Like drawstring() but aligns text to the right from the specified screen coordinates.

◆ Event_Callback()

void Event_Callback ( float  mtime,
__inout float  btime 
)

◆ GameMessage_Setup()

void GameMessage_Setup ( string  message,
int  channel 
)

◆ precache_cubemap()

void precache_cubemap ( string  path)

Like precache_pic, but will precache sky/cube map images (_bk, _dn etc.)

◆ string()

string ( string  modelname,
int  frame,
float  frametime 
)

◆ Util_GetMaxPlayers()

int Util_GetMaxPlayers ( void  )

◆ Util_IsFocused()

bool Util_IsFocused ( void  )

◆ View_AddEvent()

void View_AddEvent ( void(void pCallback,
float  flTime 
)

◆ View_DisableViewmodel()

void View_DisableViewmodel ( void  )

◆ View_EnableViewmodel()

void View_EnableViewmodel ( void  )

◆ View_PlayAnimation()

void View_PlayAnimation ( int  iSequence)

◆ View_SetMuzzleflash()

void View_SetMuzzleflash ( int  index)

◆ View_SetViewmodelSkin()

void View_SetViewmodelSkin ( float  skinValue)

Variable Documentation

◆ autocvar_cg_hudAspect

var float autocvar_cg_hudAspect = 0.0f

◆ autocvar_cg_viewmodelFlip

var int autocvar_cg_viewmodelFlip = FALSE

◆ autocvar_cg_viewmodelFov

var float autocvar_cg_viewmodelFov = 90.0f

◆ autocvar_cg_viewmodelOffset

var vector autocvar_cg_viewmodelOffset = [0,0,0]

◆ autocvar_cg_viewmodelPass

var int autocvar_cg_viewmodelPass = 0

◆ autocvar_cg_viewmodelScale

var float autocvar_cg_viewmodelScale = 1.0f

◆ autocvar_con_color

var vector autocvar_con_color = [255,150,0]

◆ autocvar_in_zoomSensitivity

var float autocvar_in_zoomSensitivity = 1.0f

◆ autocvar_pm_crouchToggle

var bool autocvar_pm_crouchToggle = false

◆ autocvar_pm_stairSmoothing

var int autocvar_pm_stairSmoothing = TRUE

◆ autocvar_pm_thirdPerson

var int autocvar_pm_thirdPerson = FALSE

◆ autocvar_vgui_color

var vector autocvar_vgui_color = [255,170,0]

◆ clframetime

float clframetime

◆ FONT_16

font_s FONT_16

◆ FONT_20

font_s FONT_20

◆ FONT_CON

font_s FONT_CON

◆ g_cheats

var bool g_cheats = false

◆ g_client_world_loaded

var bool g_client_world_loaded = false

◆ g_dlight_cached

var bool g_dlight_cached = false

◆ g_focus

var bool g_focus

◆ g_hudmins

var vector g_hudmins

◆ g_hudres

var vector g_hudres

◆ g_iIntermission

int g_iIntermission

◆ g_net_debug

var bool g_net_debug = false

◆ g_numplayerslots

var int g_numplayerslots

◆ g_overview

var NSRadar g_overview

◆ 

struct { ... } g_seats[4]

◆ g_shellchromeshader

var float g_shellchromeshader

◆ g_shellchromeshader_cull

var float g_shellchromeshader_cull

◆ g_vecMousePos

var vector g_vecMousePos

◆ m_bInterfaceFocused

bool m_bInterfaceFocused

◆ m_bMoveForward

bool m_bMoveForward

◆ m_bSpecInput

bool m_bSpecInput

◆ m_dForceStance

movementStance_t m_dForceStance

◆ m_eMuzzleflash

entity m_eMuzzleflash

◆ m_eMuzzleflashL

entity m_eMuzzleflashL

◆ m_ePlayer

entity m_ePlayer

◆ m_eViewModel

entity m_eViewModel

◆ m_eViewModelL

entity m_eViewModelL

◆ m_flCameraTime

float m_flCameraTime

◆ m_flCenterprintAlpha

float m_flCenterprintAlpha

◆ m_flCenterprintTime

float m_flCenterprintTime

◆ m_flDamageAlpha

float m_flDamageAlpha

◆ m_flEventFrame

float m_flEventFrame

◆ m_flEventMdl

float m_flEventMdl

◆ m_flEventTime

float m_flEventTime

◆ m_flFadeAlpha

float m_flFadeAlpha

◆ m_flFadeDuration

float m_flFadeDuration

◆ m_flFadeHold

float m_flFadeHold

◆ m_flFadeMaxAlpha

float m_flFadeMaxAlpha

◆ m_flFadeStyle

float m_flFadeStyle

◆ m_flFadeTime

float m_flFadeTime

◆ m_flHUDWeaponSelectTime

float m_flHUDWeaponSelectTime

◆ m_flInputBlockTime

float m_flInputBlockTime

◆ m_flLeaning

float m_flLeaning

◆ m_flPredictedFlags

float m_flPredictedFlags

◆ m_flPrintTime

float m_flPrintTime

◆ m_flShakeAmp

float m_flShakeAmp

◆ m_flShakeDuration

float m_flShakeDuration

◆ m_flShakeFreq

float m_flShakeFreq

◆ m_flShakeTime

float m_flShakeTime

◆ m_flSprintLerp

float m_flSprintLerp

◆ m_flVehTransition

float m_flVehTransition

◆ m_flZoomTime

float m_flZoomTime

◆ m_iCenterprintLines

float m_iCenterprintLines

◆ m_iDamageFlags

int m_iDamageFlags

◆ m_iEventWeapon

int m_iEventWeapon

◆ m_iFadeActive

int m_iFadeActive

◆ m_iHUDWeaponSelected

int m_iHUDWeaponSelected

◆ m_iInputAttack

bool m_iInputAttack

◆ m_iInputAttack2

bool m_iInputAttack2

◆ m_iInputDuck

bool m_iInputDuck

◆ m_iInputJump

bool m_iInputJump

◆ m_iInputProne

bool m_iInputProne

◆ m_iInputReload

bool m_iInputReload

◆ m_iInputSprint

bool m_iInputSprint

◆ m_iInputUse

bool m_iInputUse

◆ m_iLastWeapon

int m_iLastWeapon

◆ m_iLeanDir

int m_iLeanDir

◆ m_iOldWeapon

int m_iOldWeapon

◆ m_iPrintLines

int m_iPrintLines

◆ m_iSaturnMenu

int m_iSaturnMenu

◆ m_iScoresVisible

int m_iScoresVisible

◆ m_iSprinting

int m_iSprinting

◆ m_iVMBones

int m_iVMBones

◆ m_iVMBonesL

int m_iVMBonesL

◆ m_iZoomed

int m_iZoomed

◆ m_strCenterprintBuffer

string m_strCenterprintBuffer[18]

◆ m_strPrintBuffer

string m_strPrintBuffer[5]

◆ m_vecCameraAngle

vector m_vecCameraAngle

◆ m_vecCameraOrigin

vector m_vecCameraOrigin

◆ m_vecDamagePos

vector m_vecDamagePos

◆ m_vecFadeColor

vector m_vecFadeColor

◆ m_vecLag

vector m_vecLag

◆ m_vecPredictedOrigin

vector m_vecPredictedOrigin

◆ m_vecPredictedOriginOld

vector m_vecPredictedOriginOld

◆ m_vecPredictedVelocity

vector m_vecPredictedVelocity

◆ m_vecVehEntry

vector m_vecVehEntry

◆ MASK_GLOWS

const float MASK_GLOWS = 16

◆ mouse_pos

vector mouse_pos

◆ PART_BURNING

var float PART_BURNING

◆ PART_DUSTMOTE

var float PART_DUSTMOTE

◆ 

struct { ... } * pSeat[4]

◆ video_mins

vector video_mins

◆ video_res

vector video_res