Batch #11529 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_09684 SkinPaletteColor: logic confirmed by peer review Peer-reviewed-by: Yommy, Tanke Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
29 lines
1.1 KiB
C++
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, const SkinPaletteCell& cell, bool resolveSkin) {
|
|
const char* filename = "유저인터페이스\\colorchip.bmp";
|
|
if (resolveSkin) {
|
|
filename = Resolve(filename);
|
|
}
|
|
auto* bitmap = static_cast<CBitmapRes*>(resources.Load(filename));
|
|
if (bitmap) {
|
|
const std::uint32_t color = bitmap->image.Pixel(4 * cell.column + 2, 4 * cell.row + 2);
|
|
return RGB((color >> 16) & 255, (color >> 8) & 255, color & 255);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// OFFSET: 0x007E0FC0
|
|
// FUNCTION: fn_09685
|
|
void SkinPaletteChannels(ResourceMgr& resources, int x, int y, unsigned& red, unsigned& green, unsigned& blue) {
|
|
auto* bitmap = static_cast<CBitmapRes*>(resources.Load(Resolve("유저인터페이스\\colorchip.bmp")));
|
|
const std::uint32_t color = bitmap->image.Pixel(x, y);
|
|
red = (color >> 16) & 255;
|
|
green = (color >> 8) & 255;
|
|
blue = color & 255;
|
|
}
|