From 59f66523960c1d1a68737aaf322583e1163e3f31 Mon Sep 17 00:00:00 2001 From: andreja6 Date: Tue, 10 Apr 2018 21:59:55 -0700 Subject: [PATCH] Added instance types I feel like the way it works now isn't the best --- G3DTest.suo | Bin 10240 -> 12288 bytes G3DTest.vcproj | 8 ++++++++ Instance.cpp | 16 ++++++++++++++++ Instance.h | 5 +++++ PhysicalInstance.cpp | 26 ++++++++++++++++++++++++++ PhysicalInstance.h | 10 ++++++++++ main.cpp | 10 +++++++++- 7 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 PhysicalInstance.cpp create mode 100644 PhysicalInstance.h diff --git a/G3DTest.suo b/G3DTest.suo index b97defc4fe6fcbc8c11d5c731d0172350351671c..2ee9c137b479be7e7898b161d9eb9f8a548df7f0 100644 GIT binary patch delta 1778 zcma)+?{8C87{|}OyS=^bx~=Ov*0HjVmAZu?4%`O*K+9k-bXi*+!X{`JAPloil+J8Z zScgiCykUL(127>WVK2Zm@im4S4T*`1iM}yLU->hdMG_e?tKaXvw+4k6pXSr^obNs7 zp68tVJSU&dXRmG7*N2r-K~M`qpbpf7)l#XnhV2KL%UZ!0&?2&Av{YUFc|NuDg;s$l z$%xDtH?0P^7+aDH@%DnxkSWiA*#xa#$+fnPk`Eek+cRbyfFwuF$BjdDE}7%TVLD-N zdtVw(25`w|(GI!(b8dSO?JyVt&$}AOz5xG4kfk=CnGL@3-pF^muJom@6e@>vy$3ra zV|5mjmZ4jWw;ZJ8{3*F%Y?14T_O^dO7L88HRi;e?gM3cZw<^=JI|4b7@@f`zzpDq* zripH~yScDYoT@rd@#wfQtogabgs!weXElZ>rB&p&A71s@zVmmtZ!1Af()9zfzjmZ% zpPEpoR8EbeJ)(}uhqb+h(3HNQ%S`Bu)+H;Un_d;gtdPBScmv$C&TEzGQQhhhwY3m# z?5|V*8H}kAq2|o1Lem01Tj&b?w)$&{`cvqSf(prm8;bdGzoF~)f@T7$p~;=dKG_x7 zA^FC$4gKmE1|P-$t9a2KbwZ89KP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(5LuJeC3qd{JwBNM=_%g zr&jIsyRP4owJ7u!mgz>6HgK)I)YZJZ(Ao;EI%I7ze9!43E=`2Y&q3WcC3#LNq|L2NOI8E#fILTq~>W~ERk#Fm7Z@&9H3VmkmaYk&?x zY{!K-T!6gDU;znn7M>HEp>vvzXjTn>QL`(WRl%n;OKVn5%MIR%Js6Ga8GbzO%8xOn z*>lZ!n=dqbsTr?6uh~1zxc&>o-_2LeTH%)8GrsF@ z5Zfuu_~RVn0@$!-TM& + + + + #include "Instance.h" +std::string name; +Instance* parent; +static const int BASE_INSTANCE = 0; +static const int PHYSICAL_INSTANCE = 1; +static const int type = BASE_INSTANCE; + Instance::Instance(void) { + name = "Default Game Instance"; } Instance::~Instance(void) { + name = "Default Game Instance"; } +int getType() +{ + return type; +} + + + diff --git a/Instance.h b/Instance.h index 31719c4..ca35656 100644 --- a/Instance.h +++ b/Instance.h @@ -5,4 +5,9 @@ class Instance public: Instance(void); ~Instance(void); + std::string name; + int getType(); + Instance* parent; // Another pointer. + static const int BASE_INSTANCE; + static const int PHYSICAL_INSTANCE; }; diff --git a/PhysicalInstance.cpp b/PhysicalInstance.cpp new file mode 100644 index 0000000..4e21366 --- /dev/null +++ b/PhysicalInstance.cpp @@ -0,0 +1,26 @@ +#include +#include "PhysicalInstance.h" + + +bool collides = true; +bool anchored = false; +Vector3 size; +Vector3 position; +Color3 color; +//static const int type = PHYSICAL_INSTANCE; + +PhysicalInstance::PhysicalInstance(void) +{ + name = "Default PhysicalInstance"; + collides = true; + anchored = true; + size = Vector3(2,1,4); + position = Vector3(0,0,0); + color = Color3::gray(); +} + +PhysicalInstance::~PhysicalInstance(void) +{ +} + + diff --git a/PhysicalInstance.h b/PhysicalInstance.h new file mode 100644 index 0000000..7cdde93 --- /dev/null +++ b/PhysicalInstance.h @@ -0,0 +1,10 @@ +#pragma once +#include "instance.h" + +class PhysicalInstance : + public Instance +{ +public: + PhysicalInstance(void); + ~PhysicalInstance(void); +}; diff --git a/main.cpp b/main.cpp index 3a651eb..edf9e7b 100644 --- a/main.cpp +++ b/main.cpp @@ -12,6 +12,7 @@ */ #include #include "Instance.h" +#include "PhysicalInstance.h" #if G3D_VER < 61000 #error Requires G3D 6.10 @@ -19,6 +20,7 @@ static const float VNUM = 0.01F; static const std::string VERSION = "PRE-ALPHA "; static std::vector Instances; +static Instance* dataModel; static GFontRef fntdominant = NULL; static GFontRef fntlighttrek = NULL; static bool democ = true; @@ -93,11 +95,17 @@ std::string Convert (float number){ void Demo::onInit() { // Called before Demo::run() beings + dataModel = new Instance(); + //dataModel->name = "undefined"; + dataModel->parent = NULL; + + PhysicalInstance* test = new PhysicalInstance(); setDesiredFrameRate(FPSVal[index]); app->debugCamera.setPosition(Vector3(0, 2, 10)); app->debugCamera.lookAt(Vector3(0, 2, 0)); //std::string str = "Dynamica Duomillenium 5 Version " + VERSION + Convert(VNUM); - std::string str = "Game \"undefined\""; + std::string str = "Game \"" + dataModel->name + "\""; + app->renderDevice->setCaption(str); GApplet::onInit(); }