Implemented the new g3d spec

This commit is contained in:
mathusummut
2018-06-28 21:36:10 +02:00
parent 90556c870e
commit b1760253fd
24 changed files with 225 additions and 338 deletions

View File

@@ -12,10 +12,14 @@
#ifndef _SHARED_GRAPHICS_GL_MODELRENDERERGL_H_
#define _SHARED_GRAPHICS_GL_MODELRENDERERGL_H_
#include <array>
#include "model_renderer.h"
#include "model.h"
#include "opengl.h"
#include "leak_dumper.h"
#include "texture_gl.h"
using ::Shared::Graphics::Gl::Texture2DGl;
namespace Shared {
namespace Graphics {
@@ -52,6 +56,23 @@ namespace Shared {
void renderMeshNormals(Mesh *mesh);
};
class MeshCallbackTeamColor : public MeshCallback {
private:
const Texture *teamTexture;
public:
MeshCallbackTeamColor() : MeshCallback() {
teamTexture = NULL;
}
void setTeamTexture(const Texture *teamTexture) {
this->teamTexture = teamTexture;
}
virtual void execute(const Mesh *mesh);
static bool noTeamColors;
};
}
}
}//end namespace

View File

@@ -46,7 +46,7 @@ namespace Shared {
class Mesh {
private:
//mesh data
Texture2D *textures[meshTextureCount];
Texture2D * textures[meshTextureCount];
bool texturesOwned[meshTextureCount];
string texturePaths[meshTextureCount];
@@ -75,6 +75,7 @@ namespace Shared {
bool customColor;
bool noSelect;
bool glow;
uint8 factionColorOpacity;
uint32 textureFlags;
@@ -175,6 +176,9 @@ namespace Shared {
bool getCustomTexture() const {
return customColor;
}
uint8 getFactionColorOpacity() const {
return factionColorOpacity;
}
bool getNoSelect() const {
return noSelect;
}
@@ -235,7 +239,7 @@ namespace Shared {
class Model {
private:
TextureManager *textureManager;
TextureManager * textureManager;
private:
uint8 fileVersion;

View File

@@ -72,7 +72,6 @@ namespace Shared {
virtual void render(Model *model, int renderMode = rmNormal, float alpha = 1.0f) = 0;
virtual void renderNormalsOnly(Model *model) = 0;
};
}
}//end namespace