Make games buildable again, caused by renaming Spraylogo and GameRules classes/files.

This commit is contained in:
Marco Cawthorne 2022-10-14 15:49:59 -07:00
parent bfe0219609
commit 7ad6d9c457
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
13 changed files with 155 additions and 126 deletions

View File

@ -879,6 +879,7 @@ INPUT = src/ \
Documentation/Building.md \
Documentation/Launching.md \
Documentation/Filesystem.md \
Documentation/Classes.md \
Documentation/Materials/mat_overview.md \
Documentation/Materials/mat_commands.md \
Documentation/Materials/mat_vmap.md \

View File

@ -30,15 +30,17 @@ BUTTA_TEXON : Texture choices will be inverted in case multiple frames exist.
This entity was introduced in Quake (1996).
*/
enumflags
/** Spawnflags that button_target supports. */
typedef enumflags
{
BUTTA_USE,
BUTTA_TEXON
};
BUTTA_USE, /**< Button has to be used by a player to trigger, instead of being shot. */
BUTTA_TEXON /**< Button texture starts in the **ON** state. */
} sf_button_target_t;
class
button_target:NSSurfacePropEntity
{
public:
void(void) button_target;
virtual void(void) Respawn;

View File

@ -5,7 +5,6 @@
#includelist
shared/ambient_generic.qc
shared/decals.qc
shared/spraylogo.qc
shared/func_friction.qc
shared/env_sprite.qc
shared/env_bubbles.qc

View File

@ -103,4 +103,4 @@ public:
/* our currently running mode */
NSGameRules g_grMode;
#define CGameRules NSGamerules
#define CGameRules NSGameRules

View File

@ -15,7 +15,7 @@
*/
#include "NSOutput.h"
#include "gamerules.h"
#include "NSGameRules.h"
#include "sentences.h"
#include "skill.h"
#include "logging.h"
@ -23,7 +23,7 @@
#include "spawn.h"
#include "weapons.h"
#include "plugins.h"
#include "traceattack.h"
#include "NSTraceAttack.h"
#include "footsteps.h"
#include "route.h"

View File

@ -6,10 +6,10 @@ nodes.qc
skill.qc
sentences.qc
spawn.qc
gamerules.qc
NSGameRules.qc
client.qc
server.qc
traceattack.qc
NSTraceAttack.qc
footsteps.qc
vote.qc
weapons.qc

68
src/shared/NSSpraylogo.h Normal file
View File

@ -0,0 +1,68 @@
/*
* Copyright (c) 2016-2022 Vera Visions LLC.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef CLIENT
/** This entity class represents a NSClientPlayer their spraylogo. */
class NSSpraylogo:NSEntity
{
private:
vector m_vecColor;
vector m_vecPosition;
vector m_vecAngles;
int m_iOwnerID;
string m_strName;
string m_m_strPath;
bool m_bInitialized;
bool m_bMonochrome;
public:
void NSSpraylogo(void);
virtual float predraw(void);
virtual void RendererRestarted(void);
};
void Spray_Parse(void);
const string g_spray_mat_1 = \
"{\n" \
"cull disable\n" \
"polygonOffset\n" \
"{\n" \
"map $rt:%s\n" \
"blendfunc GL_SRC_COLOR GL_ONE_MINUS_SRC_COLOR\n" \
"rgbGen vertex\n" \
"}\n" \
"}";
const string g_spray_mat_0 = \
"{\n" \
"cull disable\n" \
"polygonOffset\n" \
"{\n" \
"map $rt:%s\n" \
"blendfunc blend\n" \
"rgbGen vertex\n" \
"}\n" \
"}";
#else
void Spray_RemoveAll(entity entOwner);
float Spray_SendEntity(entity ePEnt, float fChanged);
void CSEv_Spraylogo(void);
#endif

View File

@ -14,123 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef SERVER
void
Spray_RemoveAll(entity entOwner)
{
for (entity eFind = world;(eFind = find(eFind, classname, "Spray"));) {
if (eFind.owner == entOwner) {
remove(eFind);
}
}
}
float
Spray_SendEntity(entity ePEnt, float fChanged)
{
if (clienttype(ePEnt) != CLIENTTYPE_REAL)
return (0);
WriteByte(MSG_ENTITY, ENT_SPRAY);
WriteCoord(MSG_ENTITY, self.origin[0]);
WriteCoord(MSG_ENTITY, self.origin[1]);
WriteCoord(MSG_ENTITY, self.origin[2]);
WriteCoord(MSG_ENTITY, self.angles[0]);
WriteCoord(MSG_ENTITY, self.angles[1]);
WriteCoord(MSG_ENTITY, self.angles[2]);
WriteEntity(MSG_ENTITY, self.owner);
return (1);
}
void
CSEv_Spraylogo(void)
{
entity spray;
vector src;
vector co;
src = self.origin + self.view_ofs;
makevectors(self.v_angle);
traceline(src, src + v_forward * 128, FALSE, self);
if (trace_fraction >= 1.0f) {
return;
}
/* we only allow one active spray */
Spray_RemoveAll(self);
/* spawn the new one */
spray = spawn();
spray.classname = "Spray";
spray.owner = self;
spray.solid = SOLID_NOT;
setorigin(spray, trace_endpos);
/* calculate the rotation by taking our current view and mapping it
* against the surface we're looking at */
makevectors([self.v_angle[0] * -1, self.v_angle[1], self.v_angle[2]]);
co = v_forward -(v_forward * trace_plane_normal) * trace_plane_normal;
/* quick fix */
if (trace_plane_normal[2] == 0) {
co = '0 0 1';
}
/* apply the angles and apply networking */
spray.angles = vectoangles(co, trace_plane_normal);
spray.SendEntity = Spray_SendEntity;
spray.SendFlags = 1;
Sound_Play(self, CHAN_VOICE, "player.spraylogo");
}
#endif
#ifdef CLIENT
/** This entity class represents a NSClientPlayer their spraylogo. */
class NSSpraylogo:NSEntity
{
private:
vector m_vecColor;
vector m_vecPosition;
vector m_vecAngles;
int m_iOwnerID;
string m_strName;
string m_m_strPath;
bool m_bInitialized;
bool m_bMonochrome;
public:
void NSSpraylogo(void);
virtual float predraw(void);
virtual void RendererRestarted(void);
};
const string g_spray_mat_1 = \
"{\n" \
"cull disable\n" \
"polygonOffset\n" \
"{\n" \
"map $rt:%s\n" \
"blendfunc GL_SRC_COLOR GL_ONE_MINUS_SRC_COLOR\n" \
"rgbGen vertex\n" \
"}\n" \
"}";
const string g_spray_mat_0 = \
"{\n" \
"cull disable\n" \
"polygonOffset\n" \
"{\n" \
"map $rt:%s\n" \
"blendfunc blend\n" \
"rgbGen vertex\n" \
"}\n" \
"}";
void
NSSpraylogo::RendererRestarted(void)
{
@ -215,4 +99,77 @@ Spray_Parse(void)
spSelf.m_m_strPath = sprintf("simg_%i_%d", spSelf.m_iOwnerID, spSelf.m_bMonochrome);
spSelf.m_vecColor = stov(getplayerkeyvalue(spSelf.m_iOwnerID, "spraycolor"));
}
#else
void
Spray_RemoveAll(entity entOwner)
{
for (entity eFind = world;(eFind = find(eFind, classname, "Spray"));) {
if (eFind.owner == entOwner) {
remove(eFind);
}
}
}
float
Spray_SendEntity(entity ePEnt, float fChanged)
{
if (clienttype(ePEnt) != CLIENTTYPE_REAL)
return (0);
WriteByte(MSG_ENTITY, ENT_SPRAY);
WriteCoord(MSG_ENTITY, self.origin[0]);
WriteCoord(MSG_ENTITY, self.origin[1]);
WriteCoord(MSG_ENTITY, self.origin[2]);
WriteCoord(MSG_ENTITY, self.angles[0]);
WriteCoord(MSG_ENTITY, self.angles[1]);
WriteCoord(MSG_ENTITY, self.angles[2]);
WriteEntity(MSG_ENTITY, self.owner);
return (1);
}
void
CSEv_Spraylogo(void)
{
entity spray;
vector src;
vector co;
src = self.origin + self.view_ofs;
makevectors(self.v_angle);
traceline(src, src + v_forward * 128, FALSE, self);
if (trace_fraction >= 1.0f) {
return;
}
/* we only allow one active spray */
Spray_RemoveAll(self);
/* spawn the new one */
spray = spawn();
spray.classname = "Spray";
spray.owner = self;
spray.solid = SOLID_NOT;
setorigin(spray, trace_endpos);
/* calculate the rotation by taking our current view and mapping it
* against the surface we're looking at */
makevectors([self.v_angle[0] * -1, self.v_angle[1], self.v_angle[2]]);
co = v_forward -(v_forward * trace_plane_normal) * trace_plane_normal;
/* quick fix */
if (trace_plane_normal[2] == 0) {
co = '0 0 1';
}
/* apply the angles and apply networking */
spray.angles = vectoangles(co, trace_plane_normal);
spray.SendEntity = Spray_SendEntity;
spray.SendFlags = 1;
Sound_Play(self, CHAN_VOICE, "player.spraylogo");
}
#endif

View File

@ -59,6 +59,7 @@ string __fullspawndata;
#include "NSMonster.h"
#include "NSTalkMonster.h"
#include "NSProjectile.h"
#include "NSSpraylogo.h"
#include "../xr/defs.h"
#include "NSClient.h"

View File

@ -27,6 +27,7 @@ player_pmove.qc
propdata.qc
surfaceproperties.qc
NSMaterial.qc
NSSpraylogo.qc
util.qc
weapons.qc