Removed DataModel V2
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
#include <G3DAll.h>
|
||||
#include "PropertyWindow.h"
|
||||
#include "DataModelV2/TextButtonInstance.h"
|
||||
#include "DataModelV2/ImageButtonInstance.h"
|
||||
#include "DataModel/TextButtonInstance.h"
|
||||
#include "DataModel/ImageButtonInstance.h"
|
||||
#include "CameraController.h"
|
||||
#include "IEBrowser.h"
|
||||
#include "Mouse.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <G3DAll.h>
|
||||
#include "DataModelV2/Instance.h"
|
||||
#include "DataModel/Instance.h"
|
||||
#include "Globals.h"
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#pragma once
|
||||
#include "Instance.h"
|
||||
#include "Listener/ButtonListener.h"
|
||||
|
||||
class ButtonListener;
|
||||
class Instance;
|
||||
|
||||
class BaseButtonInstance : public Instance
|
||||
{
|
||||
public:
|
||||
BaseButtonInstance(void);
|
||||
virtual ~BaseButtonInstance(void);
|
||||
virtual void render(RenderDevice* rd);
|
||||
virtual void drawObj(RenderDevice* rd, Vector2 mousePos, bool mouseDown);
|
||||
virtual bool mouseInButton(float, float, RenderDevice* rd);
|
||||
virtual void onMouseClick();
|
||||
void setButtonListener(ButtonListener*);
|
||||
bool floatBottom;
|
||||
bool floatRight;
|
||||
bool floatCenter;
|
||||
volatile bool disabled;
|
||||
bool selected;
|
||||
protected:
|
||||
bool mouseInArea(float, float, float, float, float, float);
|
||||
class ButtonListener* listener;
|
||||
};
|
||||
@@ -1,57 +0,0 @@
|
||||
#pragma once
|
||||
#include "WorkspaceInstance.h"
|
||||
#include "LevelInstance.h"
|
||||
#include "PartInstance.h"
|
||||
#include "rapidxml/rapidxml.hpp"
|
||||
#include "GuiRootInstance.h"
|
||||
|
||||
class GuiRootInstance;
|
||||
|
||||
class DataModelInstance :
|
||||
public Instance
|
||||
{
|
||||
public:
|
||||
DataModelInstance(void);
|
||||
~DataModelInstance(void);
|
||||
void setMessage(std::string);
|
||||
void setMessageBrickCount();
|
||||
void clearMessage();
|
||||
bool debugGetOpen();
|
||||
bool getOpen();
|
||||
bool load(const char* filename,bool clearObjects);
|
||||
bool readXMLFileStream(std::ifstream* file);
|
||||
void drawMessage(RenderDevice*);
|
||||
WorkspaceInstance* getWorkspace();
|
||||
LevelInstance * getLevel();
|
||||
std::string message;
|
||||
std::string _loadedFileName;
|
||||
bool showMessage;
|
||||
G3D::GFontRef font;
|
||||
GuiRootInstance* getGuiRoot();
|
||||
//float mousex;
|
||||
//float mousey;
|
||||
//Vector2 getMousePos();
|
||||
//void setMousePos(int x,int y);
|
||||
//void setMousePos(Vector2 pos);
|
||||
//bool mouseButton1Down;
|
||||
PartInstance* makePart();
|
||||
void clearLevel();
|
||||
void toggleRun();
|
||||
bool isRunning();
|
||||
#if _DEBUG
|
||||
void modXMLLevel(float modY);
|
||||
#endif
|
||||
private:
|
||||
bool isBrickCount;
|
||||
bool scanXMLObject(rapidxml::xml_node<>* node);
|
||||
rapidxml::xml_node<>* getNode(rapidxml::xml_node<> * node,const char* name );
|
||||
float getFloatValue(rapidxml::xml_node<> * node,const char* name);
|
||||
bool _successfulLoad;
|
||||
std::string _errMsg;
|
||||
bool _legacyLoad;
|
||||
float _modY;
|
||||
WorkspaceInstance* workspace;
|
||||
LevelInstance * level;
|
||||
GuiRootInstance* guiRoot;
|
||||
bool running;
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
#include "PartInstance.h"
|
||||
|
||||
class GroupInstance :
|
||||
public PVInstance
|
||||
{
|
||||
public:
|
||||
GroupInstance(void);
|
||||
~GroupInstance(void);
|
||||
GroupInstance(const GroupInstance &oinst);
|
||||
virtual std::vector<PROPGRIDITEM> getProperties();
|
||||
virtual void PropUpdate(LPPROPGRIDITEM &pItem);
|
||||
std::vector<Instance *> unGroup();
|
||||
PartInstance * primaryPart;
|
||||
void render(RenderDevice * r);
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
#pragma once
|
||||
#include "Instance.h"
|
||||
|
||||
class ImageButtonInstance;
|
||||
|
||||
class TextButtonInstance;
|
||||
|
||||
class GuiRootInstance : public Instance
|
||||
{
|
||||
public:
|
||||
GuiRootInstance();
|
||||
GuiRootInstance::~GuiRootInstance();
|
||||
TextButtonInstance* makeTextButton();
|
||||
void drawButtons(RenderDevice* rd);
|
||||
ImageButtonInstance* makeImageButton(G3D::TextureRef newImage, G3D::TextureRef overImage, G3D::TextureRef downImage, G3D::TextureRef disableImage);
|
||||
void renderGUI(G3D::RenderDevice* rd, double fps);
|
||||
void setDebugMessage(std::string msg, G3D::RealTime msgTime);
|
||||
void update();
|
||||
bool mouseInGUI(G3D::RenderDevice* renderDevice,int x,int y);
|
||||
void onMouseLeftUp(G3D::RenderDevice* renderDevice, int x,int y);
|
||||
private:
|
||||
std::string _message;
|
||||
G3D::RealTime _messageTime;
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
#pragma once
|
||||
#include "BaseButtonInstance.h"
|
||||
|
||||
class BaseButtonInstance;
|
||||
|
||||
class ImageButtonInstance : public BaseButtonInstance
|
||||
{
|
||||
public:
|
||||
//ImageButtonInstance(G3D::TextureRef);
|
||||
//ImageButtonInstance(G3D::TextureRef,G3D::TextureRef);
|
||||
//ImageButtonInstance(G3D::TextureRef,G3D::TextureRef,G3D::TextureRef);
|
||||
ImageButtonInstance(G3D::TextureRef,G3D::TextureRef,G3D::TextureRef,G3D::TextureRef);
|
||||
~ImageButtonInstance(void);
|
||||
void drawObj(RenderDevice*, Vector2, bool);
|
||||
Vector2 size;
|
||||
Vector2 position;
|
||||
|
||||
G3D::TextureRef image;
|
||||
int openGLID;
|
||||
G3D::TextureRef image_ovr;
|
||||
int openGLID_ovr;
|
||||
G3D::TextureRef image_dn;
|
||||
int openGLID_dn;
|
||||
G3D::TextureRef image_ds;
|
||||
int openGLID_ds;
|
||||
bool mouseInButton(float, float, RenderDevice*);
|
||||
};
|
||||
@@ -1,37 +0,0 @@
|
||||
#pragma once
|
||||
#include <G3DAll.h>
|
||||
#include "propertyGrid.h"
|
||||
#include "map"
|
||||
|
||||
class Instance
|
||||
{
|
||||
public:
|
||||
bool canDelete;
|
||||
Instance(void);
|
||||
Instance(const Instance&);
|
||||
virtual ~Instance(void);
|
||||
std::string name;
|
||||
virtual void render(RenderDevice*);
|
||||
virtual void update();
|
||||
std::vector<Instance*> children; // All children.
|
||||
std::string getClassName();
|
||||
Instance* findFirstChild(std::string);
|
||||
std::vector<Instance* > getChildren();
|
||||
std::vector<Instance* > getAllChildren();
|
||||
virtual void setParent(Instance*);
|
||||
void setName(std::string newName);
|
||||
void addChild(Instance*);
|
||||
void removeChild(Instance*);
|
||||
void clearChildren();
|
||||
Instance* getParent();
|
||||
virtual Instance* clone() const { return new Instance(*this); }
|
||||
virtual std::vector<PROPGRIDITEM> getProperties();
|
||||
virtual void PropUpdate(LPPROPGRIDITEM &pItem);
|
||||
int listicon;
|
||||
protected:
|
||||
std::string className;
|
||||
Instance* parent; // Another pointer.
|
||||
PROPGRIDITEM createPGI(LPSTR catalog, LPSTR propName, LPSTR propDesc, LPARAM curVal, INT type, TCHAR choices[] = NULL);
|
||||
private:
|
||||
static const std::map<std::string, Instance> g_logLevelsDescriptions;
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
#include "instance.h"
|
||||
|
||||
class LevelInstance :
|
||||
public Instance
|
||||
{
|
||||
public:
|
||||
LevelInstance(void);
|
||||
~LevelInstance(void);
|
||||
float timer;
|
||||
int score;
|
||||
virtual std::vector<PROPGRIDITEM> getProperties();
|
||||
std::string winMessage;
|
||||
std::string loseMessage;
|
||||
virtual void PropUpdate(LPPROPGRIDITEM &pItem);
|
||||
};
|
||||
@@ -1,34 +0,0 @@
|
||||
#pragma once
|
||||
#include "instance.h"
|
||||
#include "enum.h"
|
||||
|
||||
class PVInstance :
|
||||
public Instance
|
||||
{
|
||||
public:
|
||||
PVInstance(void);
|
||||
~PVInstance(void);
|
||||
PVInstance(const PVInstance &oinst);
|
||||
virtual void postRender(RenderDevice* rd);
|
||||
virtual std::vector<PROPGRIDITEM> getProperties();
|
||||
virtual void PropUpdate(LPPROPGRIDITEM &pItem);
|
||||
bool nameShown;
|
||||
bool controllerFlagShown;
|
||||
Enum::Controller::Value controller;
|
||||
protected:
|
||||
static G3D::Color3 getControllerColor(int controller)
|
||||
{
|
||||
switch(controller)
|
||||
{
|
||||
case Enum::Controller::KeyboardLeft:
|
||||
return Color3::red();
|
||||
case Enum::Controller::KeyboardRight:
|
||||
return Color3::blue();
|
||||
case Enum::Controller::Chase:
|
||||
return Color3::black();
|
||||
case Enum::Controller::Flee:
|
||||
return Color3::yellow();
|
||||
}
|
||||
return Color3::gray();
|
||||
}
|
||||
};
|
||||
@@ -1,85 +0,0 @@
|
||||
#pragma once
|
||||
#include "PVInstance.h"
|
||||
#include "Enum.h"
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <cmath>
|
||||
|
||||
#define NEW_BOX_RENDER
|
||||
|
||||
class PartInstance : public PVInstance
|
||||
{
|
||||
public:
|
||||
|
||||
PartInstance(void);
|
||||
PartInstance(const PartInstance &oinst);
|
||||
Instance* clone() const { return new PartInstance(*this); }
|
||||
virtual void PartInstance::postRender(RenderDevice* rd);
|
||||
~PartInstance(void);
|
||||
virtual void render(RenderDevice*);
|
||||
Enum::SurfaceType::Value top;
|
||||
Enum::SurfaceType::Value front;
|
||||
Enum::SurfaceType::Value right;
|
||||
Enum::SurfaceType::Value back;
|
||||
Enum::SurfaceType::Value left;
|
||||
Enum::SurfaceType::Value bottom;
|
||||
Enum::Shape::Value shape;
|
||||
CoordinateFrame cFrame;
|
||||
Color3 color;
|
||||
Vector3 getPosition();
|
||||
Vector3 getVelocity();
|
||||
Vector3 getRotVelocity();
|
||||
void setParent(Instance* parent);
|
||||
void setPosition(Vector3);
|
||||
void setVelocity(Vector3);
|
||||
bool collides(PartInstance * part);
|
||||
void setRotVelocity(Vector3);
|
||||
CoordinateFrame getCFrame();
|
||||
void setCFrame(CoordinateFrame);
|
||||
Box getBox();
|
||||
Sphere getSphere();
|
||||
Box getScaledBox();
|
||||
CoordinateFrame getCFrameRenderBased();
|
||||
Vector3 getSize();
|
||||
void setSize(Vector3);
|
||||
void setShape(Enum::Shape::Value shape);
|
||||
bool canCollide;
|
||||
bool anchored;
|
||||
bool collides(Box);
|
||||
virtual std::vector<PROPGRIDITEM> getProperties();
|
||||
virtual void PropUpdate(LPPROPGRIDITEM &pItem);
|
||||
#ifdef NEW_BOX_RENDER
|
||||
void addVertex(Vector3 vertexPos,Color3 color);
|
||||
void addNormals(Vector3 normal);
|
||||
void addSingularNormal(Vector3 normal);
|
||||
void addTriangle(Vector3 vertexPos,Vector3 vertexPos2, Vector3 vertexPos3);
|
||||
void addQuad(Vector3 v1,Vector3 v2, Vector3 v3, Vector3 v4);
|
||||
void genSmoothNormals(int);
|
||||
void addSmoothTriangle(Vector3 vertexPos,Vector3 vertexPos2, Vector3 vertexPos3);
|
||||
void makeSmoothFace(int vertex1, int vertex2, int vertex3);
|
||||
void addPlus(Vector3 v1);
|
||||
void addPlus2(Vector3 v1);
|
||||
void debugPrintVertexIDs(RenderDevice* rd, GFontRef font, Matrix3 camRot);
|
||||
void makeFace(int vertex1, int vertex2, int vertex3);
|
||||
void fromArrays(float verts[], float norms[], float ind[], unsigned int countVN, unsigned int countInd);
|
||||
bool isUniqueVertex(Vector3 pos);
|
||||
#endif
|
||||
private:
|
||||
Vector3 position;
|
||||
Vector3 size;
|
||||
Vector3 velocity;
|
||||
Vector3 rotVelocity;
|
||||
float _bevelSize;
|
||||
int _parseVert;
|
||||
int _debugTimer;
|
||||
std::vector<Vector3> _debugUniqueVertices;
|
||||
#ifdef NEW_BOX_RENDER
|
||||
std::vector<GLfloat> _vertices;
|
||||
std::vector<GLfloat> _normals;
|
||||
#else
|
||||
GLfloat _vertices[96];
|
||||
#endif
|
||||
std::vector<GLushort> _indices;
|
||||
bool changed;
|
||||
Box itemBox;
|
||||
GLuint glList;
|
||||
};
|
||||
@@ -1,35 +0,0 @@
|
||||
#pragma once
|
||||
#include "BaseButtonInstance.h"
|
||||
class TextButtonInstance : public BaseButtonInstance
|
||||
{
|
||||
public:
|
||||
TextButtonInstance(void);
|
||||
~TextButtonInstance(void);
|
||||
void setAllColorsSame();
|
||||
Vector2 boxBegin;
|
||||
Vector2 boxEnd;
|
||||
Vector2 fontLocationRelativeTo;
|
||||
Color4 textColor;
|
||||
Color4 textOutlineColor;
|
||||
Color4 boxColor;
|
||||
Color4 boxOutlineColor;
|
||||
Color4 textColorOvr;
|
||||
Color4 textOutlineColorOvr;
|
||||
Color4 boxColorOvr;
|
||||
Color4 boxOutlineColorOvr;
|
||||
Color4 textColorDn;
|
||||
Color4 textOutlineColorDn;
|
||||
Color4 boxColorDn;
|
||||
Color4 boxOutlineColorDn;
|
||||
Color4 textColorDis;
|
||||
Color4 textOutlineColorDis;
|
||||
Color4 boxColorDis;
|
||||
Color4 boxOutlineColorDis;
|
||||
bool centeredWithinBox;
|
||||
std::string title;
|
||||
G3D::GFontRef font;
|
||||
bool visible;
|
||||
int textSize;
|
||||
void drawObj(RenderDevice*, Vector2, bool);
|
||||
bool mouseInButton(float, float, RenderDevice*);
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
#pragma once
|
||||
#include "imagebuttoninstance.h"
|
||||
|
||||
|
||||
class ToggleImageButtonInstance : public ImageButtonInstance
|
||||
{
|
||||
public:
|
||||
//ImageButtonInstance(G3D::TextureRef);
|
||||
//ImageButtonInstance(G3D::TextureRef,G3D::TextureRef);
|
||||
//ImageButtonInstance(G3D::TextureRef,G3D::TextureRef,G3D::TextureRef);
|
||||
ToggleImageButtonInstance(G3D::TextureRef newImage,G3D::TextureRef overImage = NULL,
|
||||
G3D::TextureRef downImage = NULL,
|
||||
G3D::TextureRef disableImage = NULL,
|
||||
G3D::TextureRef newImage2 = NULL,
|
||||
G3D::TextureRef overImage2 = NULL,
|
||||
G3D::TextureRef downImage2 = NULL,
|
||||
G3D::TextureRef disableImage2 = NULL);
|
||||
~ToggleImageButtonInstance(void);
|
||||
void drawObj(RenderDevice*, Vector2, bool);
|
||||
bool checked;
|
||||
G3D::TextureRef image2;
|
||||
int openGLID2;
|
||||
G3D::TextureRef image_ovr2;
|
||||
int openGLID2_ovr;
|
||||
G3D::TextureRef image_dn2;
|
||||
int openGLID2_dn;
|
||||
G3D::TextureRef image_ds2;
|
||||
int openGLID2_ds;
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
#pragma once
|
||||
#include "GroupInstance.h"
|
||||
#include "PartInstance.h"
|
||||
|
||||
class WorkspaceInstance :
|
||||
public GroupInstance
|
||||
{
|
||||
public:
|
||||
WorkspaceInstance(void);
|
||||
~WorkspaceInstance(void);
|
||||
std::vector<PartInstance *> partObjects;
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "DataModelV2/DataModelInstance.h"
|
||||
#include "DataModel/DataModelInstance.h"
|
||||
|
||||
|
||||
class Application;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
//#include "Application.h"
|
||||
#include "DataModelV2/BaseButtonInstance.h"
|
||||
#include "DataModel/BaseButtonInstance.h"
|
||||
|
||||
class BaseButtonInstance;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "DataModelV2/PartInstance.h"
|
||||
#include "DataModel/PartInstance.h"
|
||||
#pragma once
|
||||
#include "DataModelV2/WorkspaceInstance.h"
|
||||
#include "DataModel/WorkspaceInstance.h"
|
||||
|
||||
struct MousePoint{
|
||||
Vector3 position;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "DataModelV2/Instance.h"
|
||||
#include "DataModel/Instance.h"
|
||||
|
||||
class PropertyWindow {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user