mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-24 12:16:09 +00:00
chore: format Minecraft.Client
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
#include "../Platform/stdafx.h"
|
||||
#include "MobSkinTextureProcessor.h"
|
||||
|
||||
BufferedImage *MobSkinTextureProcessor::process(BufferedImage *in)
|
||||
{
|
||||
BufferedImage* MobSkinTextureProcessor::process(BufferedImage* in) {
|
||||
if (in == NULL) return NULL;
|
||||
|
||||
width = 64;
|
||||
height = 32;
|
||||
|
||||
BufferedImage *out = new BufferedImage(width, height, BufferedImage::TYPE_INT_ARGB);
|
||||
Graphics *g = out->getGraphics();
|
||||
BufferedImage* out =
|
||||
new BufferedImage(width, height, BufferedImage::TYPE_INT_ARGB);
|
||||
Graphics* g = out->getGraphics();
|
||||
g->drawImage(in, 0, 0, NULL);
|
||||
g->dispose();
|
||||
|
||||
@@ -20,17 +20,14 @@ BufferedImage *MobSkinTextureProcessor::process(BufferedImage *in)
|
||||
setNoAlpha(0, 16, 64, 32);
|
||||
bool hasAlpha = false;
|
||||
for (int x = 32; x < 64; x++)
|
||||
for (int y = 0; y < 16; y++)
|
||||
{
|
||||
for (int y = 0; y < 16; y++) {
|
||||
int pix = pixels[x + y * 64];
|
||||
if (((pix >> 24) & 0xff) < 128) hasAlpha = true;
|
||||
}
|
||||
|
||||
if (!hasAlpha)
|
||||
{
|
||||
if (!hasAlpha) {
|
||||
for (int x = 32; x < 64; x++)
|
||||
for (int y = 0; y < 16; y++)
|
||||
{
|
||||
for (int y = 0; y < 16; y++) {
|
||||
int pix = pixels[x + y * 64];
|
||||
if (((pix >> 24) & 0xff) < 128) hasAlpha = true;
|
||||
}
|
||||
@@ -39,31 +36,25 @@ BufferedImage *MobSkinTextureProcessor::process(BufferedImage *in)
|
||||
return out;
|
||||
}
|
||||
|
||||
void MobSkinTextureProcessor::setForceAlpha(int x0, int y0, int x1, int y1)
|
||||
{
|
||||
void MobSkinTextureProcessor::setForceAlpha(int x0, int y0, int x1, int y1) {
|
||||
if (hasAlpha(x0, y0, x1, y1)) return;
|
||||
|
||||
for (int x = x0; x < x1; x++)
|
||||
for (int y = y0; y < y1; y++)
|
||||
{
|
||||
for (int y = y0; y < y1; y++) {
|
||||
pixels[x + y * width] &= 0x00ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
void MobSkinTextureProcessor::setNoAlpha(int x0, int y0, int x1, int y1)
|
||||
{
|
||||
void MobSkinTextureProcessor::setNoAlpha(int x0, int y0, int x1, int y1) {
|
||||
for (int x = x0; x < x1; x++)
|
||||
for (int y = y0; y < y1; y++)
|
||||
{
|
||||
for (int y = y0; y < y1; y++) {
|
||||
pixels[x + y * width] |= 0xff000000;
|
||||
}
|
||||
}
|
||||
|
||||
bool MobSkinTextureProcessor::hasAlpha(int x0, int y0, int x1, int y1)
|
||||
{
|
||||
bool MobSkinTextureProcessor::hasAlpha(int x0, int y0, int x1, int y1) {
|
||||
for (int x = x0; x < x1; x++)
|
||||
for (int y = y0; y < y1; y++)
|
||||
{
|
||||
for (int y = y0; y < y1; y++) {
|
||||
int pix = pixels[x + y * width];
|
||||
if (((pix >> 24) & 0xff) < 128) return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user