support scaling of avatar texture - multiples of 35x50
default was 35x50 avatar texture, if using 3x (105x150), it will scale it :)
This commit is contained in:
@@ -60,8 +60,8 @@ void GuiAvatar::Render()
|
|||||||
{
|
{
|
||||||
if (corner == BOTTOM_RIGHT)
|
if (corner == BOTTOM_RIGHT)
|
||||||
{
|
{
|
||||||
x0 -= player->getIcon()->mWidth * actZ;
|
x0 -= Width * actZ;
|
||||||
y0 -= player->getIcon()->mHeight * actZ;
|
y0 -= Height * actZ;
|
||||||
}
|
}
|
||||||
switch (corner)
|
switch (corner)
|
||||||
{
|
{
|
||||||
@@ -69,14 +69,14 @@ void GuiAvatar::Render()
|
|||||||
player->getIcon()->SetHotSpot(0, 0);
|
player->getIcon()->SetHotSpot(0, 0);
|
||||||
break;
|
break;
|
||||||
case BOTTOM_RIGHT:
|
case BOTTOM_RIGHT:
|
||||||
player->getIcon()->SetHotSpot(35, 50);
|
player->getIcon()->SetHotSpot(player->getIcon()->mWidth, player->getIcon()->mHeight);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
player->getIcon()->SetColor(ARGB((int)actA, 255, avatarRed, avatarRed));
|
player->getIcon()->SetColor(ARGB((int)actA, 255, avatarRed, avatarRed));
|
||||||
r->RenderQuad(player->getIcon().get(), actX, actY, actT, actZ, actZ);
|
r->RenderQuad(player->getIcon().get(), actX, actY, actT, Width/player->getIcon()->mWidth*actZ, Height/player->getIcon()->mHeight*actZ);
|
||||||
if (mHasFocus)
|
if (mHasFocus)
|
||||||
{
|
{
|
||||||
r->FillRect(x0, x0, player->getIcon()->mWidth * actZ, player->getIcon()->mHeight * actZ, ARGB(abs(128 - wave),255,255,255));
|
r->FillRect(x0, x0, Width/player->getIcon()->mWidth * actZ, Height/player->getIcon()->mHeight * actZ, ARGB(abs(128 - wave),255,255,255));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ bool Player::loadAvatar(string file, string resName)
|
|||||||
}
|
}
|
||||||
mAvatarTex = rm->RetrieveTexture(file, RETRIEVE_LOCK, TEXTURE_SUB_AVATAR);
|
mAvatarTex = rm->RetrieveTexture(file, RETRIEVE_LOCK, TEXTURE_SUB_AVATAR);
|
||||||
if (mAvatarTex) {
|
if (mAvatarTex) {
|
||||||
mAvatar = rm->RetrieveQuad(file, 0, 0, 35, 50, resName, RETRIEVE_NORMAL, TEXTURE_SUB_AVATAR);
|
mAvatar = rm->RetrieveQuad(file, 0, 0, 0, 0, resName, RETRIEVE_NORMAL, TEXTURE_SUB_AVATAR);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user