Skip to content

Commit

Permalink
Merge branch 'mr-136'
Browse files Browse the repository at this point in the history
tweak(resources): changes for retail builds (mr-136):
 - 4e1f82c tweak(resources): changes for retail builds this is required for upcoming internal changes
  • Loading branch information
thorium-cfx committed Oct 30, 2023
2 parents b650d8c + 4e1f82c commit 90e826b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions code/components/citizen-resources-core/src/Resource.cpp
Expand Up @@ -15,6 +15,12 @@

#include <Error.h>

#if __has_include(<InternalResourceImpl.h>)
#include <InternalResourceImpl.h>
#else
#define INTERNAL_RESOURCE_GET_NAME GetName
#endif

namespace fx
{
ResourceImpl::ResourceImpl(const std::string& name, ResourceManagerImpl* manager)
Expand Down Expand Up @@ -42,11 +48,13 @@ bool ResourceImpl::LoadFrom(const std::string& rootPath, std::string* errorState
}
else
{
trace("Resource loading for %s failed:\n%s\n", m_name.c_str(), retval->c_str());
trace("Resource loading for %s failed:\n%s\n", INTERNAL_RESOURCE_GET_NAME().c_str(), retval->c_str());
}
}

#if !defined(INTERNAL_RESOURCE_IMPL)
m_rootPath = rootPath;
#endif

m_state = ResourceState::Stopped;

Expand Down Expand Up @@ -142,7 +150,7 @@ void ResourceImpl::Run(std::function<void()>&& fn)

// save data in case we need to trace this back from dumps
char resourceNameBit[128];
memcpy(resourceNameBit, GetName().c_str(), std::min(std::size(resourceNameBit), GetName().length() + 1));
memcpy(resourceNameBit, INTERNAL_RESOURCE_GET_NAME().c_str(), std::min(std::size(resourceNameBit), INTERNAL_RESOURCE_GET_NAME().length() + 1));
debug::Alias(resourceNameBit);

OnEnter();
Expand Down

0 comments on commit 90e826b

Please sign in to comment.