fixed Load of ubo codes.
This commit is contained in:
parent
cdedc81f9f
commit
cc9e756ece
@ -637,7 +637,7 @@ namespace
|
|||||||
AccumMemoryManager ubo_memory;
|
AccumMemoryManager ubo_memory;
|
||||||
hgl::Map<OSString,AccumMemoryManager::Block *> ubo_codes_map;
|
hgl::Map<OSString,AccumMemoryManager::Block *> ubo_codes_map;
|
||||||
|
|
||||||
AccumMemoryManager::Block *GetUBOCodes(const OSString &filename)
|
AccumMemoryManager::Block *LoadUBO2Block(const OSString &filename)
|
||||||
{
|
{
|
||||||
AccumMemoryManager::Block *block;
|
AccumMemoryManager::Block *block;
|
||||||
|
|
||||||
@ -654,9 +654,13 @@ namespace
|
|||||||
|
|
||||||
const int64 size=fa.GetSize();
|
const int64 size=fa.GetSize();
|
||||||
|
|
||||||
block=ubo_memory.Acquire(size);
|
block=ubo_memory.Acquire(size+1);
|
||||||
|
|
||||||
fa.Read(ubo_memory.Access(block),size);
|
char *ptr=(char *)ubo_memory.Access(block);
|
||||||
|
|
||||||
|
fa.Read(ptr,size);
|
||||||
|
|
||||||
|
ptr[size]=0;
|
||||||
|
|
||||||
ubo_codes_map.Add(filename,block);
|
ubo_codes_map.Add(filename,block);
|
||||||
|
|
||||||
@ -664,6 +668,13 @@ namespace
|
|||||||
}
|
}
|
||||||
}//namespace
|
}//namespace
|
||||||
|
|
||||||
|
const char *GetUBOCodes(const AccumMemoryManager::Block *block)
|
||||||
|
{
|
||||||
|
if(!block)return nullptr;
|
||||||
|
|
||||||
|
return (const char *)ubo_memory.Access(block);
|
||||||
|
}
|
||||||
|
|
||||||
MaterialFileData *LoadMaterialDataFromFile(const AnsiString &mtl_filename)
|
MaterialFileData *LoadMaterialDataFromFile(const AnsiString &mtl_filename)
|
||||||
{
|
{
|
||||||
const OSString mtl_osfn=filesystem::FixFilename(ToOSString(mtl_filename+".mtl"));
|
const OSString mtl_osfn=filesystem::FixFilename(ToOSString(mtl_filename+".mtl"));
|
||||||
@ -705,7 +716,7 @@ MaterialFileData *LoadMaterialDataFromFile(const AnsiString &mtl_filename)
|
|||||||
else
|
else
|
||||||
ubo_os_full_filename=filesystem::MergeFilename(mtl_path,ubo_os_fn);
|
ubo_os_full_filename=filesystem::MergeFilename(mtl_path,ubo_os_fn);
|
||||||
|
|
||||||
ud.block=GetUBOCodes(ubo_os_full_filename);
|
ud.block=LoadUBO2Block(ubo_os_full_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
return mfd;
|
return mfd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user