MCPcopy Create free account
hub / github.com/EasyRPG/Player / ResOffsetByType

Method ResOffsetByType

src/exe_reader.cpp:409–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409uint32_t EXEReader::ResOffsetByType(uint32_t type) {
410 // Part 2 of the resource grabber.
411 if (!resource_ofs) {
412 return 0;
413 }
414 // For each ID/Name entry in the outer...
415 uint32_t resourcesIDEs = GetU16(resource_ofs + 0x0C) + (uint32_t) GetU16(resource_ofs + 0x0E);
416 uint32_t resourcesIDEbase = resource_ofs + 0x10;
417 while (resourcesIDEs) {
418 if (GetU32(resourcesIDEbase) == type) {
419 return exe_reader_roffset(resource_ofs, GetU32(resourcesIDEbase + 4));
420 }
421 resourcesIDEbase += 8;
422 resourcesIDEs--;
423 }
424 return 0;
425}
426
427uint32_t EXEReader::GetLogoCount() {
428 if (!resource_ofs) {

Callers

nothing calls this directly

Calls 1

exe_reader_roffsetFunction · 0.85

Tested by

no test coverage detected