#include "settings.h"
#include <ICameraSceneNode.h>
#include "serialization.h" // For decompressZlib
+#include "gamedef.h"
core::map<u16, ClientActiveObject::Factory> ClientActiveObject::m_types;
if(m_node != NULL)
return;
- video::IVideoDriver* driver = smgr->getVideoDriver();
+ //video::IVideoDriver* driver = smgr->getVideoDriver();
scene::SMesh *mesh = new scene::SMesh();
scene::IMeshBuffer *buf = new scene::SMeshBuffer();
// Set material
buf->getMaterial().setFlag(video::EMF_LIGHTING, false);
buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false);
- buf->getMaterial().setTexture
- (0, driver->getTexture(getTexturePath("rat.png").c_str()));
+ buf->getMaterial().setTexture(0, tsrc->getTextureRaw("rat.png"));
buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false);
buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true);
buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
if(m_node != NULL)
return;
- video::IVideoDriver* driver = smgr->getVideoDriver();
+ //video::IVideoDriver* driver = smgr->getVideoDriver();
scene::SMesh *mesh = new scene::SMesh();
scene::IMeshBuffer *buf = new scene::SMeshBuffer();
buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false);
//buf->getMaterial().setTexture(0, NULL);
// Initialize with the stick texture
- buf->getMaterial().setTexture
- (0, driver->getTexture(getTexturePath("stick.png").c_str()));
+ buf->getMaterial().setTexture(0, tsrc->getTextureRaw("stick.png"));
buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false);
buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true);
buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
if(m_node != NULL)
return;
- video::IVideoDriver* driver = smgr->getVideoDriver();
+ //video::IVideoDriver* driver = smgr->getVideoDriver();
scene::SMesh *mesh = new scene::SMesh();
scene::IMeshBuffer *buf = new scene::SMeshBuffer();
buf->getMaterial().setFlag(video::EMF_LIGHTING, false);
buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false);
//buf->getMaterial().setTexture(0, NULL);
- buf->getMaterial().setTexture
- (0, driver->getTexture(getTexturePath("rat.png").c_str()));
+ buf->getMaterial().setTexture(0, tsrc->getTextureRaw("rat.png"));
buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false);
buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true);
buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
if(m_node != NULL)
return;
- video::IVideoDriver* driver = smgr->getVideoDriver();
+ //video::IVideoDriver* driver = smgr->getVideoDriver();
scene::SMesh *mesh = new scene::SMesh();
scene::IMeshBuffer *buf = new scene::SMeshBuffer();
buf->getMaterial().setFlag(video::EMF_LIGHTING, false);
buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false);
//buf->getMaterial().setTexture(0, NULL);
- buf->getMaterial().setTexture
- (0, driver->getTexture(getTexturePath("oerkki1.png").c_str()));
+ buf->getMaterial().setTexture(0, tsrc->getTextureRaw("oerkki1.png"));
buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false);
buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true);
buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
void Oerkki1CAO::step(float dtime, ClientEnvironment *env)
{
+ ITextureSource *tsrc = m_gamedef->tsrc();
+
pos_translator.translate(dtime);
updateNodePos();
// Enable damage texture
if(m_node)
{
- video::IVideoDriver* driver =
- m_node->getSceneManager()->getVideoDriver();
+ /*video::IVideoDriver* driver =
+ m_node->getSceneManager()->getVideoDriver();*/
scene::IMesh *mesh = m_node->getMesh();
if(mesh == NULL)
for(u16 j=0; j<mc; j++)
{
scene::IMeshBuffer *buf = mesh->getMeshBuffer(j);
- buf->getMaterial().setTexture(0, driver->getTexture(
- getTexturePath("oerkki1_damaged.png").c_str()));
+ buf->getMaterial().setTexture(0,
+ tsrc->getTextureRaw("oerkki1_damaged.png"));
}
}
m_damage_texture_enabled = true;
// Disable damage texture
if(m_node)
{
- video::IVideoDriver* driver =
- m_node->getSceneManager()->getVideoDriver();
+ /*video::IVideoDriver* driver =
+ m_node->getSceneManager()->getVideoDriver();*/
scene::IMesh *mesh = m_node->getMesh();
if(mesh == NULL)
for(u16 j=0; j<mc; j++)
{
scene::IMeshBuffer *buf = mesh->getMeshBuffer(j);
- buf->getMaterial().setTexture(0, driver->getTexture(
- getTexturePath("oerkki1.png").c_str()));
+ buf->getMaterial().setTexture(0,
+ tsrc->getTextureRaw("oerkki1.png"));
}
}
m_damage_texture_enabled = false;
if(m_node != NULL)
return;
- video::IVideoDriver* driver = smgr->getVideoDriver();
+ //video::IVideoDriver* driver = smgr->getVideoDriver();
scene::SMesh *mesh = new scene::SMesh();
scene::IMeshBuffer *buf = new scene::SMeshBuffer();
buf->getMaterial().setFlag(video::EMF_LIGHTING, false);
buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false);
//buf->getMaterial().setTexture(0, NULL);
- buf->getMaterial().setTexture
- (0, driver->getTexture(getTexturePath("firefly.png").c_str()));
+ buf->getMaterial().setTexture(0, tsrc->getTextureRaw("firefly.png"));
buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false);
buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true);
buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;