Mario Kart 64
Loading...
Searching...
No Matches
ResourceUtil.h
Go to the documentation of this file.
1#pragma once
2
3#include "resourcebridge.h"
4#include "libultraship/src/resource/ResourceManager.h"
5#include "Context.h"
6
7namespace SM64 {
8template <typename T> T LoadChild(uint64_t crc) {
9 auto path = ResourceGetNameByCrc(crc);
10 if (path == nullptr) {
11 return nullptr;
12 }
13 auto asset = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(path);
14 return asset ? static_cast<T>(asset->GetRawPointer()) : nullptr;
15}
16template <typename T> T LoadChild(const char* path) {
17 if (path == nullptr) {
18 return nullptr;
19 }
20 auto asset = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(path);
21 return asset ? static_cast<T>(asset->GetRawPointer()) : nullptr;
22}
23}
Definition AudioBankFactory.h:6
T LoadChild(uint64_t crc)
Definition ResourceUtil.h:8