Xonotic
all.qh File Reference
#include <common/command/_mod.qh>
#include "config.qh"
#include "turret.qh"
#include "turret/_mod.qh"
+ Include dependency graph for all.qh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _TR_CONFIG(class, fld, T, turname)
 
#define DEFAULT_FILENAME   "turrets_dump.cfg"
 
#define get_turretinfo(i)   REGISTRY_GET(Turrets, i)
 
#define REGISTER_TURRET(id, inst)   REGISTER(Turrets, TUR, id, m_id, inst)
 
#define TR_CONFIG(class, turname, fld, T)   _TR_CONFIG(class, fld, T, turname)
 
#define TR_CONFIG_BEGIN(class)
 
#define TR_CONFIG_END()
 
#define TR_PROPS(L, class, prefix)   L(TR_CONFIG_BEGIN, TR_CONFIG, TR_CONFIG_END, class, prefix) \
 
#define TR_PROPS_COMMON(P, class, prefix)
 
#define TUR_LAST   (REGISTRY_COUNT(Turrets) - 1)
 

Functions

 GENERIC_COMMAND (dumpturrets, "Dump all turrets into " DEFAULT_FILENAME, false)
 
 REGISTER_TURRET (Null, NEW(Turret))
 

Variables

const int TUR_FIRST = 1
 

Macro Definition Documentation

◆ _TR_CONFIG

#define _TR_CONFIG (   class,
  fld,
  T,
  turname 
)

Definition at line 55 of file all.qh.

◆ DEFAULT_FILENAME

#define DEFAULT_FILENAME   "turrets_dump.cfg"

Definition at line 59 of file all.qh.

Referenced by GENERIC_COMMAND().

◆ get_turretinfo

#define get_turretinfo (   i)    REGISTRY_GET(Turrets, i)

Definition at line 9 of file all.qh.

Referenced by turret_construct(), turret_die(), and turret_draw2d().

◆ REGISTER_TURRET

#define REGISTER_TURRET (   id,
  inst 
)    REGISTER(Turrets, TUR, id, m_id, inst)

Definition at line 119 of file all.qh.

◆ TR_CONFIG

#define TR_CONFIG (   class,
  turname,
  fld,
 
)    _TR_CONFIG(class, fld, T, turname)

Definition at line 48 of file all.qh.

◆ TR_CONFIG_BEGIN

#define TR_CONFIG_BEGIN (   class)

Definition at line 54 of file all.qh.

◆ TR_CONFIG_END

#define TR_CONFIG_END ( )

Definition at line 56 of file all.qh.

◆ TR_PROPS

#define TR_PROPS (   L,
  class,
  prefix 
)    L(TR_CONFIG_BEGIN, TR_CONFIG, TR_CONFIG_END, class, prefix) \

Definition at line 44 of file all.qh.

◆ TR_PROPS_COMMON

#define TR_PROPS_COMMON (   P,
  class,
  prefix 
)
Value:
P(class, prefix, aim_firetolerance_dist, float) \
P(class, prefix, aim_maxpitch, float) \
P(class, prefix, aim_maxrot, float) \
P(class, prefix, aim_speed, float) \
P(class, prefix, ammo_max, float) \
P(class, prefix, ammo_recharge, float) \
P(class, prefix, health, float) \
P(class, prefix, respawntime, float) \
P(class, prefix, shot_dmg, float) \
P(class, prefix, shot_force, float) \
P(class, prefix, shot_radius, float) \
P(class, prefix, shot_refire, float) \
P(class, prefix, shot_speed, float) \
P(class, prefix, shot_spread, float) \
P(class, prefix, shot_volly, float) \
P(class, prefix, shot_volly_refire, float) \
P(class, prefix, target_range, float) \
P(class, prefix, target_range_min, float) \
P(class, prefix, target_range_optimal, float) \
P(class, prefix, target_select_anglebias, float) \
P(class, prefix, target_select_missilebias, float) \
P(class, prefix, target_select_playerbias, float) \
P(class, prefix, target_select_rangebias, float) \
P(class, prefix, target_select_samebias, float) \
P(class, prefix, track_accel_pitch, float) \
P(class, prefix, track_accel_rot, float) \
P(class, prefix, track_blendrate, float) \
P(class, prefix, track_type, float) \
float respawntime
Definition: items.qh:36
float health
Definition: progsdefs.qc:137

Definition at line 13 of file all.qh.

◆ TUR_LAST

#define TUR_LAST   (REGISTRY_COUNT(Turrets) - 1)

Definition at line 117 of file all.qh.

Function Documentation

◆ GENERIC_COMMAND()

GENERIC_COMMAND ( dumpturrets  ,
"Dump all turrets into "  DEFAULT_FILENAME,
false   
)

Definition at line 61 of file all.qh.

References argv(), CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, DEFAULT_FILENAME, fclose(), FILE_WRITE, fopen(), LOG_HELP, LOG_HELPF, LOG_INFO, and LOG_INFOF.

62 {
63  switch(request)
64  {
66  {
67  #ifdef SVQC
68  tur_config_file = -1;
69  tur_config_alsoprint = -1;
70  string filename = argv(1);
71 
72  if(filename == "")
73  {
74  filename = DEFAULT_FILENAME;
75  tur_config_alsoprint = false;
76  }
77  else if(filename == "-")
78  {
79  filename = DEFAULT_FILENAME;
80  tur_config_alsoprint = true;
81  }
82  tur_config_file = fopen(filename, FILE_WRITE);
83 
84  if(tur_config_file >= 0)
85  {
86  Dump_Turret_Settings();
87  LOG_INFOF("Dumping turrets... File located in ^2data/data/%s^7.", filename);
88  fclose(tur_config_file);
89  tur_config_file = -1;
90  tur_config_alsoprint = -1;
91  }
92  else
93  {
94  LOG_INFOF("^1Error: ^7Could not open file '%s'!", filename);
95  }
96  #else
97  LOG_INFO("Turrets dump command only works with sv_cmd.");
98  #endif
99  return;
100  }
101 
102  default:
103  case CMD_REQUEST_USAGE:
104  {
105  LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpturrets [<filename>]");
106  LOG_HELPF(" Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
107  LOG_HELP(" if supplied with '-' output to console as well as default,");
108  LOG_HELP(" if left blank, it will only write to default.");
109  return;
110  }
111  }
112 }
#define LOG_HELPF(...)
Definition: log.qh:96
const int CMD_REQUEST_USAGE
Definition: command.qh:4
#define LOG_HELP(...)
Definition: log.qh:95
#define LOG_INFOF(...)
Definition: log.qh:71
const int CMD_REQUEST_COMMAND
Definition: command.qh:3
#define LOG_INFO(...)
Definition: log.qh:70
const float FILE_WRITE
Definition: csprogsdefs.qc:233
#define DEFAULT_FILENAME
Definition: all.qh:59
+ Here is the call graph for this function:

◆ REGISTER_TURRET()

REGISTER_TURRET ( Null  ,
NEW(Turret  
)

Variable Documentation

◆ TUR_FIRST

const int TUR_FIRST = 1

Definition at line 116 of file all.qh.