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

-added a linux codeblocks project file (may have some unnecessary includes right now)

-stopped wal image loader trying to load (and crashing on) every unknown image file

-fixed bug with hybrid's offsets, in the vbos. btw the offsets really needs to be changed back to my method with plain casts (I cannot see a problem there), or use the offsetOf macro.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1114 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 1671a7b4
...@@ -21,7 +21,7 @@ namespace video ...@@ -21,7 +21,7 @@ namespace video
{ {
// May or may not be fully implemented // May or may not be fully implemented
#define TRY_LOADING_PALETTE_FROM_FILE 0 #define TRY_LOADING_PALETTE_FROM_FILE 0
// Default palette for Q2 WALs. // Default palette for Q2 WALs.
...@@ -61,7 +61,7 @@ bool CImageLoaderWAL::isALoadableFileExtension(const c8* fileName) const ...@@ -61,7 +61,7 @@ bool CImageLoaderWAL::isALoadableFileExtension(const c8* fileName) const
bool CImageLoaderWAL::isALoadableFileFormat(irr::io::IReadFile* file) const bool CImageLoaderWAL::isALoadableFileFormat(irr::io::IReadFile* file) const
{ {
return (file!=0); return (file!=0 && isALoadableFileExtension(file->getFileName())); //seems better not to always blindly load this format for now (todo: add header check)
} }
...@@ -79,7 +79,7 @@ IImage* CImageLoaderWAL::loadImage(irr::io::IReadFile* file) const ...@@ -79,7 +79,7 @@ IImage* CImageLoaderWAL::loadImage(irr::io::IReadFile* file) const
if (!paletteImage) paletteImage = createImageFromFile("colormap.pcx"); if (!paletteImage) paletteImage = createImageFromFile("colormap.pcx");
if (!paletteImage) paletteImage = createImageFromFile("colormap.tga"); if (!paletteImage) paletteImage = createImageFromFile("colormap.tga");
if (paletteImage && (paletteImage->getDimension().Width == 256) ) { if (paletteImage && (paletteImage->getDimension().Width == 256) ) {
palette = new s32[256]; //FIXME: Never gets freed palette = new s32[256]; //FIXME: Never gets freed
for (u32 i = 0; i < 256; ++i) { for (u32 i = 0; i < 256; ++i) {
palette[i] = paletteImage->getPixel(i, 0).color; palette[i] = paletteImage->getPixel(i, 0).color;
} }
...@@ -90,7 +90,7 @@ IImage* CImageLoaderWAL::loadImage(irr::io::IReadFile* file) const ...@@ -90,7 +90,7 @@ IImage* CImageLoaderWAL::loadImage(irr::io::IReadFile* file) const
if (paletteImage) paletteImage->drop(); if (paletteImage) paletteImage->drop();
} else { } else {
palette = DefaultPaletteQ2; palette = DefaultPaletteQ2;
} }
#else #else
palette = DefaultPaletteQ2; palette = DefaultPaletteQ2;
#endif #endif
...@@ -134,3 +134,4 @@ IImageLoader* createImageLoaderWAL() ...@@ -134,3 +134,4 @@ IImageLoader* createImageLoaderWAL()
} }
} }
...@@ -890,7 +890,7 @@ void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCoun ...@@ -890,7 +890,7 @@ void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCoun
if (vertices) if (vertices)
glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex2TCoords), &(reinterpret_cast<const S3DVertex2TCoords*>(vertices))[0].TCoords2); glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex2TCoords), &(reinterpret_cast<const S3DVertex2TCoords*>(vertices))[0].TCoords2);
else else
glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex2TCoords), (u8*)0 + 34); glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex2TCoords), (u8*)0 + 36);
} }
break; break;
case EVT_TANGENTS: case EVT_TANGENTS:
...@@ -915,14 +915,14 @@ void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCoun ...@@ -915,14 +915,14 @@ void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCoun
if (vertices) if (vertices)
glTexCoordPointer(3, GL_FLOAT, sizeof(S3DVertexTangents), &(reinterpret_cast<const S3DVertexTangents*>(vertices))[0].Tangent); glTexCoordPointer(3, GL_FLOAT, sizeof(S3DVertexTangents), &(reinterpret_cast<const S3DVertexTangents*>(vertices))[0].Tangent);
else else
glTexCoordPointer(3, GL_FLOAT, sizeof(S3DVertexTangents), (u8*)0 + 34); glTexCoordPointer(3, GL_FLOAT, sizeof(S3DVertexTangents), (u8*)0 + 36);
extGlClientActiveTexture(GL_TEXTURE2_ARB); extGlClientActiveTexture(GL_TEXTURE2_ARB);
glEnableClientState ( GL_TEXTURE_COORD_ARRAY ); glEnableClientState ( GL_TEXTURE_COORD_ARRAY );
if (vertices) if (vertices)
glTexCoordPointer(3, GL_FLOAT, sizeof(S3DVertexTangents), &(reinterpret_cast<const S3DVertexTangents*>(vertices))[0].Binormal); glTexCoordPointer(3, GL_FLOAT, sizeof(S3DVertexTangents), &(reinterpret_cast<const S3DVertexTangents*>(vertices))[0].Binormal);
else else
glTexCoordPointer(3, GL_FLOAT, sizeof(S3DVertexTangents), (u8*)0 + 46); glTexCoordPointer(3, GL_FLOAT, sizeof(S3DVertexTangents), (u8*)0 + 48);
} }
break; break;
} }
...@@ -2734,3 +2734,4 @@ IVideoDriver* createOpenGLDriver(const core::dimension2d<s32>& screenSize, ...@@ -2734,3 +2734,4 @@ IVideoDriver* createOpenGLDriver(const core::dimension2d<s32>& screenSize,
#endif // _IRR_COMPILE_WITH_OPENGL_ #endif // _IRR_COMPILE_WITH_OPENGL_
This diff is collapsed.
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