mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-23 07:16:15 +00:00
Merge
This commit is contained in:
commit
e90c325f1b
5 changed files with 30 additions and 13 deletions
|
@ -791,17 +791,20 @@ void CMeshMultiLod::compileCoarseMeshes()
|
|||
{
|
||||
slotRef.CoarseTriangles.resize(slotRef.CoarseNumTris * 3);
|
||||
TCoarseMeshIndexType *dstPtr= &slotRef.CoarseTriangles[0];
|
||||
uint totalTris = 0;
|
||||
for(uint i=0;i<meshGeom->getNbRdrPass(0);i++)
|
||||
{
|
||||
const CIndexBuffer &pb= meshGeom->getRdrPassPrimitiveBlock(0, i);
|
||||
CIndexBufferRead ibaRead;
|
||||
pb.lock (ibaRead);
|
||||
uint numTris= pb.getNumIndexes()/3;
|
||||
totalTris += numTris;
|
||||
if (pb.getFormat() == CIndexBuffer::Indices16)
|
||||
{
|
||||
if (sizeof(TCoarseMeshIndexType) == sizeof(uint16))
|
||||
{
|
||||
memcpy(dstPtr, (uint16 *) ibaRead.getPtr(), numTris*3*sizeof(uint16));
|
||||
dstPtr+= numTris*3;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -820,6 +823,7 @@ void CMeshMultiLod::compileCoarseMeshes()
|
|||
if (sizeof(TCoarseMeshIndexType) == sizeof(uint32))
|
||||
{
|
||||
memcpy(dstPtr, (uint32 *) ibaRead.getPtr(), numTris*3*sizeof(uint32));
|
||||
dstPtr+= numTris*3;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -836,8 +840,8 @@ void CMeshMultiLod::compileCoarseMeshes()
|
|||
}
|
||||
}
|
||||
}
|
||||
dstPtr+= numTris*3;
|
||||
}
|
||||
nlassert(totalTris == slotRef.CoarseNumTris);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time)
|
|||
{
|
||||
bool tempBRet = bRet;
|
||||
bRet = false;
|
||||
// delete pShape; // FIXME: there is a delete bug with CMeshMultiLod exported from max!!!
|
||||
delete pShape;
|
||||
bRet = tempBRet;
|
||||
}
|
||||
catch (...)
|
||||
|
|
|
@ -41,8 +41,10 @@ IShape* CExportNel::buildFlare(INode& node, TimeValue time)
|
|||
CExportNel::getValueByNameUsingParamBlock2(node, "PersistenceParam", (ParamType2)TYPE_FLOAT, &persistence, 0);
|
||||
fshape->setPersistence(persistence);
|
||||
// retrieve spacing of the flare
|
||||
CExportNel::getValueByNameUsingParamBlock2(node, "Spacing", (ParamType2)TYPE_FLOAT, &spacing, 0);
|
||||
fshape->setFlareSpacing(spacing);
|
||||
bool hasSpacing = CExportNel::getValueByNameUsingParamBlock2(node, "Spacing", (ParamType2)TYPE_FLOAT, &spacing, 0)
|
||||
|| CExportNel::getValueByNameUsingParamBlock2(node, "spacing", (ParamType2)TYPE_FLOAT, &spacing, 0);
|
||||
if (hasSpacing) fshape->setFlareSpacing(spacing);
|
||||
else nlwarning("FAILED CFlareShape Spacing");
|
||||
// retrieve use of radial attenuation
|
||||
CExportNel::getValueByNameUsingParamBlock2(node, "Attenuable", (ParamType2) TYPE_BOOL, &attenuable, 0);
|
||||
if (attenuable)
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "stdafx.h"
|
||||
#include "export_nel.h"
|
||||
#include "../tile_utility/tile_utility.h"
|
||||
#include "nel/misc/path.h"
|
||||
#include "nel/3d/texture_file.h"
|
||||
#include "nel/3d/texture_multi_file.h"
|
||||
#include "nel/3d/texture_cube.h"
|
||||
|
@ -1139,9 +1140,9 @@ int CExportNel::getVertMapChannel (Texmap& texmap, Matrix3& channelMatrix, TimeV
|
|||
}
|
||||
|
||||
// get the absolute or relative path from a texture filename
|
||||
static std::string ConvertTexFileName(const char *src, bool _AbsolutePath)
|
||||
static std::string ConvertTexFileName(const std::string &path, bool _AbsolutePath)
|
||||
{
|
||||
// File name, maxlen 256 under windows
|
||||
/*// File name, maxlen 256 under windows
|
||||
char sFileName[512];
|
||||
strcpy (sFileName, src);
|
||||
|
||||
|
@ -1156,7 +1157,15 @@ static std::string ConvertTexFileName(const char *src, bool _AbsolutePath)
|
|||
// Make the final path
|
||||
_makepath (sFileName, NULL, NULL, sName, sExt);
|
||||
}
|
||||
return std::string(sFileName);
|
||||
return std::string(sFileName);*/
|
||||
if (_AbsolutePath)
|
||||
{
|
||||
return path;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NLMISC::CFile::getFilename(path);
|
||||
}
|
||||
}
|
||||
|
||||
// Build a NeL texture corresponding with a max Texmap.
|
||||
|
@ -1243,7 +1252,7 @@ ITexture* CExportNel::buildATexture (Texmap& texmap, CMaterialDesc &remap3dsTexC
|
|||
if (l == 1 && !fileName[0].empty())
|
||||
{
|
||||
srcTex = new CTextureFile;
|
||||
static_cast<CTextureFile *>(srcTex)->setFileName (ConvertTexFileName(fileName[0].c_str(), _AbsolutePath));
|
||||
static_cast<CTextureFile *>(srcTex)->setFileName (ConvertTexFileName(fileName[0], _AbsolutePath));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1253,7 +1262,8 @@ ITexture* CExportNel::buildATexture (Texmap& texmap, CMaterialDesc &remap3dsTexC
|
|||
if (!fileName[k].empty())
|
||||
{
|
||||
/// set the name of the texture after converting it
|
||||
static_cast<CTextureMultiFile *>(srcTex)->setFileName(k, ConvertTexFileName(fileName[k].c_str(), _AbsolutePath).c_str());
|
||||
std::string convertMultiTex = ConvertTexFileName(fileName[k], _AbsolutePath);
|
||||
static_cast<CTextureMultiFile *>(srcTex)->setFileName(k, convertMultiTex.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1261,7 +1271,8 @@ ITexture* CExportNel::buildATexture (Texmap& texmap, CMaterialDesc &remap3dsTexC
|
|||
else // standard texture
|
||||
{
|
||||
srcTex = new CTextureFile;
|
||||
static_cast<CTextureFile *>(srcTex)->setFileName (ConvertTexFileName(pBitmap->GetMapName(), _AbsolutePath));
|
||||
std::string mapName = pBitmap->GetMapName();
|
||||
static_cast<CTextureFile *>(srcTex)->setFileName (ConvertTexFileName(mapName, _AbsolutePath));
|
||||
}
|
||||
|
||||
// 2) Use this texture 'as it', or duplicate it to create the faces of a cube map
|
||||
|
@ -1361,7 +1372,7 @@ NL3D::CTextureCube *CExportNel::buildTextureCubeFromReflectRefract(Texmap &texma
|
|||
CTextureFile *pT = new CTextureFile();
|
||||
|
||||
// Set the file name
|
||||
pT->setFileName(ConvertTexFileName(names[i].c_str(), _AbsolutePath));
|
||||
pT->setFileName(ConvertTexFileName(names[i], _AbsolutePath));
|
||||
|
||||
// Set the texture
|
||||
pTextureCube->setTexture(tfNewOrder[i], pT);
|
||||
|
|
|
@ -409,7 +409,7 @@ bool getValueByNameUsingParamBlock2Internal (Animatable& node, const char* sName
|
|||
}
|
||||
else
|
||||
{
|
||||
nldebug("Invalid type specified for pblock2 value with name '%s', given type '%u', found '%u'",
|
||||
nlwarning("Invalid type specified for pblock2 value with name '%s', given type '%u', found '%u'",
|
||||
sName, (uint32)type, (uint32)paramType);
|
||||
}
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ bool CExportNel::getValueByNameUsingParamBlock2 (Animatable& node, const char* s
|
|||
}
|
||||
else
|
||||
{
|
||||
// nlwarning ("Can't found ParamBlock named %s", sName);
|
||||
nlwarning ("FAILED Can't find ParamBlock named '%s'", sName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue