* updated VC71 proj files for irrlicht 1.5 - DO NOT USE the static lib compile setting!

* lots of bugfixes to MemoryDataHolder, finally made it work without crashes, for now
* prebuffer .skin files for much faster GUI loading (they are not yet deleted from memory!!)
* fixed a major bug in TypeStorage that caused values not to update
* removed log spam when loading M2 files
* fixed a bug where the character was not visible when switching from freefly to move mode and back
* preparations to use ZThread::Conditions for better thread locking

* NOTE: if you get crashes with this version when starting up the GUI, try setting DataLoaderThreads=0 in the conf file.
This commit is contained in:
false_genesis 2009-04-15 22:53:03 +00:00
parent 3552e6b9e8
commit 9b10e89b2c
31 changed files with 604 additions and 307 deletions

View File

@ -39,6 +39,9 @@ Global
Release - Fast FPU = Release - Fast FPU
Release - Fast FPU DebugInfo = Release - Fast FPU DebugInfo
Release - No console = Release - No console
Static lib - Debug = Static lib - Debug
Static lib - Release = Static lib - Release
Static lib - Release - Fast FPU = Static lib - Release - Fast FPU
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Debug.ActiveCfg = Debug|Win32
@ -53,6 +56,12 @@ Global
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release - Fast FPU DebugInfo.Build.0 = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release - No console.ActiveCfg = Release noconsole|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release - No console.Build.0 = Release noconsole|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Static lib - Debug.ActiveCfg = Debug|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Static lib - Debug.Build.0 = Debug|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Static lib - Release.ActiveCfg = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Static lib - Release.Build.0 = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Static lib - Release - Fast FPU.ActiveCfg = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Static lib - Release - Fast FPU.Build.0 = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug.ActiveCfg = Debug|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug.Build.0 = Debug|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Relase - Fast FPU.ActiveCfg = Release|Win32
@ -65,6 +74,12 @@ Global
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release - Fast FPU DebugInfo.Build.0 = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release - No console.ActiveCfg = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release - No console.Build.0 = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Static lib - Debug.ActiveCfg = Debug|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Static lib - Debug.Build.0 = Debug|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Static lib - Release.ActiveCfg = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Static lib - Release.Build.0 = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Static lib - Release - Fast FPU.ActiveCfg = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Static lib - Release - Fast FPU.Build.0 = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Debug.ActiveCfg = Debug|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Debug.Build.0 = Debug|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Relase - Fast FPU.ActiveCfg = Release|Win32
@ -77,6 +92,12 @@ Global
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Release - Fast FPU DebugInfo.Build.0 = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Release - No console.ActiveCfg = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Release - No console.Build.0 = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Static lib - Debug.ActiveCfg = Debug|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Static lib - Debug.Build.0 = Debug|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Static lib - Release.ActiveCfg = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Static lib - Release.Build.0 = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Static lib - Release - Fast FPU.ActiveCfg = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Static lib - Release - Fast FPU.Build.0 = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Debug.ActiveCfg = Debug|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Debug.Build.0 = Debug|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Relase - Fast FPU.ActiveCfg = Release|Win32
@ -89,6 +110,12 @@ Global
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Release - Fast FPU DebugInfo.Build.0 = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Release - No console.ActiveCfg = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Release - No console.Build.0 = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Static lib - Debug.ActiveCfg = Debug|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Static lib - Debug.Build.0 = Debug|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Static lib - Release.ActiveCfg = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Static lib - Release.Build.0 = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Static lib - Release - Fast FPU.ActiveCfg = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Static lib - Release - Fast FPU.Build.0 = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Debug.ActiveCfg = Debug|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Debug.Build.0 = Debug|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Relase - Fast FPU.ActiveCfg = Release|Win32
@ -99,8 +126,14 @@ Global
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release - Fast FPU.Build.0 = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release - Fast FPU DebugInfo.ActiveCfg = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release - Fast FPU DebugInfo.Build.0 = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release - No console.ActiveCfg = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release - No console.Build.0 = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release - No console.ActiveCfg = Release noconsole|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release - No console.Build.0 = Release noconsole|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Static lib - Debug.ActiveCfg = Debug|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Static lib - Debug.Build.0 = Debug|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Static lib - Release.ActiveCfg = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Static lib - Release.Build.0 = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Static lib - Release - Fast FPU.ActiveCfg = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Static lib - Release - Fast FPU.Build.0 = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug.ActiveCfg = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug.Build.0 = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Relase - Fast FPU.ActiveCfg = Release - Fast FPU|Win32
@ -111,8 +144,14 @@ Global
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU.Build.0 = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU DebugInfo.ActiveCfg = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU DebugInfo.Build.0 = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - No console.ActiveCfg = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - No console.Build.0 = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - No console.ActiveCfg = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - No console.Build.0 = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug.ActiveCfg = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug.Build.0 = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release.ActiveCfg = Static lib - Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release.Build.0 = Static lib - Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU.ActiveCfg = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU.Build.0 = Static lib - Release - Fast FPU|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection

View File

@ -16,7 +16,7 @@ public:
void DeleteByPtr(T*);
T *Get(std::string);
T *GetNoCreate(std::string);
void Assign(std::string,T*);
void Assign(std::string,T*,bool overwrite = true);
void Unlink(std::string);
void UnlinkByPtr(T*);
std::string GetNameByPtr(T*);
@ -25,12 +25,26 @@ public:
inline unsigned int Size(void) { return _storage.size(); }
void Clear(bool keep = false);
void dump(void);
private:
T *_Create(std::string);
_TypeMap _storage;
bool _keep;
};
template <class T> void TypeStorage<T>::dump(void)
{
printf("TypeStorage dump, size=%u\n",Size());
_TypeIter it;
for(it = _storage.begin(); it != _storage.end(); it++)
{
printf("[%s] => 0x%X\n", it->first.c_str(), it->second);
}
}
// check whether an object with this name is already present
template<class T> bool TypeStorage<T>::Exists(std::string s)
{
@ -41,7 +55,7 @@ template<class T> bool TypeStorage<T>::Exists(std::string s)
template<class T> T *TypeStorage<T>::_Create(std::string s)
{
T *elem = new T;
_storage[s] = elem;
Assign(s,elem);
return elem;
}
@ -106,12 +120,19 @@ template<class T> void TypeStorage<T>::Clear(bool keep)
}
}
// stores an already existing object's pointer under a specific name; deletes and overwrites old of present
template<class T> void TypeStorage<T>::Assign(std::string s,T *elem)
// stores an already existing object's pointer under a specific name; deletes and overwrites old if present
template<class T> void TypeStorage<T>::Assign(std::string s,T *elem, bool overwrite /* = true */ )
{
if(Exists(s))
Delete(s);
_storage[s] = elem;
_TypeIter it = _storage.find(s);
if(it != _storage.end())
{
if(overwrite)
{
delete it->second;
}
_storage.erase(it);
}
_storage.insert(make_pair(s,elem));
}
// removes the pointer from the storage without deleting it

View File

@ -1,4 +1,6 @@
#include <iostream>
#include "MemoryDataHolder.h"
#include "MemoryInterface.h"
#include "CM2MeshFileLoader.h"
#include "SSkinnedMesh.h"
#include "common.h"
@ -56,7 +58,7 @@ DEBUG(logdebug("Trying to open file %s",MeshFile->getFileName()));
MeshFile->read(&header,sizeof(ModelHeader));
if (header.version[0] != 8 || header.version[1] != 1 || header.version[2] != 0 || header.version[3] != 0) {
printf("Wrong header! File version doesn't match or file is not a M2 file.");
logerror("M2: [%s] Wrong header! File version doesn't match or file is not a M2 file.",MeshFile->getFileName());
return 0;
}
else
@ -98,7 +100,7 @@ DEBUG(logdebug("Read %u/%u Vertices",M2MVertices.size(),header.nVertices));
std::string SkinName = MeshFile->getFileName();
SkinName = SkinName.substr(0, SkinName.length()-3) + "00.skin"; // FIX ME (and stuffextract) ! as we need more skins
io::IReadFile* SkinFile = io::createReadFile(SkinName.c_str());
io::IReadFile* SkinFile = io::IrrCreateIReadFileBasic(Device, SkinName.c_str());
if (!SkinFile)
{
logerror("Error! Skin file not found: %s", SkinName.c_str());

View File

@ -0,0 +1,105 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "MemoryDataHolder.h"
#include "CMDHMemoryReadFile.h"
#include "irrlicht/irrString.h"
namespace irr
{
namespace io
{
CMDHReadFile::CMDHReadFile(void* memory, long len, const c8* fileName)
: Buffer(memory), Len(len), Pos(0)
{
#ifdef _DEBUG
setDebugName("CReadFile");
#endif
Filename = fileName;
}
CMDHReadFile::~CMDHReadFile()
{
// We should not drop the memory here... this model will possibly be loaded more than once
//if(getReferenceCount() <= 1)
// MemoryDataHolder::Delete(getFileName());
}
//! returns how much was read
irr::s32 CMDHReadFile::read(void* buffer, irr::u32 sizeToRead)
{
irr::s32 amount = static_cast<irr::s32>(sizeToRead);
if (Pos + amount > Len)
amount -= Pos + amount - Len;
if (amount <= 0)
return 0;
irr::c8* p = (irr::c8*)Buffer;
memcpy(buffer, p + Pos, amount);
Pos += amount;
return amount;
}
//! changes position in file, returns true if successful
//! if relativeMovement==true, the pos is changed relative to current pos,
//! otherwise from begin of file
bool CMDHReadFile::seek(long finalPos, bool relativeMovement)
{
if (relativeMovement)
{
if (Pos + finalPos > Len)
return false;
Pos += finalPos;
}
else
{
if (finalPos > Len)
return false;
Pos = finalPos;
}
return true;
}
//! returns size of file
long CMDHReadFile::getSize() const
{
return Len;
}
//! returns where in the file we are.
long CMDHReadFile::getPos() const
{
return Pos;
}
//! returns name of file
const irr::c8* CMDHReadFile::getFileName() const
{
return Filename.c_str();
}
}
}

View File

@ -0,0 +1,57 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_MDH_READ_FILE_H_INCLUDED__
#define __C_MDH_READ_FILE_H_INCLUDED__
#include "irrlicht/IReadFile.h"
#include "irrlicht/irrString.h"
namespace irr
{
namespace io
{
/*!
Class for reading from memory.
*/
class CMDHReadFile : public IReadFile
{
public:
CMDHReadFile(void* memory, long len, const irr::c8* fileName);
virtual ~CMDHReadFile();
//! returns how much was read
virtual irr::s32 read(void* buffer, irr::u32 sizeToRead);
//! changes position in file, returns true if successful
//! if relativeMovement==true, the pos is changed relative to current pos,
//! otherwise from begin of file
virtual bool seek(long finalPos, bool relativeMovement = false);
//! returns size of file
virtual long getSize() const;
//! returns where in the file we are.
virtual long getPos() const;
//! returns name of file
virtual const c8* getFileName() const;
private:
irr::core::stringc Filename;
void *Buffer;
long Len;
long Pos;
};
}
}
#endif

View File

@ -0,0 +1,41 @@
#include "common.h"
#include "MemoryDataHolder.h"
#include "irrlicht/irrlicht.h"
#include "CMDHMemoryReadFile.h"
#include "MemoryInterface.h"
/*
struct IrrFileLoadedCallback
{
irr::IrrlichtDevice *device;
};
struct IrrTextureLoadedCallback : public IrrFileLoadedCallback
{
irr::scene::ISceneNode *node;
};
void IrrModelLoadedCallbackFunc(void *ptr,std::string filename, uint32 flags)
{
}
*/
namespace irr
{
namespace io
{
IReadFile * IrrCreateIReadFileBasic(irr::IrrlichtDevice *device, std::string fn)
{
MemoryDataHolder::memblock mb = MemoryDataHolder::GetFileBasic(fn);
if(!mb.ptr)
return NULL;
return new CMDHReadFile(mb.ptr, mb.size, fn.c_str());
}
}
}

View File

@ -0,0 +1,24 @@
#ifndef MEMORYINTERFACE_H
#define MEMORYINTERFACE_H
namespace irr
{
class IrrlichtDevice;
namespace io
{
class IReadFile;
IReadFile *IrrCreateIReadFileBasic(IrrlichtDevice*, std::string);
}
}
#endif

View File

@ -308,9 +308,16 @@ void SceneWorld::OnUpdate(s32 timediff)
if(eventrecv->key.pressed_once(KEY_HOME))
{
_freeCameraMove = !_freeCameraMove;
// TODO: uncomment this as soon as the camera isn't adjusted anymore every single frame
//if(!_freeCameraMove)
// RelocateCameraBehindChar();
//TODO: this will not be needed anymore with the above code uncommented
// make player always visble when switching to freefly mode
scene::ISceneNode *charnode = GetMyCharacterSceneNode(); // NOTE: this call is absolutely not optimized!
if(charnode)
charnode->setVisible(true);
}
if(eventrecv->key.pressed_once(KEY_BACK))

View File

@ -19,7 +19,16 @@ namespace MemoryDataHolder
void Init(void)
{
if(!executor)
executor = new ZThread::PoolExecutor(1); // TODO: fix memleak on shutdown?
executor = new ZThread::PoolExecutor(1);
}
void Shutdown(void)
{
//ZThread::Guard<ZThread::FastMutex> g(mutex);
logdev("MDH: Interrupting work...");
executor->cancel(); // stop accepting new threads
executor->interrupt(); // interrupt all working threads
// executor will delete itself automatically
}
void SetThreadCount(uint32 t)
@ -48,43 +57,54 @@ namespace MemoryDataHolder
}
~DataLoaderRunnable()
{
logdev("~DataLoaderRunnable(%s)", _name.c_str());
logdev("~DataLoaderRunnable(%s) 0x%X", _name.c_str(), this);
}
void SetStores(TypeStorage<memblock> *mem, TypeStorage<DataLoaderRunnable> *ldrs)
{
_storage = mem;
_loaders = ldrs;
}
// the threaded part
void run()
{
const char *name = _name.c_str();
{
memblock *mb = new memblock();
mb->size = GetFileSize(name);
mb->size = GetFileSize(_name.c_str());
// couldnt open file if size is 0
if(!mb->size)
{
logerror("DataLoaderRunnable: Error opening file: '%s'", name);
loaders.Unlink(name);
DoCallbacks(name, MDH_FILE_ERROR); // call callback func, 'false' to indicate file couldnt be loaded
ZThread::Guard<ZThread::FastMutex> g(_mut);
logerror("DataLoaderRunnable: Error opening file: '%s'", _name.c_str());
_loaders->Unlink(_name);
DoCallbacks(_name, MDH_FILE_ERROR); // call callback func, 'false' to indicate file couldnt be loaded
delete mb;
return;
}
mb->alloc(mb->size);
std::ifstream fh;
fh.open(name, std::ios_base::in | std::ios_base::binary);
fh.open(_name.c_str(), std::ios_base::in | std::ios_base::binary);
if(!fh.is_open())
{
logerror("DataLoaderRunnable: Error opening file: '%s'", name);
loaders.Unlink(name);
{
ZThread::Guard<ZThread::FastMutex> g(_mut);
logerror("DataLoaderRunnable: Error opening file: '%s'", _name.c_str());
_loaders->Unlink(_name);
}
mb->free();
delete mb;
DoCallbacks(name, MDH_FILE_ERROR);
DoCallbacks(_name, MDH_FILE_ERROR);
return;
}
logdev("DataLoaderRunnable: Reading '%s'... (%s)", name, FilesizeFormat(mb->size).c_str());
logdev("DataLoaderRunnable: Reading '%s'... (%s)", _name.c_str(), FilesizeFormat(mb->size).c_str());
fh.read((char*)mb->ptr, mb->size);
fh.close();
storage.Assign(name, mb);
loaders.Unlink(name); // must be unlinked after the file is fully loaded, but before the callbacks are processed!
logdev("DataLoaderRunnable: Done with '%s' (%s)", name, FilesizeFormat(mb->size).c_str());
DoCallbacks(name, MDH_FILE_OK | MDH_FILE_JUST_LOADED);
{
ZThread::Guard<ZThread::FastMutex> g(_mut);
_storage->Assign(_name, mb);
_loaders->Unlink(_name); // must be unlinked after the file is fully loaded, but before the callbacks are processed!
}
logdev("DataLoaderRunnable: Done with '%s' (%s)", _name.c_str(), FilesizeFormat(mb->size).c_str());
DoCallbacks(_name, MDH_FILE_OK | MDH_FILE_JUST_LOADED);
}
inline void AddCallback(callback_func func, void *ptr = NULL, ZThread::Condition *cond = NULL)
@ -121,6 +141,10 @@ namespace MemoryDataHolder
CallbackStore _callbacks;
bool _threaded;
std::string _name;
ZThread::FastMutex _mut;
TypeStorage<memblock> *_storage;
TypeStorage<DataLoaderRunnable> *_loaders;
};
@ -133,7 +157,7 @@ namespace MemoryDataHolder
// manage reference counter
uint32 *refcount = refs.GetNoCreate(s);
if(!refcount || !*refcount)
if(!refcount)
{
refcount = new uint32;
*refcount = ref_counted ? 1 : 0;
@ -149,6 +173,7 @@ namespace MemoryDataHolder
if(memblock *mb = storage.GetNoCreate(s))
{
DEBUG(logdev("MDH: Reusing '%s' from memory",s.c_str()));
// the file was requested some other time, is still present in memory and the pointer can simply be returned...
mutex.release(); // everything ok, mutex can be unloaded safely
// execute callback and broadcast condition (must check for MDH_FILE_ALREADY_EXIST in callback func)
@ -161,33 +186,36 @@ namespace MemoryDataHolder
}
else
{
DataLoaderRunnable *r = loaders.GetNoCreate(s);
if(r == NULL)
DataLoaderRunnable *ldr = loaders.GetNoCreate(s);
DEBUG(logdev("MDH: Found Loader 0x%X for '%s'",ldr,s.c_str()));
if(ldr == NULL)
{
// no loader thread is working on that file...
r = new DataLoaderRunnable();
loaders.Assign(s,r);
r->AddCallback(func,ptr,cond); // not threadsafe!
r->SetThreaded(threaded);
r->SetName(s); // here we set the filename the thread should load
// the mutex can be released safely now
mutex.release();
ldr = loaders.Get(s);
ldr->SetStores(&storage,&loaders);
ldr->AddCallback(func,ptr,cond); // not threadsafe!
mutex.release(); // the mutex can be released safely now
ldr->SetThreaded(threaded);
ldr->SetName(s); // here we set the filename the thread should load
if(threaded)
{
ZThread::Task task(r);
ZThread::Task task(ldr);
executor->execute(task);
}
else
{
r->run(); // will exit after the whole file is loaded and the callbacks were run
memblock *mb = storage.GetNoCreate(s);
delete r;
return *mb;
ldr->run(); // will exit after the whole file is loaded and the callbacks were run
delete ldr;
memblock *mbret = storage.GetNoCreate(s);
DEBUG(logdev("Non-threaded loader returning memblock at 0x%X",mbret));
return mbret ? *mbret : memblock();
}
}
else // if a loader is already existing, add callbacks to that loader.
{
r->AddCallback(func,ptr,cond);
ldr->AddCallback(func,ptr,cond);
mutex.release();
}
}
@ -218,7 +246,7 @@ namespace MemoryDataHolder
}
else
{
if(*refcount)
if(*refcount > 0)
(*refcount)--;
logdev("MemoryDataHolder::Delete(\"%s\"): refcount dropped to %u", s.c_str(), *refcount);
}
@ -227,7 +255,7 @@ namespace MemoryDataHolder
refs.Delete(s);
if(memblock *mb = storage.GetNoCreate(s))
{
logdev("MemoryDataHolder:: deleting 0x%X (size %u)", mb->ptr, mb->size);
logdev("MemoryDataHolder:: deleting 0x%X (size %s)", mb->ptr, FilesizeFormat(mb->size).c_str());
mb->free();
storage.Delete(s);
return true;

View File

@ -65,6 +65,10 @@ PseuInstance::PseuInstance(PseuInstanceRunnable *run)
_creaters=false;
_error=false;
_initialized=false;
for(uint32 i = 0; i < COND_MAX; i++)
{
_condition[i] = new ZThread::Condition(_mutex);
}
}
@ -95,6 +99,11 @@ PseuInstance::~PseuInstance()
delete _scp;
delete _conf;
for(uint32 i = 0; i < COND_MAX; i++)
{
delete _condition[i];
}
log("--- Instance shut down ---");
}
@ -454,6 +463,15 @@ bool PseuInstance::ConnectToRealm(void)
return true;
}
void PseuInstance::WaitForCondition(InstanceConditions c, uint32 timeout /* = 0 */)
{
_mutex.acquire();
if(timeout)
_condition[c]->wait(timeout);
else
_condition[c]->wait();
_mutex.release();
}
PseuInstanceConf::PseuInstanceConf()
{

View File

@ -131,6 +131,9 @@ public:
void ProcessCliQueue(void);
void AddCliCommand(std::string);
void WaitForCondition(InstanceConditions c, uint32 timeout = 0);
inline ZThread::Condition *GetCondition(InstanceConditions c) { return _condition[c]; }
private:
PseuInstanceRunnable *_runnable;
@ -153,6 +156,8 @@ private:
ZThread::LockedQueue<std::string,ZThread::FastMutex> _cliQueue;
PseuGUI *_gui;
ZThread::Thread *_guithread;
ZThread::Condition *_condition[COND_MAX];
ZThread::FastRecursiveMutex _mutex;
};

View File

@ -1,5 +1,6 @@
#include "common.h"
#include "log.h"
#include "MemoryDataHolder.h"
#include "MapTile.h"
#include "MapMgr.h"
@ -101,8 +102,13 @@ void MapMgr::_LoadTile(uint32 gx, uint32 gy, uint32 m)
ADTFile *adt = new ADTFile();
char buf[300];
MakeMapFilename(buf,m,gx,gy);
if(adt->Load(buf))
MemoryDataHolder::memblock mb = MemoryDataHolder::GetFileBasic(buf);
if(mb.size)
{
ByteBuffer bb(mb.size);
bb.append(mb.ptr,mb.size);
MemoryDataHolder::Delete(buf);
adt->LoadMem(bb);
logdebug("MAPMGR: Loaded ADT '%s'",buf);
MapTile *tile = new MapTile();
tile->ImportFromADT(adt);

View File

@ -9,6 +9,8 @@
#include "Channel.h"
#include "ObjMgr.h"
#include "World.h"
#include "MapMgr.h"
#include "MapTile.h"
#include "RealmSession.h"
#include "WorldSession.h"
#include "MemoryDataHolder.h"
@ -696,11 +698,13 @@ void WorldSession::EnterWorldWithCharacter(std::string name)
{
logdebug("EnterWorldWithCharacter(%s)",name.c_str());
_myGUID = 0;
CharacterListExt charex;
for(CharList::iterator it = _charList.begin(); it != _charList.end(); it++)
{
if(!stricmp(it->p._name.c_str(), name.c_str()))
{
_myGUID = it->p._guid;
charex = *it;
GetInstance()->GetScripts()->variables.Set("@myguid",DefScriptTools::toString(_myGUID));
GetInstance()->GetScripts()->variables.Set("@myrace",DefScriptTools::toString(it->p._race));
}
@ -711,6 +715,8 @@ void WorldSession::EnterWorldWithCharacter(std::string name)
return;
}
PreloadDataBeforeEnterWorld(charex.p);
log("Entering World with Character \"%s\"...", name.c_str());
// create the character and add it to the objmgr.
@ -735,6 +741,35 @@ void WorldSession::EnterWorldWithCharacter(std::string name)
}
}
void WorldSession::PreloadDataBeforeEnterWorld(PlayerEnum& pl)
{
log("Loading data before entering world...");
GetWorld()->GetMapMgr()->Update(pl._x, pl._y, pl._mapId); // make it load the map files
for(uint32 tiley = 0; tiley < 3; tiley++)
{
for(uint32 tilex = 0; tilex < 3; tilex++)
{
MapTile *maptile = GetWorld()->GetMapMgr()->GetNearTile(tilex - 1, tiley - 1);
if(maptile)
{
for(uint32 i = 0; i < maptile->GetDoodadCount(); i++)
{
Doodad *doo = maptile->GetDoodad(i);
// it is useless to load the file here, since its loaded when irrlicht needs it and kept in the MeshCache for later use
//MemoryDataHolder::BackgroundLoadFile(doo->model);
// but we need to preload the .skin files, since they are not held in the MeshCache
// TODO: load *all* necessary skin files, also fix stuffextract for this!
std::string skinfile = doo->model.substr(0, doo->model.length()-3) + "00.skin";
MemoryDataHolder::BackgroundLoadFile(skinfile);
}
}
}
}
}
void WorldSession::_HandleSetProficiencyOpcode(WorldPacket& recvPacket)
{

View File

@ -90,6 +90,7 @@ public:
inline uint32 GetCharsCount(void) { return _charList.size(); }
inline CharacterListExt& GetCharFromList(uint32 id) { return _charList[id]; }
void EnterWorldWithCharacter(std::string);
void PreloadDataBeforeEnterWorld(PlayerEnum&);
// CMSGConstructor

View File

@ -504,6 +504,12 @@
<File
RelativePath=".\Client\Gui\CM2MeshFileLoader.h">
</File>
<File
RelativePath=".\Client\Gui\CMDHMemoryReadFile.cpp">
</File>
<File
RelativePath=".\Client\Gui\CMDHMemoryReadFile.h">
</File>
<File
RelativePath=".\Client\Gui\DrawObject.cpp">
</File>

View File

@ -22,7 +22,7 @@
#include "CNullDriver.h"
#include "IMaterialRendererServices.h"
#include <d3d8.h>
#include "d3d8.h"
namespace irr
{

View File

@ -9,7 +9,7 @@
#ifdef _IRR_WINDOWS_API_
#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_
#include <d3d8.h>
#include "d3d8.h"
#include "IMaterialRenderer.h"

View File

@ -9,7 +9,7 @@
#ifdef _IRR_WINDOWS_API_
#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_
#include <d3d8.h>
#include "d3d8.h"
#include "CD3D8ShaderMaterialRenderer.h"
#include "IShaderConstantSetCallBack.h"

View File

@ -9,7 +9,7 @@
#ifdef _IRR_WINDOWS_API_
#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_
#include <d3d8.h>
#include "d3d8.h"
#include "CD3D8ShaderMaterialRenderer.h"
#include "IShaderConstantSetCallBack.h"

View File

@ -6,7 +6,7 @@
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_
#include <d3d8.h>
#include "d3d8.h"
#include <d3dx8core.h>
#pragma comment (lib, "d3dx8.lib")

View File

@ -9,7 +9,7 @@
#ifdef _IRR_WINDOWS_API_
#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_
#include <d3d8.h>
#include "d3d8.h"
#include <d3dx8core.h>
#include "IMaterialRenderer.h"

View File

@ -10,7 +10,7 @@
#include "ITexture.h"
#include "IImage.h"
#include <d3d8.h>
#include "d3d8.h"
namespace irr
{

View File

@ -16,7 +16,7 @@
#include "CNullDriver.h"
#include "IMaterialRendererServices.h"
#include <d3d9.h>
#include "d3d9.h"
namespace irr
{

View File

@ -9,7 +9,7 @@
#ifdef _IRR_WINDOWS_
#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
#include <d3d9.h>
#include "d3d9.h"
#include "IMaterialRenderer.h"

View File

@ -9,7 +9,7 @@
#ifdef _IRR_WINDOWS_
#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
#include <d3d9.h>
#include "d3d9.h"
#include "CD3D9ShaderMaterialRenderer.h"
#include "IShaderConstantSetCallBack.h"

View File

@ -9,7 +9,7 @@
#ifdef _IRR_WINDOWS_
#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
#include <d3d9.h>
#include "d3d9.h"
#include "CD3D9ShaderMaterialRenderer.h"
#include "IShaderConstantSetCallBack.h"

View File

@ -9,7 +9,7 @@
#ifdef _IRR_WINDOWS_
#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
#include <d3d9.h>
#include "d3d9.h"
#include <d3dx9shader.h>
#include "IMaterialRenderer.h"

View File

@ -10,7 +10,7 @@
#include "ITexture.h"
#include "IImage.h"
#include <d3d9.h>
#include "d3d9.h"
namespace irr
{

View File

@ -12,16 +12,16 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="..\obj\IrrDebug"
IntermediateDirectory="..\obj\IrrDebug"
ConfigurationType="2"
OutputDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="0">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include;zlib"
AdditionalIncludeDirectories="..\..\include\zlib;..\..\include\irrlicht;..\..\include\DXSDK\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
ExceptionHandling="FALSE"
BasicRuntimeChecks="3"
@ -39,16 +39,8 @@
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib opengl32.lib winmm.lib"
OutputFile="..\..\bin\Win32-visualstudio\Irrlicht.dll"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames="libci.lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="..\obj\IrrDebug\Irrlicht.pdb"
ImportLibrary="..\..\lib\Win32-visualstudio\Irrlicht.lib"/>
Name="VCLibrarianTool"
OutputFile="./dep/lib/debug/irrlicht.lib"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
@ -70,8 +62,6 @@
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
@ -79,9 +69,9 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="obj\IrrRelease"
IntermediateDirectory="obj\IrrRelease"
ConfigurationType="2"
OutputDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2"
@ -91,7 +81,7 @@
Optimization="2"
InlineFunctionExpansion="1"
EnableIntrinsicFunctions="FALSE"
AdditionalIncludeDirectories="..\..\include;zlib"
AdditionalIncludeDirectories="..\..\include\zlib;..\..\include\irrlicht"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
StringPooling="TRUE"
ExceptionHandling="FALSE"
@ -109,16 +99,8 @@
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib opengl32.lib winmm.lib"
OutputFile="..\..\bin\Win32-visualstudio\Irrlicht.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames="libci.lib"
GenerateDebugInformation="FALSE"
ProgramDatabaseFile="..\obj\IrrRelease\Irrlicht.pdb"
ImportLibrary="..\..\lib\Win32-visualstudio\Irrlicht.lib"/>
Name="VCLibrarianTool"
OutputFile="./dep/lib/release/zthread.lib"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
@ -140,8 +122,6 @@
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
@ -149,9 +129,9 @@
</Configuration>
<Configuration
Name="Release - Fast FPU|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
OutputDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2"
@ -163,7 +143,7 @@
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="0"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\..\include;zlib"
AdditionalIncludeDirectories="..\..\include\zlib;..\..\include\irrlicht"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
StringPooling="TRUE"
ExceptionHandling="FALSE"
@ -183,16 +163,8 @@
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib opengl32.lib winmm.lib"
OutputFile="..\..\bin\Win32-visualstudio\Irrlicht.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames="libci.lib"
GenerateDebugInformation="FALSE"
ProgramDatabaseFile="..\obj\IrrRelease\Irrlicht.pdb"
ImportLibrary="..\..\lib\Win32-visualstudio\Irrlicht.lib"/>
Name="VCLibrarianTool"
OutputFile="./dep/lib/release/irrlicht_fastfpu.lib"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
@ -214,8 +186,6 @@
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
@ -223,257 +193,187 @@
</Configuration>
<Configuration
Name="Static lib - Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
OutputDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\..\Debug/Irrlicht.tlb"
/>
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="0">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include;zlib"
AdditionalIncludeDirectories="..\..\include\zlib;..\..\include\irrlicht"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE"
ExceptionHandling="0"
ExceptionHandling="FALSE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DisableLanguageExtensions="false"
RuntimeTypeInfo="false"
DisableLanguageExtensions="FALSE"
RuntimeTypeInfo="FALSE"
PrecompiledHeaderFile=".\..\obj\IrrDebug/Irrlicht.pch"
AssemblerListingLocation=".\..\obj\IrrDebug/"
ObjectFile=".\..\obj\IrrDebug/"
ProgramDataBaseFileName=".\..\obj\IrrDebug/"
WarningLevel="3"
SuppressStartupBanner="true"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"
/>
CompileAs="0"/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="3079"
/>
<Tool
Name="VCPreLinkEventTool"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="winmm.lib"
OutputFile="..\..\lib\Win32-visualstudio\Irrlicht.lib"
/>
OutputFile="..\..\lib\Win32-visualstudio\Irrlicht.lib"/>
<Tool
Name="VCALinkTool"
/>
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\..\Debug/Irrlicht.tlb"/>
<Tool
Name="VCXDCMakeTool"
/>
Name="VCPostBuildEventTool"/>
<Tool
Name="VCBscMakeTool"
/>
Name="VCPreBuildEventTool"/>
<Tool
Name="VCFxCopTool"
/>
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"
/>
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="3079"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Static lib - Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
OutputDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\..\Release/Irrlicht.tlb"
/>
WholeProgramOptimization="TRUE">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
EnableIntrinsicFunctions="false"
AdditionalIncludeDirectories="..\..\include;zlib"
EnableIntrinsicFunctions="FALSE"
AdditionalIncludeDirectories="..\..\include\zlib;..\..\include\irrlicht"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
ExceptionHandling="0"
StringPooling="TRUE"
ExceptionHandling="FALSE"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
BufferSecurityCheck="FALSE"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\..\obj\IrrRelease/Irrlicht.pch"
AssemblerListingLocation=".\..\obj\IrrRelease/"
ObjectFile=".\..\obj\IrrRelease/"
ProgramDataBaseFileName=".\..\obj\IrrRelease/"
WarningLevel="3"
SuppressStartupBanner="true"
SuppressStartupBanner="TRUE"
DebugInformationFormat="0"
CompileAs="0"
/>
CompileAs="0"/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="3079"
/>
<Tool
Name="VCPreLinkEventTool"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="winmm.lib"
OutputFile="..\..\lib\Win32-visualstudio\Irrlicht.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Static lib - Release - Fast FPU|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
OutputFile="..\..\lib\Win32-visualstudio\Irrlicht.lib"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\..\Release/Irrlicht.tlb"
/>
TypeLibraryName=".\..\Release/Irrlicht.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="3079"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Static lib - Release - Fast FPU|Win32"
OutputDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2"
WholeProgramOptimization="TRUE">
<Tool
Name="VCCLCompilerTool"
Optimization="3"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="0"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\include;zlib"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\..\include\zlib;..\..\include\irrlicht"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
ExceptionHandling="0"
StringPooling="TRUE"
ExceptionHandling="FALSE"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
FloatingPointModel="2"
RuntimeTypeInfo="false"
BufferSecurityCheck="FALSE"
EnableFunctionLevelLinking="TRUE"
RuntimeTypeInfo="FALSE"
PrecompiledHeaderFile=".\..\obj\IrrRelease/Irrlicht.pch"
AssemblerListingLocation=".\..\obj\IrrRelease/"
ObjectFile=".\..\obj\IrrRelease/"
ProgramDataBaseFileName=".\..\obj\IrrRelease/"
WarningLevel="3"
SuppressStartupBanner="true"
SuppressStartupBanner="TRUE"
DebugInformationFormat="0"
CallingConvention="1"
CompileAs="0"
/>
CompileAs="0"/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="3079"
/>
<Tool
Name="VCPreLinkEventTool"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="winmm.lib"
OutputFile="..\..\lib\Win32-visualstudio\Irrlicht.lib"
/>
OutputFile="..\..\lib\Win32-visualstudio\Irrlicht.lib"/>
<Tool
Name="VCALinkTool"
/>
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\..\Release/Irrlicht.tlb"/>
<Tool
Name="VCXDCMakeTool"
/>
Name="VCPostBuildEventTool"/>
<Tool
Name="VCBscMakeTool"
/>
Name="VCPreBuildEventTool"/>
<Tool
Name="VCFxCopTool"
/>
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"
/>
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="3079"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
@ -781,10 +681,10 @@
RelativePath=".\..\..\include\ITextSceneNode.h">
</File>
<File
RelativePath=".\..\..\include\IVolumeLightSceneNode.h">
RelativePath=".\..\..\include\ITriangleSelector.h">
</File>
<File
RelativePath=".\..\..\include\ITriangleSelector.h">
RelativePath=".\..\..\include\IVolumeLightSceneNode.h">
</File>
<File
RelativePath=".\..\..\include\SAnimatedMesh.h">
@ -805,10 +705,10 @@
RelativePath=".\..\..\include\SMeshBufferTangents.h">
</File>
<File
RelativePath=".\..\..\include\SSkinMeshBuffer.h">
RelativePath=".\..\..\include\SParticle.h">
</File>
<File
RelativePath=".\..\..\include\SParticle.h">
RelativePath=".\..\..\include\SSkinMeshBuffer.h">
</File>
<File
RelativePath=".\..\..\include\SViewFrustum.h">
@ -1809,12 +1709,6 @@
<File
RelativePath="CParticleGravityAffector.h">
</File>
<File
RelativePath="CParticleScaleAffector.cpp">
</File>
<File
RelativePath="CParticleScaleAffector.h">
</File>
<File
RelativePath="CParticleMeshEmitter.cpp">
</File>
@ -1830,6 +1724,12 @@
<File
RelativePath="CParticleRotationAffector.cpp">
</File>
<File
RelativePath="CParticleScaleAffector.cpp">
</File>
<File
RelativePath="CParticleScaleAffector.h">
</File>
<File
RelativePath="CParticleSphereEmitter.cpp">
</File>
@ -1951,18 +1851,18 @@
<File
RelativePath="CIrrMeshWriter.h">
</File>
<File
RelativePath=".\CSTLMeshWriter.cpp">
</File>
<File
RelativePath=".\CSTLMeshWriter.h">
</File>
<File
RelativePath=".\COBJMeshWriter.cpp">
</File>
<File
RelativePath=".\COBJMeshWriter.h">
</File>
<File
RelativePath=".\CSTLMeshWriter.cpp">
</File>
<File
RelativePath=".\CSTLMeshWriter.h">
</File>
</Filter>
</Filter>
<Filter

View File

@ -90,8 +90,8 @@ void MapTile::ImportFromADT(ADTFile *adt)
d.flags = mddf.flags;
d.uniqueid = mddf.uniqueid;
d.model = std::string("./data/model/") + NormalizeFilename(_PathToFileName(adt->_models[mddf.id]));
// this .mdx -> .m2 transformation is annoying >.< - replace "mdx" and end of string with "m2\0"
memcpy(&d.model[0] + d.model.size() - 3, "m2\0", 3);
// this .mdx -> .m2 transformation is annoying >.< - replace "mdx" and end of string with "m2"
d.model = d.model.substr(0, d.model.length() - 3) + "m2";
d.scale = mddf.scale / 1024.0f;
if(d.scale < 0.00001f)
d.scale = 1;

View File

@ -17,7 +17,9 @@
#include <vector>
#ifndef _COMMON_SKIP_THREADS
# include "zthread/Condition.h"
# include "zthread/FastMutex.h"
# include "zthread/FastRecursiveMutex.h"
# include "zthread/LockedQueue.h"
# include "zthread/Runnable.h"
# include "zthread/Thread.h"