Commit 816d5655 authored by engineer_apple's avatar engineer_apple

- added Halflife 1 Model Loader

- added Halflife 1 Texture Loader
- slightly changed usage of getMesh ( doesn't effect existing implementation)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3335 dfc29bdd-3216-0410-991c-e03cc46cb475
parent ccfcd68a
......@@ -11,6 +11,84 @@ Changes in 1.7.1 (05.07.2010) TA
changed the light billboards to use the light color. ( green light, green particle, red light red particle )
allow to disable the bump/parallax on the earth like in the room ( with transparency )
- added DDS Image files, DXT2, DXT3, DXT4, DXT5, based on code from nvidia and Randy Reddig
- added a Halflife 1 Model Loader. ( bases on code by Fabio Concas )
-> Load all Textures ( can even optimize it to texture atlas ), all bone animation, all submodels.
-> But to make use of the values ( named animation, mouth animation ) the Interface for IAnimatedMeshSceneNode
has to be reonde. I don't want to blow up the Interface again...
TODO:
->can handle float frames numbers, the interface for getMesh should be reworked
I already have working implementations for MD2, MD3 and MDL to use float blendning instead
of using some kind of fix point..
This is my idea of a new getMesh interface for IAnimatedMesh
//! Returns the IMesh interface for a frame.
/** \param frameA: Frame number as zero based index.
The Blend Factor is in the fractional part of frameA
The Mesh will be calculated as
frame = integer(frameA) * (1-fractional(frameA )) + frameB * fractional(frameA)
FrameNr KeyFrameA KeyFrameB
40.0 1 0
40.1 0.9 0.1
40.5 0.5 0.5
40.9 0.1 0.9
41.0 0 1
\param frameB: Frame number as zero based index. The other KeyFrame which is blended with FrameA.
\param userParam: for Example Level of detail, or something else
*/
virtual IMesh* getMesh(f32 frameA, s32 frameB = 0,s32 param = 0) = 0;
Should be discussed. handles all situations ( forward/reverse animation ) because the direction
vector is A->B
For now i used the (unused, always 255) detail level parameter and set a blend percentage as
s32 frameNr = (s32) getFrameNr();
s32 frameBlend = (s32) (core::fract ( getFrameNr() ) * 1000.f);
return Mesh->getMesh(frameNr, frameBlend, StartFrame, EndFrame);
So no interface is affected.
TODO:
I also added structures (suggestion) for Keyframe Interpolation which are currently not used here
mainly to unifiy get and set named animations/bones from different model files with a unique function call.
It would also effect the Handling of IAnimatedMeshSceneNode. This Topic should be discussed.
My goal is to get as many information from the original model file like key/bone animation, skin info, shaders
sub models, attachement points etc in a public interface
and to reduce the interface like setMD2Anim, setMD3Animn, setBoneAnim into one slim line function call
for setting and getting.
The callback interface also should be more generalized and event based.
(Halflife for example can notify if your left foot animation touches ground, or tirggers sound or whatever)
Maybe we use the gui event system for that
I included a 357kb Yodan.mdl and the copyright info file from Doug Hillyer to the media directory
used in example 7. collision as 4th model..
it's not easy to unify different model types and that's why it's not finished;-)
-> TODO: Quaternion Rotation is done private hand made and should be done with irrlicht quaterions
- added Halflife 1 Texture Loader
Valve uses WAL archive types like quake2. textures are inside model files
I reworked the existing ImageloaderWAL and added named Halflife textures to wal2 ( they have not extension )
and an LMP (palette/texture) loader into the same file ( all using 32bit now )
- coreutil.h
added void splitFilenam, splits a path into components
- irstring.h
added parameter make_lower to substring ( copy just lower case )
string<T> subString(u32 begin, s32 length, bool make_lower = false ) const
- ColorConverter
added
//! converts a 8 bit palettized or non palettized image (A8) into R8G8B8
static void convert8BitTo24Bit(const u8* in, s16* out, s32 width, s32 height, const s32* palette, s32 linepad = 0, bool flip=false);
//! converts a 8 bit palettized or non palettized image (A8) into A8R8G8B8
static void convert8BitTo32Bit(const u8* in, u8* out, s32 width, s32 height, const u8* palette, s32 linepad = 0, bool flip=false);
--------------------------------------
......@@ -573,7 +651,7 @@ Changes in 1.6 (23.09.2009)
There exists a known list of ArchiveLoaders, which know how to produce a Archive.
The Loaders and the Archives can be attached/detached on runtime.
The FileNames are now stored as core::string<c16>. where c16 is toggled between char/wchar
The FileNames are now stored as io::path. where c16 is toggled between char/wchar
with the #define flag _IRR_WCHAR_FILESYSTEM, to supported unicode backends (default:off)
Replaced most (const c8* filename) to string references.
......
......@@ -164,14 +164,15 @@ int main()
selection is being performed. */
scene::IAnimatedMeshSceneNode* node = 0;
video::SMaterial material;
// Add an MD2 node, which uses vertex-based animation.
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/faerie.md2"),
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
node->setPosition(core::vector3df(-70,-15,-120)); // Put its feet on the floor.
node->setPosition(core::vector3df(-70,-15,-140)); // Put its feet on the floor.
node->setScale(core::vector3df(2, 2, 2)); // Make it appear realistically scaled
node->setMD2Animation(scene::EMAT_POINT);
node->setAnimationSpeed(20.f);
video::SMaterial material;
material.setTexture(0, driver->getTexture("../../media/faerie2.bmp"));
material.Lighting = true;
material.NormalizeNormals = true;
......@@ -183,24 +184,38 @@ int main()
node->setTriangleSelector(selector);
selector->drop(); // We're done with this selector, so drop it now.
// And this B3D file uses skinned skeletal animation.
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/ninja.b3d"),
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
node->setScale(core::vector3df(10, 10, 10));
node->setPosition(core::vector3df(-70,-66,-80));
node->setRotation(core::vector3df(0,90,0));
node->setAnimationSpeed(10.f);
node->getMaterial(0).NormalizeNormals = true;
node->getMaterial(0).Lighting = true;
// Just do the same as we did above.
selector = smgr->createTriangleSelector(node);
node->setTriangleSelector(selector);
selector->drop();
// This X files uses skeletal animation, but without skinning.
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/dwarf.x"),
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
node->setPosition(core::vector3df(-70,-66,0)); // Put its feet on the floor.
node->setPosition(core::vector3df(-70,-66,-30)); // Put its feet on the floor.
node->setRotation(core::vector3df(0,-90,0)); // And turn it towards the camera.
node->setAnimationSpeed(20.f);
node->getMaterial(0).Lighting = true;
selector = smgr->createTriangleSelector(node);
node->setTriangleSelector(selector);
selector->drop();
// And this B3D file uses skinned skeletal animation.
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/ninja.b3d"),
// And this mdl file uses skinned skeletal animation.
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/yodan.mdl"),
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
node->setScale(core::vector3df(10, 10, 10));
node->setPosition(core::vector3df(-70,-66,-60));
node->setRotation(core::vector3df(0,90,0));
node->setAnimationSpeed(10.f);
node->getMaterial(0).NormalizeNormals = true;
node->setPosition(core::vector3df(-70,-25,20));
node->getMaterial(0).Lighting = true;
// Just do the same as we did above.
selector = smgr->createTriangleSelector(node);
node->setTriangleSelector(selector);
......@@ -310,3 +325,4 @@ int main()
/*
**/
......@@ -25,7 +25,7 @@ using namespace irr;
int main()
{
// ask if user would like shadows
/*
char i;
printf("Please press 'y' if you want to use realtime shadows.\n");
......@@ -37,6 +37,9 @@ int main()
video::E_DRIVER_TYPE driverType=driverChoiceConsole();
if (driverType==video::EDT_COUNT)
return 1;
*/
video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9; // video::EDT_BURNINGSVIDEO; // video::EDT_OPENGL; //video::EDT_BURNINGSVIDEO;
bool shadows = true;
/*
Create device and exit if creation failed. We make the stencil flag
......
......@@ -47,10 +47,105 @@ namespace scene
can be loaded directly by Irrlicht */
EAMT_OCT,
//! Halflife MDL model file
EAMT_MDL_HALFLIFE,
//! generic skinned mesh
EAMT_SKINNED
};
//! Possible types of Animation Type
enum E_ANIMATION_TYPE
{
//! No Animation
EAMT_STILL,
//! From Start to End, then Stop ( Limited Line )
EAMT_WAYPOINT,
//! Linear Cycling Animation ( Sawtooth )
EAMT_LOOPING,
//! Linear bobbing ( Triangle )
EAMT_PINGPONG,
};
//! Names for Animation Type
const c8* const MeshAnimationTypeNames[] =
{
"still",
"waypoint",
"looping",
"pingpong",
0
};
//! Data for holding named Animation Info
struct KeyFrameInterpolation
{
core::stringc Name; // Name of the current Animation/Bone
E_ANIMATION_TYPE AnimationType; // Type of Animation ( looping, usw..)
f32 CurrentFrame; // Current Frame
s32 NextFrame; // Frame which will be used next. For blending
s32 StartFrame; // Absolute Frame where the current animation start
s32 Frames; // Relative Frames how much Frames this animation have
s32 LoopingFrames; // How much of Frames sould be looped
s32 EndFrame; // Absolute Frame where the current animation ends End = start + frames - 1
f32 FramesPerSecond; // Speed in Frames/Seconds the animation is played
f32 RelativeSpeed; // Factor Original fps is modified
u32 BeginTime; // Animation started at this thime
u32 EndTime; // Animation end at this time
u32 LastTime; // Last Keyframe was done at this time
KeyFrameInterpolation ( const c8 * name = "", s32 start = 0, s32 frames = 0, s32 loopingframes = 0,
f32 fps = 0.f, f32 relativefps = 1.f )
: Name ( name ), AnimationType ( loopingframes ? EAMT_LOOPING : EAMT_WAYPOINT),
StartFrame ( start ), CurrentFrame ( (f32) start ), NextFrame ( start ),
Frames ( frames ), EndFrame ( start + frames - 1 ),
FramesPerSecond ( fps ), RelativeSpeed ( relativefps ),
LoopingFrames ( loopingframes ),
BeginTime ( 0 ), EndTime ( 0 ), LastTime ( 0 )
{
}
// linear search
bool operator == ( const KeyFrameInterpolation & other ) const
{
return Name.equals_ignore_case ( other.Name );
}
};
//! a List holding named Animations
typedef core::array < KeyFrameInterpolation > IAnimationList;
//! a List holding named Skins
typedef core::array < core::stringc > ISkinList;
// Current Model per Body
struct SubModel
{
core::stringc name;
u32 startBuffer;
u32 endBuffer;
u32 state;
};
struct BodyPart
{
core::stringc name;
u32 defaultModel;
core::array < SubModel > model;
};
//! a List holding named Models and SubModels
typedef core::array < BodyPart > IBodyList;
//! Interface for an animated mesh.
/** There are already simple implementations of this interface available so
you don't have to implement this interface on your own if you need to:
......
......@@ -260,12 +260,12 @@ B3D, MS3D or X meshes */
//! Define _IRR_COMPILE_WITH_IRR_MESH_LOADER_ if you want to load Irrlicht Engine .irrmesh files
#define _IRR_COMPILE_WITH_IRR_MESH_LOADER_
//! Define _IRR_COMPILE_WITH_HALFLIFE_LOADER_ if you want to load Halflife animated files
#define _IRR_COMPILE_WITH_HALFLIFE_LOADER_
//! Define _IRR_COMPILE_WITH_MD2_LOADER_ if you want to load Quake 2 animated files
#define _IRR_COMPILE_WITH_MD2_LOADER_
//! Define _IRR_COMPILE_WITH_MD3_LOADER_ if you want to load Quake 3 animated files
#define _IRR_COMPILE_WITH_MD3_LOADER_
//! Define _IRR_COMPILE_WITH_3DS_LOADER_ if you want to load 3D Studio Max files
#define _IRR_COMPILE_WITH_3DS_LOADER_
//! Define _IRR_COMPILE_WITH_COLLADA_LOADER_ if you want to load Collada files
......@@ -321,6 +321,8 @@ B3D, MS3D or X meshes */
#define _IRR_COMPILE_WITH_TGA_LOADER_
//! Define _IRR_COMPILE_WITH_WAL_LOADER_ if you want to load .wal files
#define _IRR_COMPILE_WITH_WAL_LOADER_
//! Define _IRR_COMPILE_WITH_LMP_LOADER_ if you want to load .lmp files
#define _IRR_COMPILE_WITH_LMP_LOADER_
//! Define _IRR_COMPILE_WITH_RGB_LOADER_ if you want to load Silicon Graphics .rgb/.rgba/.sgi/.int/.inta/.bw files
#define _IRR_COMPILE_WITH_RGB_LOADER_
......
......@@ -33,6 +33,16 @@ namespace scene
MeshBuffers[i]->drop();
}
//! clean mesh
virtual void clear()
{
for (u32 i=0; i<MeshBuffers.size(); ++i)
MeshBuffers[i]->drop();
MeshBuffers.clear();
BoundingBox.reset ( 0.f, 0.f, 0.f );
}
//! returns amount of mesh buffers.
virtual u32 getMeshBufferCount() const
{
......
......@@ -138,6 +138,39 @@ inline s32 isInSameDirectory ( const io::path& path, const io::path& file )
return subB - subA;
}
// splits a path into components
static inline void splitFilename( const io::path &name, io::path *path,io::path* filename, io::path* extension,bool make_lower = false )
{
s32 i = name.size();
s32 extpos = i;
// search for path separator or beginning
while ( i >= 0 )
{
if ( name[i] == '.' )
{
extpos = i;
if ( extension )
*extension = name.subString ( extpos + 1, name.size() - (extpos + 1), make_lower );
}
else
if ( name[i] == '/' || name[i] == '\\' )
{
if ( filename )
*filename = name.subString ( i + 1, extpos - (i + 1), make_lower );
if ( path )
{
*path = name.subString ( 0, i + 1, make_lower );
path->replace ( '\\', '/' );
}
return;
}
i -= 1;
}
if ( filename )
*filename = name.subString ( 0, extpos, make_lower );
}
//! some standard function ( to remove dependencies )
#undef isdigit
......
......@@ -884,25 +884,35 @@ public:
//! Returns a substring
/** \param begin: Start of substring.
\param length: Length of substring. */
string<T,TAlloc> subString(u32 begin, s32 length) const
\param length: Length of substring.
\param make_lower, copy only lower case */
string<T> subString(u32 begin, s32 length, bool make_lower = false ) const
{
// if start after string
// or no proper substring length
if ((length <= 0) || (begin>=size()))
return string<T,TAlloc>("");
return string<T>("");
// clamp length to maximal value
if ((length+begin) > size())
length = size()-begin;
string<T,TAlloc> o;
string<T> o;
o.reserve(length+1);
for (s32 i=0; i<length; ++i)
o.array[i] = array[i+begin];
s32 i;
if ( !make_lower )
{
for (i=0; i<length; ++i)
o.array[i] = array[i+begin];
}
else
{
for (i=0; i<length; ++i)
o.array[i] = locale_lower ( array[i+begin] );
}
o.array[length] = 0;
o.used = o.allocated;
o.used = length + 1;
return o;
}
......
Boba Fett Model for Half-Life
Copyright © 1999 Doug Hillyer
Author: Doug "CHaoSMaN" Hillyer--All modeling and textures
E-Mail: dhillyer@bigfoot.com
ICQ: 707847 (Don't contact through ICQ without a good reason)
Webpage: http:// *UNDER CONSTRUCTION* E-mail me if you'll host my page.
Model Name: Boba Fett
Version: 1.0
Relaese Date: 3/24/99
Total Size: 448KB
Polygons: 700
Vertices: 379
Texture Size: 159KB (I'll take it down under 150KB in the next release)
Team Colors: No. Maybe in a future release if I figure out how to change the palette.
Animations: Standard DM Player Animations--I'm too lazy to make my own
Build Time: 30+ Hours?
Programs Used: 3D Studio MAX R2.5, Character Studio R2, Surface Suite 1.1, Photoshop 5
Knows bugs:
Top of jet pack goes though his head in some animations. Not much I can do about it. No chrome texture. If anyone knows how to do this, let me know and I'll add it. Multiplayer BMP thinks it has team colors and doesn't display correctly.
Description:
Here is one less model on the Cold Fusion Wish List (http://www.planethalflife.com/coldfusion/)! After more that 30 hours of modeling and texturing it's finaly done. Each and every polygon hand-built by me, except for the arms, which belong to the gordon model. I saw no reason to remodel something that was already made. All textures made to match the latest version of Boba Fett. The modifier stack in 3DSMAX had at least 40 modifiers and froze my computer numerous time. It's a little bit bulky at 700 polygons, but I can't do it with much less and still have all of the details that I want. I hope that everyone likes it. Please send me any comments or suggestions you may have.
If there is something wronge with the design or model, then let me know so that I can fix it in an upcoming release.
I'm also taking requests or suggestions for models.
Remember, this model is Copyrighted by me, Doug Hillyer. If you want to use this model or need one custom built for a MOD, then contact me.
Enjoy!
Installation:
Put all files (bobafett.mdl, bobafett.bmp) in half-life\valve\models\player\bobafett directory
\ No newline at end of file
File added
This diff is collapsed.
This diff is collapsed.
......@@ -199,7 +199,9 @@ IMesh * CAnimatedMeshSceneNode::getMeshForCurrentFrame()
{
if(Mesh->getMeshType() != EAMT_SKINNED)
{
return Mesh->getMesh((s32)getFrameNr(), 255, StartFrame, EndFrame);
s32 frameNr = (s32) getFrameNr();
s32 frameBlend = (s32) (core::fract ( getFrameNr() ) * 1000.f);
return Mesh->getMesh(frameNr, frameBlend, StartFrame, EndFrame);
}
else
{
......
......@@ -112,6 +112,93 @@ void CColorConverter::convert8BitTo16Bit(const u8* in, s16* out, s32 width, s32
}
}
//! converts a 8 bit palettized or non palettized image (A8) into R8G8B8
void CColorConverter::convert8BitTo24Bit(const u8* in, u8* out, s32 width, s32 height, const u8* palette, s32 linepad, bool flip)
{
if (!in || !out )
return;
const s32 lineWidth = 3 * width;
if (flip)
out += lineWidth * height;
for (s32 y=0; y<height; ++y)
{
if (flip)
out -= lineWidth; // one line back
for (s32 x=0; x< lineWidth; x += 3)
{
if ( palette )
{
#ifdef __BIG_ENDIAN__
out[x+0] = palette[ (in[0] << 2 ) + 0];
out[x+1] = palette[ (in[0] << 2 ) + 1];
out[x+2] = palette[ (in[0] << 2 ) + 2];
#else
out[x+0] = palette[ (in[0] << 2 ) + 2];
out[x+1] = palette[ (in[0] << 2 ) + 1];
out[x+2] = palette[ (in[0] << 2 ) + 0];
#endif
}
else
{
out[x+0] = in[0];
out[x+1] = in[0];
out[x+2] = in[0];
}
++in;
}
if (!flip)
out += lineWidth;
in += linepad;
}
}
//! converts a 8 bit palettized or non palettized image (A8) into R8G8B8
void CColorConverter::convert8BitTo32Bit(const u8* in, u8* out, s32 width, s32 height, const u8* palette, s32 linepad, bool flip)
{
if (!in || !out )
return;
const u32 lineWidth = 4 * width;
if (flip)
out += lineWidth * height;
u32 x;
register u32 c;
for (u32 y=0; y < (u32) height; ++y)
{
if (flip)
out -= lineWidth; // one line back
if ( palette )
{
for (x=0; x < (u32) width; x += 1)
{
c = in[x];
((u32*)out)[x] = ((u32*)palette)[ c ];
}
}
else
{
for (x=0; x < (u32) width; x += 1)
{
c = in[x];
#ifdef __BIG_ENDIAN__
((u32*)out)[x] = c << 24 | c << 16 | c << 8 | 0x000000FF;
#else
((u32*)out)[x] = 0xFF000000 | c << 16 | c << 8 | c;
#endif
}
}
if (!flip)
out += lineWidth;
in += width + linepad;
}
}
//! converts 16bit data to 16bit data
......
......@@ -26,6 +26,12 @@ public:
//! converts a 8 bit palettized image to A1R5G5B5
static void convert8BitTo16Bit(const u8* in, s16* out, s32 width, s32 height, const s32* palette, s32 linepad=0, bool flip=false);
//! converts a 8 bit palettized or non palettized image (A8) into R8G8B8
static void convert8BitTo24Bit(const u8* in, u8* out, s32 width, s32 height, const u8* palette, s32 linepad = 0, bool flip=false);
//! converts a 8 bit palettized or non palettized image (A8) into A8R8G8B8
static void convert8BitTo32Bit(const u8* in, u8* out, s32 width, s32 height, const u8* palette, s32 linepad = 0, bool flip=false);
//! converts R8G8B8 16 bit data to A1R5G5B5 data
static void convert16BitTo16Bit(const s16* in, s16* out, s32 width, s32 height, s32 linepad=0, bool flip=false);
......
......@@ -122,7 +122,7 @@ void CStencilBuffer::setSize(const core::dimension2d<u32>& size)
if (Buffer)
delete [] Buffer;
Pitch = size.Width * sizeof ( u8 );
Pitch = size.Width * sizeof ( u32 );
TotalSize = Pitch * size.Height;
Buffer = new u8[TotalSize];
clear ();
......
This diff is collapsed.
......@@ -17,6 +17,7 @@ namespace irr
{
namespace video
{
#if 0
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
# pragma pack( push, packing )
......@@ -62,6 +63,80 @@ private:
static s32 DefaultPaletteQ2[256];
};
#endif
//! An Irrlicht image loader for Quake1,2 engine lmp textures/palette
class CImageLoaderLMP : public irr::video::IImageLoader
{
public:
virtual bool isALoadableFileExtension(const io::path& filename) const;
virtual bool isALoadableFileFormat(irr::io::IReadFile* file) const;
virtual irr::video::IImage* loadImage(irr::io::IReadFile* file) const;
};
//! An Irrlicht image loader for quake2 wal engine textures
class CImageLoaderWAL : public irr::video::IImageLoader
{
public:
virtual bool isALoadableFileExtension(const io::path& filename) const;
virtual bool isALoadableFileFormat(irr::io::IReadFile* file) const;
virtual irr::video::IImage* loadImage(irr::io::IReadFile* file) const;
};
//! An Irrlicht image loader for Halife 1 engine textures
class CImageLoaderWAL2 : public irr::video::IImageLoader
{
public:
virtual bool isALoadableFileExtension(const io::path& filename) const;
virtual bool isALoadableFileFormat(irr::io::IReadFile* file) const;
virtual irr::video::IImage* loadImage(irr::io::IReadFile* file) const;
};
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
# pragma pack( push, packing )
# pragma pack( 1 )
# define PACK_STRUCT
#elif defined( __GNUC__ )
# define PACK_STRUCT __attribute__((packed))
#else
# error compiler not supported
#endif
struct SLMPHeader {
u32 width; // width
u32 height; // height
// variably sized
} PACK_STRUCT;
// Halfelife wad3 type 67 file
struct miptex_halflife
{
c8 name[16];
u32 width, height;
u32 mipmap[4]; // four mip maps stored
} PACK_STRUCT;
//quake2 texture
struct miptex_quake2
{
c8 name[32];
u32 width;
u32 height;
u32 mipmap[4]; // four mip maps stored
c8 animname[32]; // next frame in animation chain
s32 flags;
s32 contents;
s32 value;
};
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
# pragma pack( pop, packing )
#endif
#undef PACK_STRUCT
}
}
......
......@@ -45,6 +45,12 @@ IImageLoader* createImageLoaderPNG();
//! creates a loader which is able to load WAL images
IImageLoader* createImageLoaderWAL();
//! creates a loader which is able to load halflife images
IImageLoader* createImageLoaderHalfLife();
//! creates a loader which is able to load lmp images
IImageLoader* createImageLoaderLMP();
//! creates a loader which is able to load ppm/pgm/pbm images
IImageLoader* createImageLoaderPPM();
......@@ -123,6 +129,13 @@ CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& scre
#ifdef _IRR_COMPILE_WITH_WAL_LOADER_
SurfaceLoader.push_back(video::createImageLoaderWAL());
#endif
#ifdef _IRR_COMPILE_WITH_LMP_LOADER_
SurfaceLoader.push_back(video::createImageLoaderLMP());
#endif
#ifdef _IRR_COMPILE_WITH_HALFLIFE_LOADER_
SurfaceLoader.push_back(video::createImageLoaderHalfLife());
#endif
#ifdef _IRR_COMPILE_WITH_PPM_LOADER_
SurfaceLoader.push_back(video::createImageLoaderPPM());
#endif
......
......@@ -29,6 +29,10 @@
#include "CMD2MeshFileLoader.h"
#endif
#ifdef _IRR_COMPILE_WITH_HALFLIFE_LOADER_
#include "CAnimatedMeshHalfLife.h"
#endif
#ifdef _IRR_COMPILE_WITH_MS3D_LOADER_
#include "CMS3DMeshFileLoader.h"
#endif
......@@ -222,6 +226,9 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs,
#ifdef _IRR_COMPILE_WITH_MS3D_LOADER_
MeshLoaderList.push_back(new CMS3DMeshFileLoader(Driver));
#endif
#ifdef _IRR_COMPILE_WITH_HALFLIFE_LOADER_
MeshLoaderList.push_back(new CHalflifeMDLMeshFileLoader( this ));
#endif
#ifdef _IRR_COMPILE_WITH_3DS_LOADER_
MeshLoaderList.push_back(new C3DSMeshFileLoader(this, FileSystem));
#endif
......
......@@ -331,8 +331,9 @@ void CShadowVolumeSceneNode::render()
driver->setTransform(video::ETS_WORLD, Parent->getAbsoluteTransformation());
for (u32 i=0; i<ShadowVolumesUsed; ++i)
driver->drawStencilShadowVolume(ShadowVolumes[i].pointer(),
ShadowVolumes[i].size(), UseZFailMethod);
{
driver->drawStencilShadowVolume(ShadowVolumes[i].pointer(),ShadowVolumes[i].size(), UseZFailMethod);
}
}
......
......@@ -348,9 +348,12 @@ CBurningVideoDriver::CBurningVideoDriver(const irr::SIrrlichtCreationParameters&
BackBuffer->fill(SColor(0));
// create z buffer
DepthBuffer = video::createDepthBuffer(BackBuffer->getDimension());
if ( params.ZBufferBits )
DepthBuffer = video::createDepthBuffer(BackBuffer->getDimension());
// create stencil buffer
StencilBuffer = video::createStencilBuffer(BackBuffer->getDimension());
if ( params.Stencilbuffer )
StencilBuffer = video::createStencilBuffer(BackBuffer->getDimension());
}
// create triangle renderers
......@@ -607,6 +610,7 @@ bool CBurningVideoDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
case EVDF_MIP_MAP:
return true;
#endif
case EVDF_STENCIL_BUFFER:
case EVDF_RENDER_TO_TARGET:
case EVDF_MULTITEXTURE:
case EVDF_HARDWARE_TL:
......
......@@ -1395,6 +1395,14 @@
RelativePath="C3DSMeshFileLoader.h"
>
</File>
<File
RelativePath=".\CAnimatedMeshHalfLife.cpp"
>
</File>
<File
RelativePath=".\CAnimatedMeshHalfLife.h"
>
</File>
<File
RelativePath="CAnimatedMeshMD2.cpp"
>
......
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