The DDB is usually half the size of the DIB.
NOTE: The DDB, which comes after the DIB, is missing the format WORD.
The header is otherwise the same format.
Rename vv_icons to v_icons, since it's not a vector of vectors.
Need to byteswap it on little-endian. Otherwise, it'll end up catching
'abgr' instead.
Also, add a big-endian check on Neon, since it's possible for ARM to
operate in big-endian mode.
This eliminates the need to call rp_image::swizzle() in
QoiPrivate::loadImage().
qoi.h now expects images to be in the same ARGB32 format
as the rest of rom-properties.
NOTE: Only adjusting what's read from or written to bytes[],
not the internal pixel buffers.
...for the basic read/write functions and qoi_decode().
qoi_encode() isn't being used at the moment, so I'm not going to try
to optimize it.
TODO: Verify that the memcpy()'s don't break on big-endian.
Instead of scaling larger icons down, set a device pixel ratio. For the
usual case of iconSize = (32, 32), on a 200% display, the actual physical
icon size is (64, 64). Xbox 360 achievement icons are 64x64, so this will
show the full icon on a 200% display instead of scaling down to 32x32,
then scaling back up to 64x64.
For icons smaller than 32x32, the icon is scaled up using integer factors
to the next highest integer multiple that's >= 32x32, then the device
pixel ratio is set.
NOTE: GTK+ doesn't seem to have the same issue.
TODO: Verify Win32, especially with icon directories.
For standalone Win3.x icons and cursors only.
Color depth and format are shown, including if it's PNG format.
ICOPrivate::loadImage(): Remove caching stuff, since it's handled
by ICO::loadInternalImage().
Note that we have to use NtWriteFile(). Using WriteFile() results in
ERROR_BAD_COMMAND.
If the ADS write fails, it will be deleted with NtDeleteFile().
NOTE: Unicode only! ANSI builds won't write the ADS anymore.
ANSI builds (if they even work at all) should only be used on
Win9x, which doesn't support ADS anyway.
TODO: Convert NTSTATUS to POSIX error codes?
This simplifies the code a bit more and removes some function calls.
dir.rt is the individual bitmap resource type: RT_ICON, RT_CURSOR
dir.is_res is true for .exe/.dll resources, and false for .ico/.cur files.
This will allow us to show a list of all the bitmaps in a given icon.
NOTE: loadInternalImage() ensures that d->img_icon is set to the "best"
icon; that is, icon index "-1". The loadImage_*() functions won't use
d->img_icon themselves, so if the "best" icon is manually selected
using positive indexes, it won't be cached.
.mui is a resource DLL used for localization.
.mun is used in Windows 10 1903+ (or possibly slightly earlier) for
icons in C:\Windows\SystemResources\ , instead of storing icons in
e.g. notepad.exe.
Compiled with:
- i386: gcc-15.1.0, MinGW-w64 12.0.0
- amd64: gcc-15.1.0, MinGW-w64 12.0.0
The file sizes have grown a bit. In particular, xgettext.exe grew from
1,529,344 bytes to 8,492,544 bytes. This might be related to various
gnulib updates, since libgnuintl-8.dll has a bunch of new exports
compared to 0.24.
Tested by converting Win2.x BANG.ICO to Win3.x format.
ICOPrivate::loadImage_Win1():
- Note that the mask is *before* the icon.
ImageDecoder::fromLinearMono_WinIcon():
- Take separate pointers for the icon and mask data. Win3.x icons are
typically stored upside-down, so this lets us handle that outside
of the decoder function. This also means the image data size does
not have to be 2x. Note that `img_siz == mask_siz` must be true.
The fields are displayed as-is.
Changed autorun_inf from unordered_map<> to map<> for alphabetical sorting.
TODO: Preserve the original sort order?
TODO: Store the original key case?
It's not displayed yet, but it's loaded.
The section names are concatenated with the key names, e.g.:
"autorun|icon"
IsoPartition::open(): Set m_lastError = ENOENT if the file isn't found.
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.)
Windows 1.x/2.x does not have RT_GROUP_ICON. For NE executables,
check for RT_GROUP_ICON, and use it if found. Otherwise, check for
RT_ICON and use that if found.
IResourceReader: Add a function has_resource_type() to check if the
executable has any resources of the specified type.
[librptexture] ICO: Handle RT_ICON and RT_CURSOR as Windows 1.x/2.x.
TODO: Check the header to verify?
With Win16, the high bit needs to be set for ordinal resources.
Otherwise, it's a named resource, which we don't support right now.
Thumbnailing still worked because we were using the code path for
the "first" icon using NEResourceReader::open(), which had the
`| 0x8000` bit already.
SkiFree doesn't have any named resources, so its resource table ends
immediately after rscEndTypes. The off-by-one prevented us from
recognizing the presence of rscEndTypes.
SKI.EXE can now be thumbnailed.
I was considering exporting this from IsoPartition, but the IsoPartition
isn't accessible at this point. We're reading all of the volume
descriptors in checkVolumeDescriptors() anyway, so that sets a local
version of jolietSVDType, which is then checked in loadFieldData().
If a Supplementary Volume Descriptor is present, check for the Joliet
UCS-2 escape sequences. If found, use the SVD root directory.
Filenames in the SVD root directory are encoded in UCS-2 (big-endian).
The filename length is in bytes, not code points.
NOTE: Currently using a very cheap hack to convert UCS-2 to cp1252,
or more accurately, ISO-8859-1. It's good enough for our purposes
for now. (specifically, getting the icon from AUTORUN.INF.)
TODO: Better character set conversion.