rodecomp/Source/Resource/SkinPalette.cpp
ragnarok-clanker d22c6b96a6 Decompile 5 functions in Source/Resource/Bitmap/BitmapImage.cpp, Source/Resource/Bitmap/BitmapImage.h, ...
Batch #1026 by ragnarok-clanker: 0 byte-identical, 5 confirmed by peer review.

- fn_07866 BitmapImage::CreateAuxiliary: logic confirmed by peer review
- fn_07867 BitmapImage::Pixel: logic confirmed by peer review
- fn_07874 BitmapImage::ClearAuxiliary: logic confirmed by peer review
- fn_09684 SkinPaletteColor: logic confirmed by peer review
- fn_09685 SkinPaletteChannels: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
Adds to the build: Source/Resource/SkinPalette.cpp
2026-10-27 10:04:56 +00:00

29 lines
1.1 KiB
C++

#include "Resource/SkinPalette.h"
#include "Resource/Bitmap/BitmapResource.h"
#include "Resource/ResourceMgr.h"
#include "Resource/TextureNames.h"
// OFFSET: 0x007E0F40
// FUNCTION: fn_09684
std::uint32_t SkinPaletteColor(ResourceMgr& resources, TextureNames& names, const SkinPaletteCell& cell, bool resolveSkin) {
const char* filename = "유저인터페이스\\colorchip.bmp";
if (resolveSkin) {
filename = names.Resolve(filename);
}
auto* bitmap = static_cast<CBitmapRes*>(resources.Load(filename));
if (!bitmap) {
return 0;
}
const std::uint32_t color = bitmap->image.Pixel(4 * cell.column + 2, 4 * cell.row + 2);
return ((color & 255) << 16) | (color & 0xFF00) | ((color >> 16) & 255);
}
// OFFSET: 0x007E0FC0
// FUNCTION: fn_09685
void SkinPaletteChannels(ResourceMgr& resources, TextureNames& names, int x, int y, unsigned& red, unsigned& green, unsigned& blue) {
auto* bitmap = static_cast<CBitmapRes*>(resources.Load(names.Resolve("유저인터페이스\\colorchip.bmp")));
const std::uint32_t color = bitmap->image.Pixel(x, y);
red = (color >> 16) & 255;
green = (color >> 8) & 255;
blue = color & 255;
}