mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 19:45:41 -04:00
[librptexture] ICO: Fix regression that broke Win3.x icons; remove unneeded assert().
ICOPrivate::loadIconDirectory_Win3():
- rt == res.type *only* for Win1.x. For Win3.x, res.type is RT_GROUP_ICON
or RT_GROUP_CURSOR. For Win1.x, it's RT_ICON or RT_CURSOR.
This fixes a regression from commit 22da0c2e21
.
([libromdata] EXE: Load icons from Windows 1.x/2.x executables.)
This commit is contained in:
parent
22da0c2e21
commit
5083161c23
@ -271,7 +271,6 @@ ICOPrivate::ICOPrivate(ICO *q, const IResourceReaderPtr &resReader, uint16_t typ
|
|||||||
memset(&icoHeader, 0, sizeof(icoHeader));
|
memset(&icoHeader, 0, sizeof(icoHeader));
|
||||||
|
|
||||||
// Determine the icon type here.
|
// Determine the icon type here.
|
||||||
assert(type == RT_ICON || type == RT_CURSOR || type == RT_GROUP_ICON || type == RT_GROUP_CURSOR);
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
default:
|
default:
|
||||||
assert(!"Unsupported resource type");
|
assert(!"Unsupported resource type");
|
||||||
@ -333,7 +332,7 @@ int ICOPrivate::loadIconDirectory_Win3(void)
|
|||||||
|
|
||||||
// Open the RT_GROUP_ICON / RT_GROUP_CURSOR resource.
|
// Open the RT_GROUP_ICON / RT_GROUP_CURSOR resource.
|
||||||
auto &res = *(dir.res);
|
auto &res = *(dir.res);
|
||||||
IRpFilePtr f_icondir = res.resReader->open(rt, res.id, res.lang);
|
IRpFilePtr f_icondir = res.resReader->open(res.type, res.id, res.lang);
|
||||||
if (!f_icondir) {
|
if (!f_icondir) {
|
||||||
// Unable to open the RT_GROUP_ICON / RT_GROUP_CURSOR.
|
// Unable to open the RT_GROUP_ICON / RT_GROUP_CURSOR.
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
Loading…
Reference in New Issue
Block a user