From: Mario Date: Sun, 23 Oct 2016 04:26:38 +0000 (+1000) Subject: Make it compile without XONOTIC defined X-Git-Tag: xonotic-v0.8.2~470^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b0a563c3658ec620ddb9037b9417b743a47002a5;p=xonotic%2Fxonotic-data.pk3dir.git Make it compile without XONOTIC defined --- diff --git a/qcsrc/Makefile b/qcsrc/Makefile index 903d8537e..916fe08c9 100644 --- a/qcsrc/Makefile +++ b/qcsrc/Makefile @@ -7,7 +7,7 @@ WORKDIR ?= ../.tmp QCCFLAGS_WATERMARK ?= $(shell git describe --tags --dirty='~') VER = $(subst *,\*,$(QCCFLAGS_WATERMARK)) NDEBUG ?= 1 -XONOTIC ?= 1 +XONOTIC ?= 0 BUILD_MOD ?= ifndef ZIP diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 117badbec..ef68e21b2 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -3,6 +3,7 @@ #include "quickmenu.qh" #include #include +#include #include #include #include diff --git a/qcsrc/client/progs.inc b/qcsrc/client/progs.inc index 327df77c2..738831a5d 100644 --- a/qcsrc/client/progs.inc +++ b/qcsrc/client/progs.inc @@ -2,9 +2,9 @@ #if XONOTIC #include -#endif #include +#endif #ifdef BUILD_MOD #include diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 75ef40521..6a4515ac1 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -4,6 +4,7 @@ #include #include +#include #include #include diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 3134a24ed..d309f4d9a 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 6d58ac77a..1f88bc8d6 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -6,6 +6,7 @@ #include "../mutators/events.qh" #include +#include #include #include diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 29f96aa44..133d0caca 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -1,60 +1,5 @@ #pragma once -REGISTER_NET_TEMP(TE_CSQC_PICTURE) -REGISTER_NET_TEMP(TE_CSQC_RACE) -REGISTER_NET_TEMP(TE_CSQC_TEAMNAGGER) -REGISTER_NET_TEMP(TE_CSQC_PINGPLREPORT) -REGISTER_NET_TEMP(TE_CSQC_WEAPONCOMPLAIN) -REGISTER_NET_TEMP(TE_CSQC_VEHICLESETUP) - -const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder -const int RACE_NET_CHECKPOINT_CLEAR = 1; -const int RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder -const int RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent -const int RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent -const int RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder -const int RACE_NET_PENALTY_RACE = 6; // byte penaltytime, string reason -const int RACE_NET_PENALTY_QUALIFYING = 7; // byte penaltytime, string reason -const int RACE_NET_SERVER_RECORD = 8; // server record, sent to client -const int RACE_NET_SPEED_AWARD = 9; // speed award, sent to client -const int RACE_NET_SPEED_AWARD_BEST = 10; // all time best speed award, sent to client -const int RACE_NET_SERVER_RANKINGS = 11; -const int RACE_NET_SERVER_STATUS = 12; -const int RANKINGS_CNT = 15; - -REGISTER_NET_LINKED(_ENT_CLIENT_INIT) -#ifdef CSQC -NET_HANDLE(_ENT_CLIENT_INIT, bool isnew) { make_pure(this); return true; } -#endif -/** Sent as a temp entity from a persistent linked entity */ -REGISTER_NET_TEMP(ENT_CLIENT_INIT) - -REGISTER_NET_LINKED(ENT_CLIENT_SCORES_INFO) -REGISTER_NET_LINKED(ENT_CLIENT_SCORES) -REGISTER_NET_LINKED(ENT_CLIENT_TEAMSCORES) -REGISTER_NET_LINKED(ENT_CLIENT_NAGGER) // flags [votecalledvote] -REGISTER_NET_LINKED(ENT_CLIENT_RADARLINK) // flags [startorigin] [endorigin] [startcolor+16*endcolor] -REGISTER_NET_LINKED(ENT_CLIENT_PROJECTILE) -REGISTER_NET_LINKED(ENT_CLIENT_MAPVOTE) -REGISTER_NET_LINKED(ENT_CLIENT_CLIENTDATA) -REGISTER_NET_LINKED(ENT_CLIENT_RANDOMSEED) -REGISTER_NET_LINKED(ENT_CLIENT_ACCURACY) -REGISTER_NET_LINKED(ENT_CLIENT_ELIMINATEDPLAYERS) - -REGISTER_NET_LINKED(ENT_CLIENT_MODEL) - -REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE) -REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_CAMERA) -REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_TELEPORTED) - -REGISTER_NET_LINKED(ENT_CLIENT_ARC_BEAM) -REGISTER_NET_LINKED(ENT_CLIENT_HOOK) -REGISTER_NET_LINKED(ENT_CLIENT_TUBANOTE) - -REGISTER_NET_LINKED(ENT_CLIENT_SPAWNPOINT) -REGISTER_NET_LINKED(ENT_CLIENT_SPAWNEVENT) -REGISTER_NET_LINKED(ENT_CLIENT_WALL) - const int SPRITERULE_DEFAULT = 0; const int SPRITERULE_TEAMPLAY = 1; const int SPRITERULE_SPECTATOR = 2; diff --git a/qcsrc/common/net_linked.qh b/qcsrc/common/net_linked.qh new file mode 100644 index 000000000..a67550aac --- /dev/null +++ b/qcsrc/common/net_linked.qh @@ -0,0 +1,56 @@ +#pragma once + +REGISTER_NET_TEMP(TE_CSQC_PICTURE) +REGISTER_NET_TEMP(TE_CSQC_RACE) +REGISTER_NET_TEMP(TE_CSQC_TEAMNAGGER) +REGISTER_NET_TEMP(TE_CSQC_PINGPLREPORT) +REGISTER_NET_TEMP(TE_CSQC_WEAPONCOMPLAIN) +REGISTER_NET_TEMP(TE_CSQC_VEHICLESETUP) + +const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder +const int RACE_NET_CHECKPOINT_CLEAR = 1; +const int RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder +const int RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent +const int RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent +const int RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder +const int RACE_NET_PENALTY_RACE = 6; // byte penaltytime, string reason +const int RACE_NET_PENALTY_QUALIFYING = 7; // byte penaltytime, string reason +const int RACE_NET_SERVER_RECORD = 8; // server record, sent to client +const int RACE_NET_SPEED_AWARD = 9; // speed award, sent to client +const int RACE_NET_SPEED_AWARD_BEST = 10; // all time best speed award, sent to client +const int RACE_NET_SERVER_RANKINGS = 11; +const int RACE_NET_SERVER_STATUS = 12; +const int RANKINGS_CNT = 15; + +REGISTER_NET_LINKED(_ENT_CLIENT_INIT) +#ifdef CSQC +NET_HANDLE(_ENT_CLIENT_INIT, bool isnew) { make_pure(this); return true; } +#endif +/** Sent as a temp entity from a persistent linked entity */ +REGISTER_NET_TEMP(ENT_CLIENT_INIT) + +REGISTER_NET_LINKED(ENT_CLIENT_SCORES_INFO) +REGISTER_NET_LINKED(ENT_CLIENT_SCORES) +REGISTER_NET_LINKED(ENT_CLIENT_TEAMSCORES) +REGISTER_NET_LINKED(ENT_CLIENT_NAGGER) // flags [votecalledvote] +REGISTER_NET_LINKED(ENT_CLIENT_RADARLINK) // flags [startorigin] [endorigin] [startcolor+16*endcolor] +REGISTER_NET_LINKED(ENT_CLIENT_PROJECTILE) +REGISTER_NET_LINKED(ENT_CLIENT_MAPVOTE) +REGISTER_NET_LINKED(ENT_CLIENT_CLIENTDATA) +REGISTER_NET_LINKED(ENT_CLIENT_RANDOMSEED) +REGISTER_NET_LINKED(ENT_CLIENT_ACCURACY) +REGISTER_NET_LINKED(ENT_CLIENT_ELIMINATEDPLAYERS) + +REGISTER_NET_LINKED(ENT_CLIENT_MODEL) + +REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE) +REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_CAMERA) +REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_TELEPORTED) + +REGISTER_NET_LINKED(ENT_CLIENT_ARC_BEAM) +REGISTER_NET_LINKED(ENT_CLIENT_HOOK) +REGISTER_NET_LINKED(ENT_CLIENT_TUBANOTE) + +REGISTER_NET_LINKED(ENT_CLIENT_SPAWNPOINT) +REGISTER_NET_LINKED(ENT_CLIENT_SPAWNEVENT) +REGISTER_NET_LINKED(ENT_CLIENT_WALL) diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc index dd5f3a164..5cf3e1c6b 100644 --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@ -4,6 +4,7 @@ #elif defined(MENUQC) #elif defined(SVQC) #include + #include #include #include #include diff --git a/qcsrc/common/triggers/target/music.qc b/qcsrc/common/triggers/target/music.qc index 0fde9e043..1f8cb00cb 100644 --- a/qcsrc/common/triggers/target/music.qc +++ b/qcsrc/common/triggers/target/music.qc @@ -3,6 +3,7 @@ #elif defined(MENUQC) #elif defined(SVQC) #include + #include #include #include #endif diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc index b6c3c9e01..6408d6e3f 100644 --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@ -266,6 +266,8 @@ void make_safe_for_remove(entity this); #endif #undef ENGINE_EVENT +#if XONOTIC #ifdef GAMEQC #include #endif +#endif diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc index 4cc8458d5..66613b532 100644 --- a/qcsrc/lib/csqcmodel/cl_player.qc +++ b/qcsrc/lib/csqcmodel/cl_player.qc @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/qcsrc/lib/csqcmodel/sv_model.qc b/qcsrc/lib/csqcmodel/sv_model.qc index 0f8ef06ac..dd8d5d33a 100644 --- a/qcsrc/lib/csqcmodel/sv_model.qc +++ b/qcsrc/lib/csqcmodel/sv_model.qc @@ -24,6 +24,7 @@ #include "common.qh" #include #include +#include #include #include #include diff --git a/qcsrc/lib/draw.qh b/qcsrc/lib/draw.qh index 698c92623..52583ff58 100644 --- a/qcsrc/lib/draw.qh +++ b/qcsrc/lib/draw.qh @@ -5,8 +5,6 @@ #include "i18n.qh" #include "vector.qh" - #include - void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg) { // I want to draw a quad... @@ -123,6 +121,7 @@ drawstring_builtin(position, text, theScale, rgb, theAlpha, flag); } + float vid_conwidth; // TODO void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, int flag) { position.x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale.x); diff --git a/qcsrc/lib/matrix/_mod.inc b/qcsrc/lib/matrix/_mod.inc index 4854f092a..d68dc7d96 100644 --- a/qcsrc/lib/matrix/_mod.inc +++ b/qcsrc/lib/matrix/_mod.inc @@ -1,3 +1,5 @@ // generated file; do not modify -#include +#if XONOTIC + #include +#endif #include diff --git a/qcsrc/lib/matrix/_mod.qh b/qcsrc/lib/matrix/_mod.qh index 965812297..c351afe8f 100644 --- a/qcsrc/lib/matrix/_mod.qh +++ b/qcsrc/lib/matrix/_mod.qh @@ -1,3 +1,5 @@ // generated file; do not modify -#include +#if XONOTIC + #include +#endif #include diff --git a/qcsrc/lib/net.qh b/qcsrc/lib/net.qh index 30ab014ec..f0a9e817d 100644 --- a/qcsrc/lib/net.qh +++ b/qcsrc/lib/net.qh @@ -313,12 +313,13 @@ USING(Stream, int); #define ReadInt48_t() vec3(ReadInt24_t(), ReadInt24_t(), 0) #define ReadInt72_t() vec3(ReadInt24_t(), ReadInt24_t(), ReadInt24_t()) - int _ReadSByte; + noref int _ReadSByte; #define ReadSByte() (_ReadSByte = ReadByte(), (_ReadSByte & BIT(7) ? -128 : 0) + (_ReadSByte & BITS(7))) #define ReadFloat() ReadCoord() #define ReadVector() vec3(ReadFloat(), ReadFloat(), ReadFloat()) #define ReadVector2D() vec3(ReadFloat(), ReadFloat(), 0) + float servertime; // TODO float ReadApproxPastTime() { float dt = ReadByte(); diff --git a/qcsrc/lib/warpzone/server.qc b/qcsrc/lib/warpzone/server.qc index 34ea2610d..2e660827a 100644 --- a/qcsrc/lib/warpzone/server.qc +++ b/qcsrc/lib/warpzone/server.qc @@ -5,9 +5,9 @@ #elif defined(MENUQC) #elif defined(SVQC) #include + #include #include #include - #include #include #include #endif diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index bdde55b9a..2a7478dee 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 45051b6c2..56c36c074 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -9,6 +9,7 @@ #include "../waypoints.qh" #include +#include #include #include #include diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 17f61af14..7c71720c4 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -10,6 +10,7 @@ #include #include +#include #include .float speed; diff --git a/qcsrc/server/bot/default/waypoints.qc b/qcsrc/server/bot/default/waypoints.qc index 5fb923799..c83d0f63c 100644 --- a/qcsrc/server/bot/default/waypoints.qc +++ b/qcsrc/server/bot/default/waypoints.qc @@ -10,6 +10,7 @@ #include "../../antilag.qh" #include +#include #include #include diff --git a/qcsrc/server/command/getreplies.qc b/qcsrc/server/command/getreplies.qc index 9380fc4cd..5017e81ab 100644 --- a/qcsrc/server/command/getreplies.qc +++ b/qcsrc/server/command/getreplies.qc @@ -5,6 +5,7 @@ #include "../race.qh" #include +#include #include #include diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index a329ac996..cbc65680a 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -21,6 +21,7 @@ #include "../mutators/_mod.qh" #include +#include #include #include #include diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 361f12844..d1cdb7e59 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -13,6 +13,7 @@ #include "../mutators/_mod.qh" #include +#include #include #include #include diff --git a/qcsrc/server/progs.inc b/qcsrc/server/progs.inc index 1000a5105..1a8ada45f 100644 --- a/qcsrc/server/progs.inc +++ b/qcsrc/server/progs.inc @@ -2,9 +2,9 @@ #if XONOTIC #include -#endif #include +#endif #ifdef BUILD_MOD #include diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index ed9006bb2..7cc06da3e 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -2,6 +2,7 @@ #include "../mutators/_mod.qh" #include +#include #include #include #include diff --git a/qcsrc/server/weapons/common.qc b/qcsrc/server/weapons/common.qc index 03031c158..6d1637550 100644 --- a/qcsrc/server/weapons/common.qc +++ b/qcsrc/server/weapons/common.qc @@ -2,6 +2,7 @@ #include #include +#include #include #include #include diff --git a/qcsrc/server/weapons/csqcprojectile.qc b/qcsrc/server/weapons/csqcprojectile.qc index a8a893e21..9fcfd34c2 100644 --- a/qcsrc/server/weapons/csqcprojectile.qc +++ b/qcsrc/server/weapons/csqcprojectile.qc @@ -5,6 +5,7 @@ #include "../command/common.qh" #include +#include #include .float csqcprojectile_type; diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index 56df6c3a2..539371a53 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -3,6 +3,7 @@ #include "weaponsystem.qh" #include #include +#include #include #include #include diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index 3b7aa7bf8..b49ed88f5 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -10,6 +10,7 @@ #include "../antilag.qh" #include +#include #include #include diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 4968d3c31..c0d302e22 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include