From d45b066e5d4222ba76b1ee67b3db6d7fba0dd53d Mon Sep 17 00:00:00 2001 From: q66 Date: Wed, 10 Jun 2020 02:10:22 +0200 Subject: [PATCH] add engine/command.hh --- src/engine/command.cc | 1 + src/engine/command.hh | 16 ++++++++++++++++ src/engine/console.cc | 1 + src/engine/engine.hh | 10 ---------- src/engine/main.cc | 1 + src/engine/rendermodel.cc | 1 + src/engine/shader.cc | 4 +++- src/engine/texture.cc | 4 +++- src/engine/world.cc | 1 + src/engine/worldio.cc | 1 + src/shared/command.hh | 4 ++++ 11 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 src/engine/command.hh diff --git a/src/engine/command.cc b/src/engine/command.cc index 749f6db..4158f3f 100644 --- a/src/engine/command.cc +++ b/src/engine/command.cc @@ -1,6 +1,7 @@ // command.cpp: implements the parsing and execution of a tiny script language which // is largely backwards compatible with the quake console language. +#include "command.hh" #include "engine.hh" hashnameset idents; // contains ALL vars/commands/aliases diff --git a/src/engine/command.hh b/src/engine/command.hh new file mode 100644 index 0000000..70037f4 --- /dev/null +++ b/src/engine/command.hh @@ -0,0 +1,16 @@ +#ifndef ENGINE_COMMAND_HH +#define ENGINE_COMMAND_HH + +#include +#include + +extern hashnameset idents; +extern int identflags; + +void clearoverrides(); +void writecfg(const char *name = NULL); + +void checksleep(int millis); +void clearsleep(bool clearoverrides = true); + +#endif diff --git a/src/engine/console.cc b/src/engine/console.cc index da4ea60..d7949f9 100644 --- a/src/engine/console.cc +++ b/src/engine/console.cc @@ -1,5 +1,6 @@ // console.cpp: the console buffer, its display, and command line control +#include "command.hh" // idents, identflags #include "main.hh" #include "octaedit.hh" // editmode #include "rendertext.hh" diff --git a/src/engine/engine.hh b/src/engine/engine.hh index aabe615..0e032b0 100644 --- a/src/engine/engine.hh +++ b/src/engine/engine.hh @@ -80,16 +80,6 @@ extern void destroyva(vtxarray *va, bool reparent = true); extern void updatevabb(vtxarray *va, bool force = false); extern void updatevabbs(bool force = false); -// command -extern hashnameset idents; -extern int identflags; - -extern void clearoverrides(); -extern void writecfg(const char *name = NULL); - -extern void checksleep(int millis); -extern void clearsleep(bool clearoverrides = true); - // console extern float conscale; diff --git a/src/engine/main.cc b/src/engine/main.cc index 9661297..d9d0e61 100644 --- a/src/engine/main.cc +++ b/src/engine/main.cc @@ -3,6 +3,7 @@ #include "main.hh" #include "blend.hh" +#include "command.hh" // checksleep, writecfg #include "movie.hh" #include "octaedit.hh" #include "rendergl.hh" diff --git a/src/engine/rendermodel.cc b/src/engine/rendermodel.cc index a510540..f5729dc 100644 --- a/src/engine/rendermodel.cc +++ b/src/engine/rendermodel.cc @@ -1,6 +1,7 @@ #include "rendermodel.hh" #include "aa.hh" +#include "command.hh" // identflags #include "main.hh" // loadprogress, renderprogress #include "pvs.hh" #include "rendergl.hh" diff --git a/src/engine/shader.cc b/src/engine/shader.cc index 6470664..6d1a4bd 100644 --- a/src/engine/shader.cc +++ b/src/engine/shader.cc @@ -1,9 +1,11 @@ // shader.cpp: OpenGL GLSL shader management +#include "shader.hh" + +#include "command.hh" // identflags #include "main.hh" // loadprogress, renderprogress #include "rendergl.hh" #include "rendermodel.hh" // cleanupmodels -#include "shader.hh" #include "texture.hh" #include "engine.hh" diff --git a/src/engine/texture.cc b/src/engine/texture.cc index 8bb68e1..3c328ae 100644 --- a/src/engine/texture.cc +++ b/src/engine/texture.cc @@ -1,12 +1,14 @@ // texture.cpp: texture slot management +#include "texture.hh" + +#include "command.hh" // identflags #include "main.hh" // initwarning, loadprogress, renderprogress, screenw/h, renderedframe #include "material.hh" #include "octaedit.hh" #include "rendergl.hh" #include "rendersky.hh" #include "shader.hh" -#include "texture.hh" #include "engine.hh" diff --git a/src/engine/world.cc b/src/engine/world.cc index d34e772..cb3526d 100644 --- a/src/engine/world.cc +++ b/src/engine/world.cc @@ -1,6 +1,7 @@ // world.cpp: core map management stuff #include "blend.hh" +#include "command.hh" #include "main.hh" // clearmainmenu #include "octa.hh" #include "octaedit.hh" diff --git a/src/engine/worldio.cc b/src/engine/worldio.cc index bb8ed40..a771bea 100644 --- a/src/engine/worldio.cc +++ b/src/engine/worldio.cc @@ -1,6 +1,7 @@ // worldio.cpp: loading & saving of maps and savegames #include "blend.hh" +#include "command.hh" // idents, identflags #include "main.hh" // clearmainmenu, renderbackground #include "octa.hh" #include "octaedit.hh" // texmru diff --git a/src/shared/command.hh b/src/shared/command.hh index cda24e4..c72d16a 100644 --- a/src/shared/command.hh +++ b/src/shared/command.hh @@ -1,5 +1,8 @@ // script binding functionality +#ifndef SHARED_COMMAND_HH +#define SHARED_COMMAND_HH + enum { VAL_NULL = 0, VAL_INT, VAL_FLOAT, VAL_STR, VAL_ANY, VAL_CODE, VAL_MACRO, VAL_IDENT, VAL_CSTR, VAL_CANY, VAL_WORD, VAL_POP, VAL_COND }; enum @@ -408,3 +411,4 @@ inline void ident::getcval(tagval &v) const #define ICOMMAND(name, nargs, proto, b) ICOMMANDN(name, ICOMMANDNAME(name), nargs, proto, b) #define ICOMMANDS(name, nargs, proto, b) ICOMMANDNS(name, ICOMMANDSNAME, nargs, proto, b) +#endif