Fix KRDataBlock crashes on Win32
This commit is contained in:
@@ -321,34 +321,34 @@ void KRContext::loadResource(std::string path) {
|
||||
}
|
||||
}
|
||||
|
||||
KrResult KRContext::unloadResource(const KrUnloadResourceInfo* unloadResourceInfo)
|
||||
{
|
||||
if (unloadResourceInfo->resourceHandle < 0 || unloadResourceInfo->resourceHandle >= m_resourceMapSize) {
|
||||
return KR_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
KRResource* resource = m_resourceMap[unloadResourceInfo->resourceHandle];
|
||||
if (resource == nullptr) {
|
||||
return KR_ERROR_NOT_MAPPED;
|
||||
}
|
||||
// TODO - Need to implement unloading logic
|
||||
KrResult KRContext::unloadResource(const KrUnloadResourceInfo* unloadResourceInfo)
|
||||
{
|
||||
if (unloadResourceInfo->resourceHandle < 0 || unloadResourceInfo->resourceHandle >= m_resourceMapSize) {
|
||||
return KR_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
KRResource* resource = m_resourceMap[unloadResourceInfo->resourceHandle];
|
||||
if (resource == nullptr) {
|
||||
return KR_ERROR_NOT_MAPPED;
|
||||
}
|
||||
// TODO - Need to implement unloading logic
|
||||
return KR_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
KrResult KRContext::createBundle(const KrCreateBundleInfo* createBundleInfo)
|
||||
{
|
||||
if (createBundleInfo->resourceHandle < 0 || createBundleInfo->resourceHandle >= m_resourceMapSize) {
|
||||
return KR_ERROR_OUT_OF_BOUNDS;
|
||||
if (createBundleInfo->resourceHandle < 0 || createBundleInfo->resourceHandle >= m_resourceMapSize) {
|
||||
return KR_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
KRResource* bundle = m_pBundleManager->createBundle(createBundleInfo->pBundleName);
|
||||
m_resourceMap[createBundleInfo->resourceHandle] = bundle;
|
||||
|
||||
KRResource* bundle = m_pBundleManager->createBundle(createBundleInfo->pBundleName);
|
||||
m_resourceMap[createBundleInfo->resourceHandle] = bundle;
|
||||
|
||||
return KR_SUCCESS;
|
||||
}
|
||||
|
||||
KrResult KRContext::saveResource(const KrSaveResourceInfo* saveResourceInfo)
|
||||
{
|
||||
if (saveResourceInfo->resourceHandle < 0 || saveResourceInfo->resourceHandle >= m_resourceMapSize) {
|
||||
return KR_ERROR_OUT_OF_BOUNDS;
|
||||
if (saveResourceInfo->resourceHandle < 0 || saveResourceInfo->resourceHandle >= m_resourceMapSize) {
|
||||
return KR_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
KRResource* resource = m_resourceMap[saveResourceInfo->resourceHandle];
|
||||
if (resource == nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user