Loading and processing a .gparam file:
#include "../example_base.hpp"
#include <detail/windows.inl>
void get_gparam_resource() {
from::CS::CSResourceRepository::CSGparamRepository, L"m12_01_0000",
L"gparam:/m12_01_0000.gparam"
};
auto gparam = gparam_request.
get();
std::cout << "Got m12_01_0000: " << std::boolalpha << gparam.has_reference()
<< '\n';
}
void load_gparam_resource() {
from::file_request::LOAD };
while (!gparam_file_request.ready()) {
std::cout << "Waiting for m10_00_0000.gparam...\n";
Sleep(100);
}
auto gparam_file = gparam_file_request.check();
std::cout << "Got m10_00_0000.gparam: " << std::boolalpha
<< gparam_file.has_reference() << '\n';
}
void example_base() {
con_allocate(false);
if (!from::DLSY::wait_for_system(5'000)) {
std::cout << "wait_for_system timed out!\n";
return;
}
Sleep(10'000);
get_gparam_resource();
load_gparam_resource();
}
Asynchronous file loading using the file capsule system.
Definition file.hpp:90
Asynchronous resource loading using the resource capsule system.
Definition file.hpp:258
liber::optref< FD4::FD4ResCap > get() const noexcept
Block until the resource request is ready and get the result.
Definition file.hpp:332
Namespace CS file and resource loading.
Dantelion2 system properties.
Loading a Wwise bank and playing a sound:
#include "../example_base.hpp"
void example_base() {
con_allocate(false);
if (!from::DLSY::wait_for_system(5'000)) {
std::cout << "wait_for_system timed out!\n";
return;
}
auto bank = request.get();
if (!bank) {
std::cout << "Failed to load sd:/vc201.bnk!\n";
return;
}
}
static LIBERAPI DLUT::DLReferenceCountPtr< CSFD4SoundIns > play_system_sound(char sound_type, int sound_id)
Play a 2d system wwise sound.
Namespace CS sound playback.