Revert "Added additional build time arguments ess_entity_base_class and ess_entity_base_class_include. It does not work too well, it is going to be reverted, but I want to save the code in case it's needed later."

This reverts commit c26a47273b.
This commit is contained in:
Relintai 2022-02-21 01:36:40 +01:00
parent c26a47273b
commit 3536f01bac
3 changed files with 5 additions and 30 deletions

4
SCsub
View File

@ -4,10 +4,6 @@ Import('env')
module_env = env.Clone()
if "ess_entity_base_class" in module_env:
module_env.Append(CPPDEFINES=[('ESS_ENTITY_BASE_CLASS', module_env["ess_entity_base_class"])])
module_env.Append(CPPDEFINES=[('ESS_ENTITY_BASE_CLASS_INCLUDE', module_env["ess_entity_base_class_include"])])
if os.path.isdir('../mesh_data_resource'):
module_env.Append(CPPDEFINES=['MESH_DATA_RESOURCE_PRESENT'])

View File

@ -5,14 +5,7 @@ def can_build(env, platform):
def configure(env):
from SCons.Script import Variables, Help
envvars = Variables()
envvars.Add("ess_entity_base_class", "What class Entity should inherit from. Default is Node.")
envvars.Add("ess_entity_base_class_include", "What The include for that class. Default is scene/main/node.h")
envvars.Update(env)
Help(envvars.GenerateHelpText(env))
pass
def get_doc_classes():

View File

@ -37,6 +37,8 @@ SOFTWARE.
#include "core/io/networked_multiplayer_peer.h"
#include "scene/main/node.h"
#include "../data/items/craft_recipe.h"
#include "../data/items/item_instance.h"
#include "../data/spells/spell.h"
@ -67,22 +69,6 @@ SOFTWARE.
#include spatial_h_path
#ifndef ESS_ENTITY_BASE_CLASS
// By default Entity inherits from Node
#define ENTITY_BASE_CLASS Node
#include "scene/main/node.h"
#else
// We turn the ESS_ENTITY_BASE_CLASS define into a text replace macro
#define ENTITY_BASE_CLASS ESS_ENTITY_BASE_CLASS
// Abuse pre-processor macros to quote what's inside the ESS_ENTITY_BASE_CLASS_INCLUDE define
#define _ENTITY_BASE_CLASS_QUOTE(x) #x
#define _ENTITY_BASE_CLASS_QUOTE_H(x) _ENTITY_BASE_CLASS_QUOTE(x)
#include _ENTITY_BASE_CLASS_QUOTE_H(ESS_ENTITY_BASE_CLASS_INCLUDE)
#endif
class EntityData;
class AuraData;
class Spell;
@ -250,8 +236,8 @@ struct EntityStat {
} \
variable = value;
class Entity : public ENTITY_BASE_CLASS {
GDCLASS(Entity, ENTITY_BASE_CLASS);
class Entity : public Node {
GDCLASS(Entity, Node);
public:
//// Base ////