add zip resource and new test

This commit is contained in:
ohyzha
2024-12-20 12:18:38 +02:00
parent 56c3b81fe4
commit c24ef36392
5 changed files with 10 additions and 1 deletions

View File

@@ -52,7 +52,7 @@ namespace OpenVulkano
std::string EmbeddedResourceLoaderWindows::GetResourceName(const char* resId)
{
// check if resId was provided as interger and not CString
// check if resId was provided as interger or CString
// https://stackoverflow.com/questions/3610565/why-does-makeintresource-work
// first 64KB
uintptr_t ptrT = reinterpret_cast<uintptr_t>(resId);

BIN
resources/arch.zip Normal file

Binary file not shown.

View File

@@ -63,3 +63,4 @@ END
// FOR REFERENCE SEE EmbeddedResourceLoaderWindows.cpp
IDI_MADVOXEL_ICON ICON "madvoxel_icon.ico"
MADVOXEL_ICON ICON "madvoxel_icon.ico"
ARCHIVE_RCDATA RCDATA "arch.zip"

View File

@@ -1 +1,2 @@
#define IDI_MADVOXEL_ICON 101
#define ARCHIVE_RCDATA 102

View File

@@ -42,3 +42,10 @@ TEST_CASE("Load icon")
Array<char> nonExistingRes2 = loader.GetResource("NON_EXISTING_ICON", RT_GROUP_ICON);
REQUIRE((nonExistingRes.Empty() && nonExistingRes2.Empty()));
}
TEST_CASE("Load archive")
{
EmbeddedResourceLoaderWindows loader;
Array<char> zipData = loader.GetResource(MAKEINTRESOURCE(ARCHIVE_RCDATA), RT_RCDATA);
REQUIRE(!zipData.Empty());
}