New render code

This commit is contained in:
Vulpovile
2021-03-13 19:07:15 -08:00
parent 8b4460c104
commit cdba7f6eee
18 changed files with 348 additions and 576 deletions

View File

@@ -2,7 +2,7 @@
#include <G3DAll.h>
#include "propertyGrid.h"
#include "map"
#include "Properties/BoolProperty.h"
//#include "Properties/BoolProperty.h"
class Instance
{

View File

@@ -48,20 +48,8 @@ public:
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;
@@ -71,14 +59,6 @@ private:
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;

View File

@@ -19,7 +19,7 @@ public:
static const int patch;
static G3D::TextureRef surface;
static int surfaceId;
static const std::string g_PlaceholderName;
static const std::string g_appName;
static COLORREF g_acrCustClr[16]; //Will be dynamic later
static HWND mainHwnd;
};
@@ -38,4 +38,4 @@ extern std::string cameraSound;
extern std::string clickSound;
extern std::string dingSound;
extern HWND mainHwnd;
const std::string g_PlaceholderName = "Dygysphere";
const std::string g_appName = "Blocks3D";

View File

@@ -1,13 +1,12 @@
#pragma once
#include "Property.h"
#pragma once
class BoolProperty : public Property<bool>
{
public:
template <typename T>
BoolProperty(std::string name, bool& value)
BoolProperty(std::string name, bool& value, Instance& owner)
{
Property(name, (T)value);
Property<bool>(name, value, owner);
}
~BoolProperty(void);
PROPGRIDITEM getPropGridItem();
};

View File

@@ -1,19 +1,30 @@
#pragma once
#include "propertyGrid.h"
#include "DataModelV2/Instance.h"
#include <string>
class Instance;
template <typename T>
class Property
{
public:
Property(std::string name, T& value)
Property(std::string name, T& value, Instance& owner)
{
value = t;
_value = value;
_owner = owner;
}
~Property(void);
T getValue();
void setValue(T);
PROPGRIDITEM getPropGridItem();
const T getValue()
{
return _value;
}
const void setValue(T val)
{
_value = val;
}
virtual PROPGRIDITEM getPropGridItem();
void setProperty(LPPROPGRIDITEM item);
protected:
std::string name;
T* value;
Instance* _owner;
std::string _name;
T* _value;
};