extern XYZ viewer;
extern float fadestart;
extern float texdetail;
-extern bool decals;
-
-extern bool visibleloading;
+extern bool decalstoggle;
int Model::LineCheck(XYZ *p1, XYZ *p2, XYZ *p, XYZ *move, float *rotate)
{
return firstintersecting;
}
-int Model::LineCheckSlidePossible(XYZ *p1, XYZ *p2, XYZ *p, XYZ *move, float *rotate)
+int Model::LineCheckSlidePossible(XYZ *p1, XYZ *p2, XYZ *move, float *rotate)
{
static int j;
static float distance;
}
}
-bool Model::loadnotex(const std::string& filename )
+bool Model::loadnotex(const std::string& filename)
{
FILE *tfile;
long i;
}
-bool Model::load(const std::string& filename, bool texture )
+bool Model::load(const std::string& filename)
{
FILE *tfile;
long i;
LOG(std::string("Loading model...") + filename);
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
type = normaltype;
color = 0;
return true;
}
-bool Model::loaddecal(const std::string& filename, bool texture )
+bool Model::loaddecal(const std::string& filename)
{
FILE *tfile;
long i, j;
void Model::CalculateNormals(bool facenormalise)
{
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
static int i;
if (type != normaltype && type != decalstype)
return;
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
-
-#ifndef WIN32
- glLockArraysEXT( 0, TriangleNum * 3);
-#endif
glDrawArrays(GL_TRIANGLES, 0, TriangleNum * 3);
-#ifndef WIN32
- glUnlockArraysEXT();
-#endif
-
if (!color)
glDisableClientState(GL_NORMAL_ARRAY);
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
-
-#ifndef WIN32
- glLockArraysEXT( 0, TriangleNum * 3);
-#endif
glDrawArrays(GL_TRIANGLES, 0, TriangleNum * 3);
-#ifndef WIN32
- glUnlockArraysEXT();
-#endif
-
if (!color)
glDisableClientState(GL_NORMAL_ARRAY);
void Model::drawdecals(Texture shadowtexture, Texture bloodtexture, Texture bloodtexture2, Texture breaktexture)
{
- if (decals) {
+ if (decalstoggle) {
if (type != decalstype)
return;
static int i;
void Model::DeleteDecal(int which)
{
- if (decals) {
+ if (decalstoggle) {
if (type != decalstype)
return;
decaltype[which] = decaltype[numdecals - 1];
void Model::MakeDecal(int atype, XYZ *where, float *size, float *opacity, float *rotation)
{
- if (decals) {
+ if (decalstoggle) {
if (type != decalstype)
return;
void Model::MakeDecal(int atype, XYZ where, float size, float opacity, float rotation)
{
- if (decals) {
+ if (decalstoggle) {
if (type != decalstype)
return;
Model::~Model()
{
deallocate();
- textureptr.destroy();
}
void Model::deallocate()
}
Model::Model()
+ : vertexNum(0), TriangleNum(0),
+ hastexture(0),
+ type(0), oldtype(0),
+ possible(0),
+ owner(0),
+ vertex(0),
+ normals(0),
+ facenormals(0),
+ Triangles(0),
+ vArray(0)
{
- vertexNum = 0, TriangleNum = 0;
- hastexture = 0;
-
- type = 0, oldtype = 0;
-
- possible = 0;
- owner = 0;
- vertex = 0;
- normals = 0;
- facenormals = 0;
- Triangles = 0;
- vArray = 0;
-
memset(&modelTexture, 0, sizeof(modelTexture));
numpossible = 0;
color = 0;
type = nothing;
}
-