mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-08-20 09:57:09 +00:00
Skins
This commit is contained in:
parent
c678f0d081
commit
a0082658a5
|
|
@ -62,6 +62,7 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
app.DebugPrintf("LivingEntityRenderer::render called for type %d\n", _mob->GetType());
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glDisable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
|
|
@ -416,8 +417,7 @@ void LivingEntityRenderer::renderArrows(shared_ptr<LivingEntity> mob, float a)
|
||||||
{
|
{
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
|
||||||
ModelPart *modelPart;
|
ModelPart *modelPart = resModel->getRandomModelPart(random);
|
||||||
modelPart = resModel->getRandomModelPart(random);
|
|
||||||
|
|
||||||
Cube *cube = modelPart->cubes[random.nextInt(modelPart->cubes.size())];
|
Cube *cube = modelPart->cubes[random.nextInt(modelPart->cubes.size())];
|
||||||
modelPart->translateTo(1 / 16.0f);
|
modelPart->translateTo(1 / 16.0f);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "ResourceLocation.h"
|
#include "ResourceLocation.h"
|
||||||
#include "EntityRenderer.h"
|
#include "EntityRenderer.h"
|
||||||
#include "..\Minecraft.World\LivingEntity.h"
|
#include "../Minecraft.World/LivingEntity.h"
|
||||||
|
|
||||||
class LivingEntity;
|
class LivingEntity;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -533,7 +533,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerRenderer::renderNameTags(shared_ptr<LivingEntity> player, double x, double y, double z, wstring msg, float scale, double dist)
|
void PlayerRenderer::renderNameTags(shared_ptr<LivingEntity> player, double x, double y, double z, const wstring &msg, float scale, double dist)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
if (dist < 10 * 10)
|
if (dist < 10 * 10)
|
||||||
|
|
@ -559,7 +559,17 @@ void PlayerRenderer::renderNameTags(shared_ptr<LivingEntity> player, double x, d
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LivingEntityRenderer::renderNameTags(player, x, y, z, msg, scale, dist);
|
shared_ptr<Player> pPlayer = dynamic_pointer_cast<Player>(player);
|
||||||
|
int color = getNametagColour(pPlayer->getPlayerIndex());
|
||||||
|
|
||||||
|
if (player->isSleeping())
|
||||||
|
{
|
||||||
|
renderNameTag(player, msg, x, y - 1.5f, z, 64, color);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
renderNameTag(player, msg, x, y, z, 64, color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerRenderer::scale(shared_ptr<LivingEntity> player, float a)
|
void PlayerRenderer::scale(shared_ptr<LivingEntity> player, float a)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "MobRenderer.h"
|
#include "MobRenderer.h"
|
||||||
#include "..\Minecraft.World\Player.h"
|
#include "../Minecraft.World/Player.h"
|
||||||
|
|
||||||
class HumanoidModel;
|
class HumanoidModel;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,13 @@ void SkullTileRenderer::renderSkull(float x, float y, float z, int face, float r
|
||||||
//model = zombieModel;
|
//model = zombieModel;
|
||||||
break;
|
break;
|
||||||
case SkullTileEntity::TYPE_CHAR:
|
case SkullTileEntity::TYPE_CHAR:
|
||||||
|
{
|
||||||
|
Textures *textures = Minecraft::GetInstance()->textures;
|
||||||
|
|
||||||
|
if (getHeight(&PlayerRenderer::DEFAULT_LOCATION) == 64)
|
||||||
|
{
|
||||||
|
model = new SkeletonHeadModel(0, 0, 64, 64);
|
||||||
|
}
|
||||||
//if (!extra.empty())
|
//if (!extra.empty())
|
||||||
//{
|
//{
|
||||||
// wstring url = "http://skins.minecraft.net/MinecraftSkins/" + StringUtil.stripColor(extra) + ".png";
|
// wstring url = "http://skins.minecraft.net/MinecraftSkins/" + StringUtil.stripColor(extra) + ".png";
|
||||||
|
|
@ -67,6 +74,7 @@ void SkullTileRenderer::renderSkull(float x, float y, float z, int face, float r
|
||||||
bindTexture(&PlayerRenderer::DEFAULT_LOCATION);
|
bindTexture(&PlayerRenderer::DEFAULT_LOCATION);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case SkullTileEntity::TYPE_CREEPER:
|
case SkullTileEntity::TYPE_CREEPER:
|
||||||
bindTexture(&CREEPER_LOCATION);
|
bindTexture(&CREEPER_LOCATION);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1058,6 +1058,7 @@ int Textures::loadHttpTexture(const wstring& url, const wstring& backup)
|
||||||
}
|
}
|
||||||
if (texture == nullptr || texture->id < 0)
|
if (texture == nullptr || texture->id < 0)
|
||||||
{
|
{
|
||||||
|
if (backup.empty() ) return -1;
|
||||||
return loadTexture(TN_COUNT, backup);
|
return loadTexture(TN_COUNT, backup);
|
||||||
}
|
}
|
||||||
return texture->id;
|
return texture->id;
|
||||||
|
|
@ -1209,7 +1210,6 @@ int Textures::loadMemTexture(const wstring& url, int backup)
|
||||||
return texture->id;
|
return texture->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4J-PB - adding for texture in memory (from global title storage)
|
|
||||||
int Textures::getHeight(const wstring& url, int backup)
|
int Textures::getHeight(const wstring& url, int backup)
|
||||||
{
|
{
|
||||||
MemTexture *texture = nullptr;
|
MemTexture *texture = nullptr;
|
||||||
|
|
@ -1262,6 +1262,37 @@ int Textures::getHeight(const wstring& url, int backup)
|
||||||
return texture->loadedImage->getHeight();
|
return texture->loadedImage->getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Textures::getHeight(ResourceLocation resource)
|
||||||
|
{
|
||||||
|
if (resource.isPreloaded())
|
||||||
|
{
|
||||||
|
TEXTURE_NAME tex = resource.getTexture();
|
||||||
|
|
||||||
|
BufferedImage* img = readImage(tex, wstring(preLoaded[tex]) + L".png");
|
||||||
|
if (img)
|
||||||
|
{
|
||||||
|
int h = img->getHeight();
|
||||||
|
delete img;
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
const wstring& path = resource.getPath();
|
||||||
|
|
||||||
|
BufferedImage* img = readImage(TN_COUNT, path);
|
||||||
|
if (img)
|
||||||
|
{
|
||||||
|
int h = img->getHeight();
|
||||||
|
delete img;
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MemTexture *Textures::addMemTexture(const wstring& name,MemTextureProcessor *processor)
|
MemTexture *Textures::addMemTexture(const wstring& name,MemTextureProcessor *processor)
|
||||||
{
|
{
|
||||||
MemTexture *texture = nullptr;
|
MemTexture *texture = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "..\Minecraft.World\ArrayWithLength.h"
|
#include "../Minecraft.World/ArrayWithLength.h"
|
||||||
|
|
||||||
class DynamicTexture;
|
class DynamicTexture;
|
||||||
class BufferedImage;
|
class BufferedImage;
|
||||||
|
|
@ -341,6 +341,7 @@ public:
|
||||||
int loadMemTexture(const wstring& url, const wstring& backup);
|
int loadMemTexture(const wstring& url, const wstring& backup);
|
||||||
int loadMemTexture(const wstring& url, int backup);
|
int loadMemTexture(const wstring& url, int backup);
|
||||||
int getHeight(const wstring& url, int backup);
|
int getHeight(const wstring& url, int backup);
|
||||||
|
int getHeight(ResourceLocation resource);
|
||||||
MemTexture * addMemTexture(const wstring& url, MemTextureProcessor *processor);
|
MemTexture * addMemTexture(const wstring& url, MemTextureProcessor *processor);
|
||||||
//MemTexture * getMemTexture(const wstring& url, MemTextureProcessor *processor);
|
//MemTexture * getMemTexture(const wstring& url, MemTextureProcessor *processor);
|
||||||
void removeMemTexture(const wstring& url);
|
void removeMemTexture(const wstring& url);
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,13 @@ void TileEntityRenderer::bindTexture(const wstring& urlTexture, ResourceLocation
|
||||||
if(t != nullptr) t->bind(t->loadHttpTexture(urlTexture, location->getTexture()));
|
if(t != nullptr) t->bind(t->loadHttpTexture(urlTexture, location->getTexture()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int TileEntityRenderer::getHeight(ResourceLocation *location)
|
||||||
|
{
|
||||||
|
Textures *t = tileEntityRenderDispatcher->textures;
|
||||||
|
if(t != nullptr) return t->getHeight(location->getTexture());
|
||||||
|
return 32;
|
||||||
|
}
|
||||||
|
|
||||||
Level *TileEntityRenderer::getLevel()
|
Level *TileEntityRenderer::getLevel()
|
||||||
{
|
{
|
||||||
return tileEntityRenderDispatcher->level;
|
return tileEntityRenderDispatcher->level;
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
void bindTexture(ResourceLocation *location); // 4J - changed from wstring to int
|
void bindTexture(ResourceLocation *location); // 4J - changed from wstring to int
|
||||||
void bindTexture(const wstring& urlTexture, ResourceLocation *location); // 4J - changed from wstring to int
|
void bindTexture(const wstring& urlTexture, ResourceLocation *location); // 4J - changed from wstring to int
|
||||||
|
int getHeight(ResourceLocation *location); // 4J - changed from wstring to int
|
||||||
private:
|
private:
|
||||||
Level *getLevel();
|
Level *getLevel();
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Candy/Data/media.arc
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Candy/Data/media.arc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Cartoon/Data/media.arc
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Cartoon/Data/media.arc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/City/Data/media.arc
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/City/Data/media.arc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Fantasy/Data/media.arc
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Fantasy/Data/media.arc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halloween/Data/media.arc
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halloween/Data/media.arc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Cairo Suite 2.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Cairo Suite 2.ogg
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Dewy Decimate.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Dewy Decimate.ogg
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Earth City.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Earth City.ogg
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Finale 1.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Finale 1.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/First Step.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/First Step.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Flollo.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Flollo.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/HALO M02.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/HALO M02.ogg
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Intimate.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Intimate.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Night Dreams.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Night Dreams.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Quiet Giant.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Quiet Giant.ogg
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Rising Legacy.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Rising Legacy.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Spirit of Fire.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Spirit of Fire.ogg
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Still, Moving.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Still, Moving.ogg
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Suite Fall.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Suite Fall.ogg
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Survive.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/Survive.ogg
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/The Big Guns.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/The Big Guns.ogg
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/halo.mcs
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/halo.mcs
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/media.arc
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Halo/Data/media.arc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/LittleBigPlanet/Skins.pck
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/LittleBigPlanet/Skins.pck
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/03-Mars.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/03-Mars.ogg
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/media.arc
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/media.arc
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/x16Data.pck
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/x16Data.pck
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Mass Effect/TexturePack.pck
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Mass Effect/TexturePack.pck
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/DLC/Natural/Data/media.arc
Normal file
BIN
Minecraft.Client/Windows64Media/DLC/Natural/Data/media.arc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue