Implemented unmapResource
This commit is contained in:
@@ -429,6 +429,14 @@ KrResult KRContext::mapResource(const KrMapResourceInfo* mapResourceInfo)
|
||||
return KR_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
KrResult KRContext::unmapResource(const KrUnmapResourceInfo* unmapResourceInfo)
|
||||
{
|
||||
if (unmapResourceInfo->resourceHandle < 0 || unmapResourceInfo->resourceHandle >= m_resourceMapSize) {
|
||||
return KR_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
m_resourceMap[unmapResourceInfo->resourceHandle] = nullptr;
|
||||
}
|
||||
|
||||
KrResult KRContext::createScene(const KrCreateSceneInfo* createSceneInfo)
|
||||
{
|
||||
if (createSceneInfo->resourceHandle < 0 || createSceneInfo->resourceHandle >= m_resourceMapSize) {
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
KrResult loadResource(const KrLoadResourceInfo* loadResourceInfo);
|
||||
KrResult unloadResource(const KrUnloadResourceInfo* unloadResourceInfo);
|
||||
KrResult mapResource(const KrMapResourceInfo* mapResourceInfo);
|
||||
KrResult unmapResource(const KrUnmapResourceInfo* unmapResourceInfo);
|
||||
KrResult saveResource(const KrSaveResourceInfo* saveResourceInfo);
|
||||
|
||||
KrResult createScene(const KrCreateSceneInfo* createSceneInfo);
|
||||
|
||||
@@ -76,7 +76,10 @@ KrResult KrMapResource(const KrMapResourceInfo* pMapResourceInfo)
|
||||
|
||||
KrResult KrUnmapResource(const KrUnmapResourceInfo* pUnmapResourceInfo)
|
||||
{
|
||||
return KR_ERROR_NOT_IMPLEMENTED;
|
||||
if (!sContext) {
|
||||
return KR_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
return sContext->unmapResource(pUnmapResourceInfo);
|
||||
}
|
||||
|
||||
KrResult KrCreateBundle(const KrCreateBundleInfo* pCreateBundleInfo)
|
||||
|
||||
Reference in New Issue
Block a user