mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-30 20:13:31 +00:00
pragma once everywhere
This commit is contained in:
@@ -1,29 +1,27 @@
|
||||
#ifndef NET_MINECRAFT_CLIENT_MODEL_GEOM__Cube_H__
|
||||
#define NET_MINECRAFT_CLIENT_MODEL_GEOM__Cube_H__
|
||||
|
||||
//package net.minecraft.client.model;
|
||||
|
||||
#include <string>
|
||||
#include "Polygon.h"
|
||||
|
||||
class Tesselator;
|
||||
class ModelPart;
|
||||
|
||||
class Cube
|
||||
{
|
||||
public:
|
||||
Cube(ModelPart* modelPart, int xTexOffs, int yTexOffs, float x0, float y0, float z0, int w, int h, int d, float g);
|
||||
|
||||
void compile(Tesselator& t, float scale);
|
||||
Cube* setId(const std::string& id);
|
||||
private:
|
||||
|
||||
VertexPT vertices[8];
|
||||
PolygonQuad polygons[6];
|
||||
std::string id;
|
||||
const float x0, y0, z0, x1, y1, z1;
|
||||
|
||||
friend class ModelPart;
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_CLIENT_MODEL_GEOM__Cube_H__*/
|
||||
#pragma once
|
||||
|
||||
//package net.minecraft.client.model;
|
||||
|
||||
#include <string>
|
||||
#include "Polygon.h"
|
||||
|
||||
class Tesselator;
|
||||
class ModelPart;
|
||||
|
||||
class Cube
|
||||
{
|
||||
public:
|
||||
Cube(ModelPart* modelPart, int xTexOffs, int yTexOffs, float x0, float y0, float z0, int w, int h, int d, float g);
|
||||
|
||||
void compile(Tesselator& t, float scale);
|
||||
Cube* setId(const std::string& id);
|
||||
private:
|
||||
|
||||
VertexPT vertices[8];
|
||||
PolygonQuad polygons[6];
|
||||
std::string id;
|
||||
const float x0, y0, z0, x1, y1, z1;
|
||||
|
||||
friend class ModelPart;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,74 +1,72 @@
|
||||
#ifndef NET_MINECRAFT_CLIENT_MODEL_GEOM__ModelPart_H__
|
||||
#define NET_MINECRAFT_CLIENT_MODEL_GEOM__ModelPart_H__
|
||||
|
||||
#include "../../renderer/gles.h"
|
||||
|
||||
class Model;
|
||||
class Cube;
|
||||
|
||||
class ModelPart
|
||||
{
|
||||
public:
|
||||
ModelPart(const std::string& id);
|
||||
ModelPart(int xTexOffs = 0, int yTexOffs = 0);
|
||||
ModelPart(Model* model, int xTexOffs = 0, int yTexOffs = 0);
|
||||
~ModelPart();
|
||||
|
||||
void _init();
|
||||
void clear();//const ModelPart& rhs);
|
||||
ModelPart& operator=(const ModelPart& rhs);
|
||||
|
||||
void setModel(Model* model);
|
||||
|
||||
void setPos( float x, float y, float z );
|
||||
void translateTo( float scale );
|
||||
|
||||
ModelPart& setTexSize(int xs, int ys);
|
||||
ModelPart& texOffs(int xTexOffs, int yTexOffs);
|
||||
|
||||
void mimic(const ModelPart* o);
|
||||
|
||||
// Render normally
|
||||
void render( float scale );
|
||||
void renderRollable( float scale );
|
||||
void draw();
|
||||
// Bad, immediate version... //@fix @todo: remove this
|
||||
void renderHorrible(float scale);
|
||||
void drawSlow( float scale );
|
||||
|
||||
void onGraphicsReset() { compiled = false; }
|
||||
void compile( float scale );
|
||||
|
||||
void addChild(ModelPart* child);
|
||||
ModelPart& addBox(const std::string& id, float x0, float y0, float z0, int w, int h, int d);
|
||||
ModelPart& addBox(float x0, float y0, float z0, int w, int h, int d);
|
||||
void addBox(float x0, float y0, float z0, int w, int h, int d, float g);
|
||||
void addTexBox(float x0, float y0, float z0, int w, int h, int d, int tex);
|
||||
|
||||
float x, y, z;
|
||||
float xRot, yRot, zRot;
|
||||
|
||||
bool mirror;
|
||||
bool visible;
|
||||
|
||||
std::vector<Cube*> cubes;
|
||||
std::vector<ModelPart*> children;
|
||||
|
||||
std::string id;
|
||||
|
||||
float xTexSize;
|
||||
float yTexSize;
|
||||
|
||||
private:
|
||||
int xTexOffs, yTexOffs;
|
||||
|
||||
bool neverRender;
|
||||
|
||||
bool compiled;
|
||||
int list;
|
||||
GLuint vboId;
|
||||
|
||||
Model* model;
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_CLIENT_MODEL_GEOM__ModelPart_H__*/
|
||||
#pragma once
|
||||
|
||||
#include "../../renderer/gles.h"
|
||||
|
||||
class Model;
|
||||
class Cube;
|
||||
|
||||
class ModelPart
|
||||
{
|
||||
public:
|
||||
ModelPart(const std::string& id);
|
||||
ModelPart(int xTexOffs = 0, int yTexOffs = 0);
|
||||
ModelPart(Model* model, int xTexOffs = 0, int yTexOffs = 0);
|
||||
~ModelPart();
|
||||
|
||||
void _init();
|
||||
void clear();//const ModelPart& rhs);
|
||||
ModelPart& operator=(const ModelPart& rhs);
|
||||
|
||||
void setModel(Model* model);
|
||||
|
||||
void setPos( float x, float y, float z );
|
||||
void translateTo( float scale );
|
||||
|
||||
ModelPart& setTexSize(int xs, int ys);
|
||||
ModelPart& texOffs(int xTexOffs, int yTexOffs);
|
||||
|
||||
void mimic(const ModelPart* o);
|
||||
|
||||
// Render normally
|
||||
void render( float scale );
|
||||
void renderRollable( float scale );
|
||||
void draw();
|
||||
// Bad, immediate version... //@fix @todo: remove this
|
||||
void renderHorrible(float scale);
|
||||
void drawSlow( float scale );
|
||||
|
||||
void onGraphicsReset() { compiled = false; }
|
||||
void compile( float scale );
|
||||
|
||||
void addChild(ModelPart* child);
|
||||
ModelPart& addBox(const std::string& id, float x0, float y0, float z0, int w, int h, int d);
|
||||
ModelPart& addBox(float x0, float y0, float z0, int w, int h, int d);
|
||||
void addBox(float x0, float y0, float z0, int w, int h, int d, float g);
|
||||
void addTexBox(float x0, float y0, float z0, int w, int h, int d, int tex);
|
||||
|
||||
float x, y, z;
|
||||
float xRot, yRot, zRot;
|
||||
|
||||
bool mirror;
|
||||
bool visible;
|
||||
|
||||
std::vector<Cube*> cubes;
|
||||
std::vector<ModelPart*> children;
|
||||
|
||||
std::string id;
|
||||
|
||||
float xTexSize;
|
||||
float yTexSize;
|
||||
|
||||
private:
|
||||
int xTexOffs, yTexOffs;
|
||||
|
||||
bool neverRender;
|
||||
|
||||
bool compiled;
|
||||
int list;
|
||||
GLuint vboId;
|
||||
|
||||
Model* model;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,29 +1,27 @@
|
||||
#ifndef NET_MINECRAFT_CLIENT_MODEL__Polygon_H__
|
||||
#define NET_MINECRAFT_CLIENT_MODEL__Polygon_H__
|
||||
|
||||
//package net.minecraft.client.model;
|
||||
#include "Vertex.h"
|
||||
|
||||
class Tesselator;
|
||||
|
||||
class PolygonQuad
|
||||
{
|
||||
public:
|
||||
PolygonQuad() {}
|
||||
PolygonQuad(VertexPT*,VertexPT*,VertexPT*,VertexPT*);
|
||||
PolygonQuad(VertexPT*,VertexPT*,VertexPT*,VertexPT*, int u0, int v0, int u1, int v1, float texW = 64.0f, float texH = 32.0f);
|
||||
PolygonQuad(VertexPT*,VertexPT*,VertexPT*,VertexPT*, float u0, float v0, float u1, float v1);
|
||||
|
||||
void mirror();
|
||||
void render(Tesselator& t, float scale, int vboId = -1);
|
||||
PolygonQuad* flipNormal();
|
||||
|
||||
VertexPT vertices[4];
|
||||
//int vertexCount;
|
||||
|
||||
private:
|
||||
static const int VERTEX_COUNT = 4;
|
||||
bool _flipNormal;
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_CLIENT_MODEL__Polygon_H__*/
|
||||
#pragma once
|
||||
|
||||
//package net.minecraft.client.model;
|
||||
#include "Vertex.h"
|
||||
|
||||
class Tesselator;
|
||||
|
||||
class PolygonQuad
|
||||
{
|
||||
public:
|
||||
PolygonQuad() {}
|
||||
PolygonQuad(VertexPT*,VertexPT*,VertexPT*,VertexPT*);
|
||||
PolygonQuad(VertexPT*,VertexPT*,VertexPT*,VertexPT*, int u0, int v0, int u1, int v1, float texW = 64.0f, float texH = 32.0f);
|
||||
PolygonQuad(VertexPT*,VertexPT*,VertexPT*,VertexPT*, float u0, float v0, float u1, float v1);
|
||||
|
||||
void mirror();
|
||||
void render(Tesselator& t, float scale, int vboId = -1);
|
||||
PolygonQuad* flipNormal();
|
||||
|
||||
VertexPT vertices[4];
|
||||
//int vertexCount;
|
||||
|
||||
private:
|
||||
static const int VERTEX_COUNT = 4;
|
||||
bool _flipNormal;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,40 +1,38 @@
|
||||
#ifndef NET_MINECRAFT_CLIENT_MODEL__Vertex_H__
|
||||
#define NET_MINECRAFT_CLIENT_MODEL__Vertex_H__
|
||||
|
||||
//package net.minecraft.client.model;
|
||||
|
||||
#include "../../../world/phys/Vec3.h"
|
||||
|
||||
class VertexPT
|
||||
{
|
||||
public:
|
||||
Vec3 pos;
|
||||
|
||||
float u, v;
|
||||
|
||||
VertexPT() {}
|
||||
|
||||
VertexPT(float x, float y, float z, float u_, float v_)
|
||||
: pos(x, y, z),
|
||||
u(u_),
|
||||
v(v_)
|
||||
{}
|
||||
|
||||
VertexPT remap(float u, float v) {
|
||||
return VertexPT(*this, u, v);
|
||||
}
|
||||
|
||||
VertexPT(const VertexPT& vertex, float u_, float v_) {
|
||||
pos = vertex.pos;
|
||||
u = u_;
|
||||
v = v_;
|
||||
}
|
||||
|
||||
VertexPT(const Vec3& pos_, float u_, float v_) {
|
||||
pos = pos_;
|
||||
u = u_;
|
||||
v = v_;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_CLIENT_MODEL__Vertex_H__*/
|
||||
#pragma once
|
||||
|
||||
//package net.minecraft.client.model;
|
||||
|
||||
#include "../../../world/phys/Vec3.h"
|
||||
|
||||
class VertexPT
|
||||
{
|
||||
public:
|
||||
Vec3 pos;
|
||||
|
||||
float u, v;
|
||||
|
||||
VertexPT() {}
|
||||
|
||||
VertexPT(float x, float y, float z, float u_, float v_)
|
||||
: pos(x, y, z),
|
||||
u(u_),
|
||||
v(v_)
|
||||
{}
|
||||
|
||||
VertexPT remap(float u, float v) {
|
||||
return VertexPT(*this, u, v);
|
||||
}
|
||||
|
||||
VertexPT(const VertexPT& vertex, float u_, float v_) {
|
||||
pos = vertex.pos;
|
||||
u = u_;
|
||||
v = v_;
|
||||
}
|
||||
|
||||
VertexPT(const Vec3& pos_, float u_, float v_) {
|
||||
pos = pos_;
|
||||
u = u_;
|
||||
v = v_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user