You need to sign in or sign up before continuing.
Commit a61e2d65 authored by hybrid's avatar hybrid

Fixed doc typos mentioned by Dorth.

Added scalar value operations to vector2d.
Reindentation of Q3 code.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1033 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 8f8702c7
...@@ -280,7 +280,7 @@ namespace video ...@@ -280,7 +280,7 @@ namespace video
results of this operation are not defined. results of this operation are not defined.
\param vertices: Pointer to array of vertices. \param vertices: Pointer to array of vertices.
\param vertexCount: Amount of vertices in the array. \param vertexCount: Amount of vertices in the array.
\param indexList: Pointer to array of indizes. \param indexList: Pointer to array of indices.
\param triangleCount: amount of Triangles. \param triangleCount: amount of Triangles.
\param vType: Vertex type, e.g. EVT_STANDARD for S3DVertex. \param vType: Vertex type, e.g. EVT_STANDARD for S3DVertex.
\param pType: Primitive type, e.g. EPT_TRIANGLE_FAN for a triangle fan. */ \param pType: Primitive type, e.g. EPT_TRIANGLE_FAN for a triangle fan. */
...@@ -293,8 +293,8 @@ namespace video ...@@ -293,8 +293,8 @@ namespace video
results of this operation are not defined. results of this operation are not defined.
\param vertices: Pointer to array of vertices. \param vertices: Pointer to array of vertices.
\param vertexCount: Amount of vertices in the array. \param vertexCount: Amount of vertices in the array.
\param indexList: Pointer to array of indizes. \param indexList: Pointer to array of indices.
\param triangleCount: amount of Triangles. Usually amount of indizes / 3. */ \param triangleCount: amount of Triangles. Usually amount of indices / 3. */
virtual void drawIndexedTriangleList(const S3DVertex* vertices, virtual void drawIndexedTriangleList(const S3DVertex* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) = 0; u32 vertexCount, const u16* indexList, u32 triangleCount) = 0;
...@@ -305,8 +305,8 @@ namespace video ...@@ -305,8 +305,8 @@ namespace video
results of this operation are not defined. results of this operation are not defined.
\param vertices: Pointer to array of vertices. \param vertices: Pointer to array of vertices.
\param vertexCount: Amount of vertices in the array. \param vertexCount: Amount of vertices in the array.
\param indexList: Pointer to array of indizes. \param indexList: Pointer to array of indices.
\param triangleCount: amount of Triangles. Usually amount of indizes / 3.*/ \param triangleCount: amount of Triangles. Usually amount of indices / 3.*/
virtual void drawIndexedTriangleList(const S3DVertex2TCoords* vertices, virtual void drawIndexedTriangleList(const S3DVertex2TCoords* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) = 0; u32 vertexCount, const u16* indexList, u32 triangleCount) = 0;
...@@ -317,8 +317,8 @@ namespace video ...@@ -317,8 +317,8 @@ namespace video
results of this operation are not defined. results of this operation are not defined.
\param vertices: Pointer to array of vertices. \param vertices: Pointer to array of vertices.
\param vertexCount: Amount of vertices in the array. \param vertexCount: Amount of vertices in the array.
\param indexList: Pointer to array of indizes. \param indexList: Pointer to array of indices.
\param triangleCount: amount of Triangles. Usually amount of indizes / 3. */ \param triangleCount: amount of Triangles. Usually amount of indices / 3. */
virtual void drawIndexedTriangleList(const S3DVertexTangents* vertices, virtual void drawIndexedTriangleList(const S3DVertexTangents* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) = 0; u32 vertexCount, const u16* indexList, u32 triangleCount) = 0;
...@@ -331,8 +331,8 @@ namespace video ...@@ -331,8 +331,8 @@ namespace video
free code sent in by Mario Gruber, lots of thanks go to him! free code sent in by Mario Gruber, lots of thanks go to him!
\param vertices: Pointer to array of vertices. \param vertices: Pointer to array of vertices.
\param vertexCount: Amount of vertices in the array. \param vertexCount: Amount of vertices in the array.
\param indexList: Pointer to array of indizes. \param indexList: Pointer to array of indices.
\param triangleCount: amount of Triangles. Usually amount of indizes - 2. */ \param triangleCount: amount of Triangles. Usually amount of indices - 2. */
virtual void drawIndexedTriangleFan(const S3DVertex* vertices, virtual void drawIndexedTriangleFan(const S3DVertex* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) = 0; u32 vertexCount, const u16* indexList, u32 triangleCount) = 0;
...@@ -345,8 +345,8 @@ namespace video ...@@ -345,8 +345,8 @@ namespace video
free code sent in by Mario Gruber, lots of thanks go to him! free code sent in by Mario Gruber, lots of thanks go to him!
\param vertices: Pointer to array of vertices. \param vertices: Pointer to array of vertices.
\param vertexCount: Amount of vertices in the array. \param vertexCount: Amount of vertices in the array.
\param indexList: Pointer to array of indizes. \param indexList: Pointer to array of indices.
\param triangleCount: amount of Triangles. Usually amount of indizes - 2. */ \param triangleCount: amount of Triangles. Usually amount of indices - 2. */
virtual void drawIndexedTriangleFan(const S3DVertex2TCoords* vertices, virtual void drawIndexedTriangleFan(const S3DVertex2TCoords* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) = 0; u32 vertexCount, const u16* indexList, u32 triangleCount) = 0;
......
...@@ -29,11 +29,15 @@ public: ...@@ -29,11 +29,15 @@ public:
vector2d<T>& operator=(const vector2d<T>& other) { X = other.X; Y = other.Y; return *this; } vector2d<T>& operator=(const vector2d<T>& other) { X = other.X; Y = other.Y; return *this; }
vector2d<T> operator+(const vector2d<T>& other) const { return vector2d<T>(X + other.X, Y + other.Y); } vector2d<T> operator+(const vector2d<T>& other) const { return vector2d<T>(X + other.X, Y + other.Y); }
vector2d<T>& operator+=(const vector2d<T>& other) { X+=other.X; Y+=other.Y; return *this; } vector2d<T>& operator+=(const vector2d<T>& other) { X+=other.X; Y+=other.Y; return *this; }
vector2d<T> operator+(const T v) const { return vector2d<T>(X + v, Y + v); }
vector2d<T>& operator+=(const T v) { X+=v; Y+=v; return *this; }
vector2d<T> operator-(const vector2d<T>& other) const { return vector2d<T>(X - other.X, Y - other.Y); } vector2d<T> operator-(const vector2d<T>& other) const { return vector2d<T>(X - other.X, Y - other.Y); }
vector2d<T>& operator-=(const vector2d<T>& other) { X-=other.X; Y-=other.Y; return *this; } vector2d<T>& operator-=(const vector2d<T>& other) { X-=other.X; Y-=other.Y; return *this; }
vector2d<T> operator-(const T v) const { return vector2d<T>(X - v, Y - v); }
vector2d<T>& operator-=(const T v) { X-=v; Y-=v; return *this; }
vector2d<T> operator*(const vector2d<T>& other) const { return vector2d<T>(X * other.X, Y * other.Y); } vector2d<T> operator*(const vector2d<T>& other) const { return vector2d<T>(X * other.X, Y * other.Y); }
vector2d<T>& operator*=(const vector2d<T>& other) { X*=other.X; Y*=other.Y; return *this; } vector2d<T>& operator*=(const vector2d<T>& other) { X*=other.X; Y*=other.Y; return *this; }
......
...@@ -29,8 +29,7 @@ CQ3LevelMesh::CQ3LevelMesh(io::IFileSystem* fs, video::IVideoDriver* driver, sce ...@@ -29,8 +29,7 @@ CQ3LevelMesh::CQ3LevelMesh(io::IFileSystem* fs, video::IVideoDriver* driver, sce
IReferenceCounted::setDebugName("CQ3LevelMesh"); IReferenceCounted::setDebugName("CQ3LevelMesh");
#endif #endif
s32 i; for ( s32 i = 0; i!= quake3::E_Q3_MESH_SIZE; ++i )
for ( i = 0; i!= quake3::E_Q3_MESH_SIZE; ++i )
{ {
Mesh[i] = 0; Mesh[i] = 0;
} }
...@@ -43,43 +42,22 @@ CQ3LevelMesh::CQ3LevelMesh(io::IFileSystem* fs, video::IVideoDriver* driver, sce ...@@ -43,43 +42,22 @@ CQ3LevelMesh::CQ3LevelMesh(io::IFileSystem* fs, video::IVideoDriver* driver, sce
// load default shaders // load default shaders
InitShader (); InitShader ();
} }
//! destructor //! destructor
CQ3LevelMesh::~CQ3LevelMesh() CQ3LevelMesh::~CQ3LevelMesh()
{ {
if (Textures) delete [] Textures;
delete [] Textures; delete [] LightMaps;
delete [] Vertices;
if (LightMaps) delete [] Faces;
delete [] LightMaps; delete [] Planes;
delete [] Nodes;
if (Vertices) delete [] Leafs;
delete [] Vertices; delete [] LeafFaces;
delete [] MeshVerts;
if (Faces) delete [] Brushes;
delete [] Faces;
if (Planes)
delete [] Planes;
if (Nodes)
delete [] Nodes;
if (Leafs)
delete [] Leafs;
if (LeafFaces)
delete [] LeafFaces;
if (MeshVerts)
delete [] MeshVerts;
if (Brushes)
delete [] Brushes;
if (Driver) if (Driver)
Driver->drop(); Driver->drop();
...@@ -87,19 +65,17 @@ CQ3LevelMesh::~CQ3LevelMesh() ...@@ -87,19 +65,17 @@ CQ3LevelMesh::~CQ3LevelMesh()
if (FileSystem) if (FileSystem)
FileSystem->drop(); FileSystem->drop();
s32 i; for ( s32 i = 0; i!= quake3::E_Q3_MESH_SIZE; ++i )
for ( i = 0; i!= quake3::E_Q3_MESH_SIZE; ++i )
{ {
if (Mesh[i]) if (Mesh[i])
Mesh[i]->drop(); Mesh[i]->drop();
} }
ReleaseShader (); ReleaseShader();
ReleaseEntity (); ReleaseEntity();
} }
//! loads a level from a .bsp-File. Also tries to load all needed textures. Returns true if successful. //! loads a level from a .bsp-File. Also tries to load all needed textures. Returns true if successful.
bool CQ3LevelMesh::loadFile(io::IReadFile* file) bool CQ3LevelMesh::loadFile(io::IReadFile* file)
{ {
...@@ -134,12 +110,11 @@ bool CQ3LevelMesh::loadFile(io::IReadFile* file) ...@@ -134,12 +110,11 @@ bool CQ3LevelMesh::loadFile(io::IReadFile* file)
} }
#endif #endif
s32 i; for ( s32 i = 0; i!= quake3::E_Q3_MESH_SIZE; ++i )
for ( i = 0; i!= quake3::E_Q3_MESH_SIZE; ++i )
{ {
Mesh[i] = new SMesh(); Mesh[i] = new SMesh();
} }
ReleaseEntity (); ReleaseEntity();
// load everything // load everything
...@@ -169,14 +144,13 @@ bool CQ3LevelMesh::loadFile(io::IReadFile* file) ...@@ -169,14 +144,13 @@ bool CQ3LevelMesh::loadFile(io::IReadFile* file)
loadTextures2(); loadTextures2();
constructMesh2(); constructMesh2();
cleanMeshes (); cleanMeshes();
calcBoundingBoxes (); calcBoundingBoxes();
return true; return true;
} }
//! returns the amount of frames in milliseconds. If the amount is 1, it is a static (=non animated) mesh. //! returns the amount of frames in milliseconds. If the amount is 1, it is a static (=non animated) mesh.
u32 CQ3LevelMesh::getFrameCount() const u32 CQ3LevelMesh::getFrameCount() const
{ {
...@@ -186,17 +160,18 @@ u32 CQ3LevelMesh::getFrameCount() const ...@@ -186,17 +160,18 @@ u32 CQ3LevelMesh::getFrameCount() const
void CQ3LevelMesh::releaseMesh ( s32 index ) void CQ3LevelMesh::releaseMesh ( s32 index )
{ {
if ( Mesh [ index ] ) if ( Mesh[index] )
{ {
Mesh [index]->drop (); Mesh[index]->drop ();
Mesh [index] = 0; Mesh[index] = 0;
} }
} }
//! returns the animated mesh based on a detail level. 0 is the lowest, 255 the highest detail. Note, that some Meshes will ignore the detail level. //! returns the animated mesh based on a detail level. 0 is the lowest, 255 the highest detail. Note, that some Meshes will ignore the detail level.
IMesh* CQ3LevelMesh::getMesh(s32 frameInMs, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) IMesh* CQ3LevelMesh::getMesh(s32 frameInMs, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop)
{ {
return Mesh[ frameInMs ]; return Mesh[frameInMs];
} }
...@@ -338,6 +313,7 @@ void CQ3LevelMesh::loadEntities(tBSPLump* l, io::IReadFile* file) ...@@ -338,6 +313,7 @@ void CQ3LevelMesh::loadEntities(tBSPLump* l, io::IReadFile* file)
parser_parse ( entity.pointer(), l->length, &CQ3LevelMesh::scriptcallback_entity ); parser_parse ( entity.pointer(), l->length, &CQ3LevelMesh::scriptcallback_entity );
} }
// load shaders named in bsp // load shaders named in bsp
void CQ3LevelMesh::loadShaders(tBSPLump* l, io::IReadFile* file) void CQ3LevelMesh::loadShaders(tBSPLump* l, io::IReadFile* file)
{ {
...@@ -493,7 +469,6 @@ void CQ3LevelMesh::parser_nextToken () ...@@ -493,7 +469,6 @@ void CQ3LevelMesh::parser_nextToken ()
return; return;
} }
// user identity // user identity
Parser.token.append ( symbol ); Parser.token.append ( symbol );
...@@ -522,6 +497,7 @@ void CQ3LevelMesh::parser_nextToken () ...@@ -522,6 +497,7 @@ void CQ3LevelMesh::parser_nextToken ()
return; return;
} }
/* /*
parse entity & shader parse entity & shader
calls callback on content in {} calls callback on content in {}
...@@ -621,7 +597,6 @@ void CQ3LevelMesh::parser_parse ( const void * data, const u32 size, CQ3LevelMes ...@@ -621,7 +597,6 @@ void CQ3LevelMesh::parser_parse ( const void * data, const u32 size, CQ3LevelMes
} }
/* /*
this loader applies only textures for stage 1 & 2 this loader applies only textures for stage 1 & 2
*/ */
...@@ -660,7 +635,6 @@ s32 CQ3LevelMesh::setShaderMaterial ( video::SMaterial &material, const tBSPFace ...@@ -660,7 +635,6 @@ s32 CQ3LevelMesh::setShaderMaterial ( video::SMaterial &material, const tBSPFace
if ( 0 == shader ) if ( 0 == shader )
return shaderState; return shaderState;
const quake3::SVarGroup *group; const quake3::SVarGroup *group;
s32 index; s32 index;
...@@ -691,7 +665,6 @@ s32 CQ3LevelMesh::setShaderMaterial ( video::SMaterial &material, const tBSPFace ...@@ -691,7 +665,6 @@ s32 CQ3LevelMesh::setShaderMaterial ( video::SMaterial &material, const tBSPFace
startPos = 0; startPos = 0;
index = group->getIndex ( "depthwrite" ); index = group->getIndex ( "depthwrite" );
if ( index >= 0 ) if ( index >= 0 )
{ {
...@@ -707,10 +680,8 @@ s32 CQ3LevelMesh::setShaderMaterial ( video::SMaterial &material, const tBSPFace ...@@ -707,10 +680,8 @@ s32 CQ3LevelMesh::setShaderMaterial ( video::SMaterial &material, const tBSPFace
// try if we can match better // try if we can match better
shaderState |= (material.MaterialType == video::EMT_SOLID ) ? 0x00020000 : 0; shaderState |= (material.MaterialType == video::EMT_SOLID ) ? 0x00020000 : 0;
} }
//material.BackfaceCulling = false; //material.BackfaceCulling = false;
if ( shader->VarGroup->VariableGroup.size () <= 4 ) if ( shader->VarGroup->VariableGroup.size () <= 4 )
...@@ -776,7 +747,6 @@ void CQ3LevelMesh::constructMesh2() ...@@ -776,7 +747,6 @@ void CQ3LevelMesh::constructMesh2()
} break; } break;
/* /*
case 1: // normal polygons case 1: // normal polygons
case 2: // patches case 2: // patches
...@@ -892,10 +862,9 @@ void CQ3LevelMesh::constructMesh2() ...@@ -892,10 +862,9 @@ void CQ3LevelMesh::constructMesh2()
} // end switch } // end switch
} }
} }
} }
//! constructs a mesh from the quake 3 level file. //! constructs a mesh from the quake 3 level file.
void CQ3LevelMesh::constructMesh() void CQ3LevelMesh::constructMesh()
{ {
...@@ -973,9 +942,9 @@ void CQ3LevelMesh::constructMesh() ...@@ -973,9 +942,9 @@ void CQ3LevelMesh::constructMesh()
break; break;
} // end switch } // end switch
} }
} }
// helper method for creating curved surfaces, sent in by Dean P. Macri. // helper method for creating curved surfaces, sent in by Dean P. Macri.
inline f32 CQ3LevelMesh::Blend( const f64 s[3], const f64 t[3], const tBSPVertex *v[9], int offset) inline f32 CQ3LevelMesh::Blend( const f64 s[3], const f64 t[3], const tBSPVertex *v[9], int offset)
{ {
...@@ -992,6 +961,7 @@ inline f32 CQ3LevelMesh::Blend( const f64 s[3], const f64 t[3], const tBSPVertex ...@@ -992,6 +961,7 @@ inline f32 CQ3LevelMesh::Blend( const f64 s[3], const f64 t[3], const tBSPVertex
return (f32) res; return (f32) res;
} }
void CQ3LevelMesh::S3DVertex2TCoords_64::copyto ( video::S3DVertex2TCoords &dest ) const void CQ3LevelMesh::S3DVertex2TCoords_64::copyto ( video::S3DVertex2TCoords &dest ) const
{ {
dest.Pos.X = core::round_( (f32) Pos.X ); dest.Pos.X = core::round_( (f32) Pos.X );
...@@ -1042,17 +1012,13 @@ void CQ3LevelMesh::copy ( S3DVertex2TCoords_64 * dest, const tBSPVertex * source ...@@ -1042,17 +1012,13 @@ void CQ3LevelMesh::copy ( S3DVertex2TCoords_64 * dest, const tBSPVertex * source
u32 g = core::s32_min ( source->color[1] * quake3::defaultModulate, 255 ); u32 g = core::s32_min ( source->color[1] * quake3::defaultModulate, 255 );
u32 b = core::s32_min ( source->color[2] * quake3::defaultModulate, 255 ); u32 b = core::s32_min ( source->color[2] * quake3::defaultModulate, 255 );
dest->Color.set ( a * 1.f/255.f, dest->Color.set (a * 1.f/255.f, r * 1.f/255.f,
r * 1.f/255.f, g * 1.f/255.f, b * 1.f/255.f);
g * 1.f/255.f,
b * 1.f/255.f
);
} }
else else
{ {
dest->Color.set ( 1.f, 1.f, 1.f, 1.f ); dest->Color.set ( 1.f, 1.f, 1.f, 1.f );
} }
} }
...@@ -1091,6 +1057,7 @@ inline void CQ3LevelMesh::copy ( video::S3DVertex2TCoords * dest, const tBSPVert ...@@ -1091,6 +1057,7 @@ inline void CQ3LevelMesh::copy ( video::S3DVertex2TCoords * dest, const tBSPVert
} }
} }
void CQ3LevelMesh::SBezier::tesselate ( s32 level ) void CQ3LevelMesh::SBezier::tesselate ( s32 level )
{ {
//Calculate how many vertices across/down there are //Calculate how many vertices across/down there are
...@@ -1149,11 +1116,10 @@ void CQ3LevelMesh::SBezier::tesselate ( s32 level ) ...@@ -1149,11 +1116,10 @@ void CQ3LevelMesh::SBezier::tesselate ( s32 level )
/*! /*!
no subdivision no subdivision
*/ */
void CQ3LevelMesh::createCurvedSurface3 ( SMeshBufferLightMap* meshBuffer, void CQ3LevelMesh::createCurvedSurface3(SMeshBufferLightMap* meshBuffer,
s32 faceIndex, s32 faceIndex,
s32 patchTesselation, s32 patchTesselation,
s32 storevertexcolor s32 storevertexcolor)
)
{ {
tBSPFace * face = &Faces[faceIndex]; tBSPFace * face = &Faces[faceIndex];
u32 j,k,m; u32 j,k,m;
...@@ -1187,13 +1153,13 @@ void CQ3LevelMesh::createCurvedSurface3 ( SMeshBufferLightMap* meshBuffer, ...@@ -1187,13 +1153,13 @@ void CQ3LevelMesh::createCurvedSurface3 ( SMeshBufferLightMap* meshBuffer,
} }
} }
/*! /*!
*/ */
void CQ3LevelMesh::createCurvedSurface2 ( SMeshBufferLightMap* meshBuffer, void CQ3LevelMesh::createCurvedSurface2(SMeshBufferLightMap* meshBuffer,
s32 faceIndex, s32 faceIndex,
s32 patchTesselation, s32 patchTesselation,
s32 storevertexcolor s32 storevertexcolor)
)
{ {
tBSPFace * face = &Faces[faceIndex]; tBSPFace * face = &Faces[faceIndex];
u32 j,k; u32 j,k;
...@@ -1202,12 +1168,10 @@ void CQ3LevelMesh::createCurvedSurface2 ( SMeshBufferLightMap* meshBuffer, ...@@ -1202,12 +1168,10 @@ void CQ3LevelMesh::createCurvedSurface2 ( SMeshBufferLightMap* meshBuffer,
const u32 controlWidth = face->size[0]; const u32 controlWidth = face->size[0];
const u32 controlHeight = face->size[1]; const u32 controlHeight = face->size[1];
// number of biquadratic patches // number of biquadratic patches
const u32 biquadWidth = (controlWidth - 1)/2; const u32 biquadWidth = (controlWidth - 1)/2;
const u32 biquadHeight = (controlHeight -1)/2; const u32 biquadHeight = (controlHeight -1)/2;
// Create space for a temporary array of the patch's control points // Create space for a temporary array of the patch's control points
core::array<S3DVertex2TCoords_64> controlPoint; core::array<S3DVertex2TCoords_64> controlPoint;
controlPoint.set_used ( controlWidth * controlHeight ); controlPoint.set_used ( controlWidth * controlHeight );
...@@ -1243,7 +1207,6 @@ void CQ3LevelMesh::createCurvedSurface2 ( SMeshBufferLightMap* meshBuffer, ...@@ -1243,7 +1207,6 @@ void CQ3LevelMesh::createCurvedSurface2 ( SMeshBufferLightMap* meshBuffer,
} }
} }
// stitch together with existing geometry // stitch together with existing geometry
// TODO: only border needs to be checked // TODO: only border needs to be checked
const u32 bsize = Bezier.Patch->getVertexCount(); const u32 bsize = Bezier.Patch->getVertexCount();
...@@ -1266,7 +1229,6 @@ void CQ3LevelMesh::createCurvedSurface2 ( SMeshBufferLightMap* meshBuffer, ...@@ -1266,7 +1229,6 @@ void CQ3LevelMesh::createCurvedSurface2 ( SMeshBufferLightMap* meshBuffer,
} }
*/ */
// add Patch to meshbuffer // add Patch to meshbuffer
for ( j = 0; j!= bsize; ++j ) for ( j = 0; j!= bsize; ++j )
{ {
...@@ -1280,9 +1242,9 @@ void CQ3LevelMesh::createCurvedSurface2 ( SMeshBufferLightMap* meshBuffer, ...@@ -1280,9 +1242,9 @@ void CQ3LevelMesh::createCurvedSurface2 ( SMeshBufferLightMap* meshBuffer,
} }
delete Bezier.Patch; delete Bezier.Patch;
} }
void CQ3LevelMesh::createCurvedSurface(SMeshBufferLightMap* meshBuffer, s32 i) void CQ3LevelMesh::createCurvedSurface(SMeshBufferLightMap* meshBuffer, s32 i)
{ {
// this implementation for loading curved surfaces was // this implementation for loading curved surfaces was
...@@ -1423,6 +1385,7 @@ void CQ3LevelMesh::createCurvedSurface(SMeshBufferLightMap* meshBuffer, s32 i) ...@@ -1423,6 +1385,7 @@ void CQ3LevelMesh::createCurvedSurface(SMeshBufferLightMap* meshBuffer, s32 i)
} }
} }
//! get's an interface to the entities //! get's an interface to the entities
const quake3::tQ3EntityList & CQ3LevelMesh::getEntityList () const quake3::tQ3EntityList & CQ3LevelMesh::getEntityList ()
{ {
...@@ -1445,6 +1408,7 @@ const quake3::SShader * CQ3LevelMesh::getShader ( u32 index ) const ...@@ -1445,6 +1408,7 @@ const quake3::SShader * CQ3LevelMesh::getShader ( u32 index ) const
return 0; return 0;
} }
//! loads the shader definition //! loads the shader definition
// either from file ( we assume /scripts on fileNameIsValid == 0 ) // either from file ( we assume /scripts on fileNameIsValid == 0 )
const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileNameIsValid ) const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileNameIsValid )
...@@ -1522,6 +1486,7 @@ const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileN ...@@ -1522,6 +1486,7 @@ const quake3::SShader * CQ3LevelMesh::getShader ( const c8 * filename, s32 fileN
return 0; return 0;
} }
//! adding default shaders //! adding default shaders
void CQ3LevelMesh::InitShader () void CQ3LevelMesh::InitShader ()
{ {
...@@ -1544,6 +1509,7 @@ void CQ3LevelMesh::InitShader () ...@@ -1544,6 +1509,7 @@ void CQ3LevelMesh::InitShader ()
getShader ( "scripts/common.shader", 1 ); getShader ( "scripts/common.shader", 1 );
} }
//!. script callback for shaders //!. script callback for shaders
//! i'm having troubles with the reference counting, during callback.. resorting.. //! i'm having troubles with the reference counting, during callback.. resorting..
void CQ3LevelMesh::ReleaseShader () void CQ3LevelMesh::ReleaseShader ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment