Permalink
Browse files

- narrowing down the public interface of the texture class

Cannot refactor if the entire class is this wide open to everything.
Not complete yet, doesn't fully compile!
  • Loading branch information...
coelckers committed Dec 6, 2018
1 parent e83af15 commit 6eab4a882ce7d49612f41ae85788baa4274ac4ed
Showing with 608 additions and 518 deletions.
  1. +10 −11 src/am_map.cpp
  2. +4 −4 src/d_main.cpp
  3. +2 −2 src/f_wipe.cpp
  4. +2 −2 src/fragglescript/t_func.cpp
  5. +3 −3 src/g_shared/a_decals.cpp
  6. +1 −1 src/g_shared/a_dynlight.cpp
  7. +21 −21 src/g_statusbar/sbarinfo.cpp
  8. +16 −16 src/g_statusbar/sbarinfo_commands.cpp
  9. +12 −12 src/g_statusbar/shared_sbar.cpp
  10. +7 −5 src/gl/renderer/gl_renderstate.cpp
  11. +7 −6 src/gl/shaders/gl_postprocessshader.cpp
  12. +8 −8 src/gl/system/gl_framebuffer.cpp
  13. +5 −3 src/gl/textures/gl_hwtexture.cpp
  14. +3 −3 src/hu_scores.cpp
  15. +1 −1 src/hwrenderer/scene/hw_bsp.cpp
  16. +4 −4 src/hwrenderer/scene/hw_fakeflat.cpp
  17. +1 −1 src/hwrenderer/scene/hw_flats.cpp
  18. +2 −2 src/hwrenderer/scene/hw_renderhacks.cpp
  19. +5 −5 src/hwrenderer/scene/hw_sky.cpp
  20. +3 −3 src/hwrenderer/scene/hw_skydome.cpp
  21. +1 −1 src/hwrenderer/scene/hw_skyportal.cpp
  22. +2 −2 src/hwrenderer/scene/hw_sprites.cpp
  23. +4 −4 src/hwrenderer/scene/hw_walls.cpp
  24. +1 −1 src/hwrenderer/scene/hw_weapon.cpp
  25. +10 −48 src/hwrenderer/textures/hw_material.cpp
  26. +7 −2 src/hwrenderer/textures/hw_material.h
  27. +6 −9 src/hwrenderer/textures/hw_precache.cpp
  28. +1 −1 src/hwrenderer/utility/hw_draw2d.cpp
  29. +4 −4 src/intermission/intermission.cpp
  30. +1 −1 src/menu/loadsavemenu.cpp
  31. +1 −1 src/p_acs.cpp
  32. +2 −3 src/p_doors.cpp
  33. +9 −9 src/p_sectors.cpp
  34. +6 −6 src/polyrenderer/drawers/poly_draw_args.cpp
  35. +11 −11 src/polyrenderer/drawers/poly_draw_args.h
  36. +2 −2 src/polyrenderer/poly_renderthread.cpp
  37. +1 −1 src/polyrenderer/poly_renderthread.h
  38. +7 −5 src/polyrenderer/scene/poly_decal.cpp
  39. +2 −2 src/polyrenderer/scene/poly_model.cpp
  40. +1 −1 src/polyrenderer/scene/poly_model.h
  41. +10 −10 src/polyrenderer/scene/poly_plane.cpp
  42. +1 −1 src/polyrenderer/scene/poly_plane.h
  43. +12 −9 src/polyrenderer/scene/poly_playersprite.cpp
  44. +2 −2 src/polyrenderer/scene/poly_playersprite.h
  45. +20 −12 src/polyrenderer/scene/poly_sky.cpp
  46. +3 −3 src/polyrenderer/scene/poly_sky.h
  47. +20 −13 src/polyrenderer/scene/poly_sprite.cpp
  48. +1 −1 src/polyrenderer/scene/poly_sprite.h
  49. +18 −18 src/polyrenderer/scene/poly_wall.cpp
  50. +7 −7 src/polyrenderer/scene/poly_wall.h
  51. +6 −6 src/polyrenderer/scene/poly_wallsprite.cpp
  52. +10 −12 src/posix/cocoa/i_video.mm
  53. +5 −15 src/r_data/gldefs.cpp
  54. +2 −2 src/r_data/sprites.cpp
  55. +17 −7 src/r_sky.cpp
  56. +1 −1 src/r_utility.cpp
  57. +1 −1 src/scripting/vm/jit_move.cpp
  58. +1 −1 src/scripting/vm/vmexec.h
  59. +1 −1 src/scripting/vmthunks.cpp
  60. +1 −1 src/swrenderer/r_renderthread.cpp
  61. +1 −1 src/swrenderer/r_swrenderer.cpp
  62. +1 −1 src/swrenderer/things/r_playersprite.h
  63. +4 −4 src/swrenderer/viewport/r_spritedrawer.cpp
  64. +2 −2 src/textures/animations.cpp
  65. +1 −1 src/textures/formats/canvastexture.cpp
  66. +2 −2 src/textures/formats/multipatchtexture.cpp
  67. +1 −1 src/textures/formats/worldtexture.cpp
  68. +3 −2 src/textures/skyboxtexture.cpp
  69. +3 −5 src/textures/skyboxtexture.h
  70. +19 −63 src/textures/texture.cpp
  71. +192 −31 src/textures/textures.h
  72. +11 −12 src/v_2ddrawer.cpp
  73. +21 −21 src/v_draw.cpp
  74. +12 −22 src/v_font.cpp
@@ -1198,8 +1198,8 @@ static void AM_ScrollParchment (double dmapx, double dmapy)
if (backtex != NULL)
{
int pwidth = backtex->GetWidth();
int pheight = backtex->GetHeight();
int pwidth = backtex->GetDisplayWidth();
int pheight = backtex->GetDisplayHeight();
while(mapxstart > 0)
mapxstart -= pwidth;
@@ -1692,8 +1692,8 @@ void AM_clearFB (const AMColor &color)
FTexture *backtex = TexMan[mapback];
if (backtex != NULL)
{
int pwidth = backtex->GetWidth();
int pheight = backtex->GetHeight();
int pwidth = backtex->GetDisplayWidth();
int pheight = backtex->GetDisplayHeight();
int x, y;
//blit the automap background to the screen.
@@ -2212,8 +2212,7 @@ void AM_drawSubsectors()
}
// Draw the polygon.
FTexture *pic = TexMan(maptex);
if (pic != nullptr && pic->UseType != ETextureType::Null)
if (maptex.isValid())
{
// Hole filling "subsectors" are not necessarily convex so they require real triangulation.
// These things are extremely rare so performance is secondary here.
@@ -3116,7 +3115,7 @@ void AM_drawThings ()
static void DrawMarker (FTexture *tex, double x, double y, int yadjust,
INTBOOL flip, double xscale, double yscale, int translation, double alpha, uint32_t fillcolor, FRenderStyle renderstyle)
{
if (tex == NULL || tex->UseType == ETextureType::Null)
if (tex == NULL || !tex->isValid())
{
return;
}
@@ -3125,8 +3124,8 @@ static void DrawMarker (FTexture *tex, double x, double y, int yadjust,
AM_rotatePoint (&x, &y);
}
screen->DrawTexture (tex, CXMTOF(x) + f_x, CYMTOF(y) + yadjust + f_y,
DTA_DestWidthF, tex->GetScaledWidthDouble() * CleanXfac * xscale,
DTA_DestHeightF, tex->GetScaledHeightDouble() * CleanYfac * yscale,
DTA_DestWidthF, tex->GetDisplayWidthDouble() * CleanXfac * xscale,
DTA_DestHeightF, tex->GetDisplayHeightDouble() * CleanYfac * yscale,
DTA_ClipTop, f_y,
DTA_ClipBottom, f_y + f_h,
DTA_ClipLeft, f_x,
@@ -3185,9 +3184,9 @@ void AM_drawAuthorMarkers ()
if (mark->picnum.isValid())
{
tex = TexMan(mark->picnum);
if (tex->Rotations != 0xFFFF)
if (tex->GetRotations() != 0xFFFF)
{
spriteframe_t *sprframe = &SpriteFrames[tex->Rotations];
spriteframe_t *sprframe = &SpriteFrames[tex->GetRotations()];
picnum = sprframe->Texture[0];
flip = sprframe->Flip & 1;
tex = TexMan[picnum];
@@ -835,15 +835,15 @@ void D_Display ()
FString pstring = "By ";
tex = TexMan(gameinfo.PauseSign);
x = (SCREENWIDTH - tex->GetScaledWidth() * CleanXfac)/2 +
tex->GetScaledLeftOffset(0) * CleanXfac;
x = (SCREENWIDTH - tex->GetDisplayWidth() * CleanXfac)/2 +
tex->GetDisplayLeftOffset() * CleanXfac;
screen->DrawTexture (tex, x, 4, DTA_CleanNoMove, true, TAG_DONE);
if (paused && multiplayer)
{
pstring += players[paused - 1].userinfo.GetName();
screen->DrawText(SmallFont, CR_RED,
(screen->GetWidth() - SmallFont->StringWidth(pstring)*CleanXfac) / 2,
(tex->GetScaledHeight() * CleanYfac) + 4, pstring, DTA_CleanNoMove, true, TAG_DONE);
(tex->GetDisplayHeight() * CleanYfac) + 4, pstring, DTA_CleanNoMove, true, TAG_DONE);
}
}
@@ -856,7 +856,7 @@ void D_Display ()
if (picnum.isValid())
{
FTexture *tex = TexMan[picnum];
screen->DrawTexture (tex, 160 - tex->GetScaledWidth()/2, 100 - tex->GetScaledHeight()/2,
screen->DrawTexture (tex, 160 - tex->GetDisplayWidth()/2, 100 - tex->GetDisplayHeight()/2,
DTA_320x200, true, TAG_DONE);
}
NoWipe = 10;
@@ -304,8 +304,8 @@ bool Wiper_Melt::Run(int ticks)
// Only draw for the final tick.
// No need for optimization. Wipes won't ever be drawn with anything else.
int w = startScreen->GetWidth();
int h = startScreen->GetHeight();
int w = startScreen->GetDisplayWidth();
int h = startScreen->GetDisplayHeight();
dpt.x = i * w / WIDTH;
dpt.y = MAX(0, y[i] * h / HEIGHT);
rect.left = dpt.x;
@@ -1904,7 +1904,7 @@ void FParser::SF_FloorTexture(void)
t_return.type = svt_string;
FTexture * tex = TexMan[sector->GetTexture(sector_t::floor)];
t_return.string = tex? tex->Name : "";
t_return.string = tex? tex->GetName() : "";
}
}
@@ -1994,7 +1994,7 @@ void FParser::SF_CeilingTexture(void)
t_return.type = svt_string;
FTexture * tex = TexMan[sector->GetTexture(sector_t::ceiling)];
t_return.string = tex? tex->Name : "";
t_return.string = tex? tex->GetName() : "";
}
}
@@ -264,7 +264,7 @@ FTextureID DBaseDecal::StickToWall (side_t *wall, double x, double y, F3DFloor *
FTexture *texture = TexMan[tex];
if (texture == NULL || texture->bNoDecals)
if (texture == NULL || texture->allowNoDecals())
{
return FNullTextureID();
}
@@ -497,10 +497,10 @@ void DBaseDecal::Spread (const FDecalTemplate *tpl, side_t *wall, double x, doub
return;
}
int dwidth = tex->GetWidth ();
int dwidth = tex->GetDisplayWidth ();
DecalWidth = dwidth * ScaleX;
DecalLeft = tex->GetLeftOffset(0) * ScaleX;
DecalLeft = tex->GetDisplayLeftOffset() * ScaleX;
DecalRight = DecalWidth - DecalLeft;
SpreadSource = this;
SpreadTemplate = tpl;
@@ -937,7 +937,7 @@ CCMD(listlights)
if (dl->target)
{
FTextureID spr = sprites[dl->target->sprite].GetSpriteFrame(dl->target->frame, 0, 0., nullptr);
Printf(", frame = %s ", TexMan[spr]->Name.GetChars());
Printf(", frame = %s ", TexMan[spr]->GetName().GetChars());
}
@@ -1188,12 +1188,12 @@ class DSBarInfo
if((offsetflags & SBarInfoCommand::CENTER) == SBarInfoCommand::CENTER)
{
if (forceWidth < 0) dx -= (texture->GetScaledWidthDouble()/2.0)-texture->GetScaledLeftOffsetDouble(0);
else dx -= forceWidth*(0.5-(texture->GetScaledLeftOffsetDouble(0)/texture->GetScaledWidthDouble()));
//Unoptimalized ^^formula is dx -= forceWidth/2.0-(texture->GetScaledLeftOffsetDouble()*forceWidth/texture->GetScaledWidthDouble());
if (forceWidth < 0) dx -= (texture->GetDisplayWidthDouble()/2.0)-texture->GetDisplayLeftOffsetDouble();
else dx -= forceWidth*(0.5-(texture->GetDisplayLeftOffsetDouble()/texture->GetDisplayWidthDouble()));
//Unoptimalized ^^formula is dx -= forceWidth/2.0-(texture->GetScaledLeftOffsetDouble()*forceWidth/texture->GetDisplayWidthDouble());
if (forceHeight < 0) dy -= (texture->GetScaledHeightDouble()/2.0)-texture->GetScaledTopOffsetDouble(0);
else dy -= forceHeight*(0.5-(texture->GetScaledTopOffsetDouble(0)/texture->GetScaledHeightDouble()));
if (forceHeight < 0) dy -= (texture->GetDisplayHeightDouble()/2.0)-texture->GetDisplayTopOffsetDouble();
else dy -= forceHeight*(0.5-(texture->GetDisplayTopOffsetDouble()/texture->GetDisplayHeightDouble()));
}
dx += xOffset;
@@ -1202,12 +1202,12 @@ class DSBarInfo
if(!fullScreenOffsets)
{
double tmp = 0;
w = forceWidth < 0 ? texture->GetScaledWidthDouble() : forceWidth;
h = forceHeight < 0 ? texture->GetScaledHeightDouble() : forceHeight;
double dcx = clip[0] == 0 ? 0 : dx + clip[0] - texture->GetScaledLeftOffsetDouble(0);
double dcy = clip[1] == 0 ? 0 : dy + clip[1] - texture->GetScaledTopOffsetDouble(0);
double dcr = clip[2] == 0 ? INT_MAX : dx + w - clip[2] - texture->GetScaledLeftOffsetDouble(0);
double dcb = clip[3] == 0 ? INT_MAX : dy + h - clip[3] - texture->GetScaledTopOffsetDouble(0);
w = forceWidth < 0 ? texture->GetDisplayWidthDouble() : forceWidth;
h = forceHeight < 0 ? texture->GetDisplayHeightDouble() : forceHeight;
double dcx = clip[0] == 0 ? 0 : dx + clip[0] - texture->GetDisplayLeftOffsetDouble();
double dcy = clip[1] == 0 ? 0 : dy + clip[1] - texture->GetDisplayTopOffsetDouble();
double dcr = clip[2] == 0 ? INT_MAX : dx + w - clip[2] - texture->GetDisplayLeftOffsetDouble();
double dcb = clip[3] == 0 ? INT_MAX : dy + h - clip[3] - texture->GetDisplayTopOffsetDouble();
if(clip[0] != 0 || clip[1] != 0)
{
@@ -1271,8 +1271,8 @@ class DSBarInfo
bool xright = *x < 0 && !x.RelCenter();
bool ybot = *y < 0 && !y.RelCenter();
w = (forceWidth < 0 ? texture->GetScaledWidthDouble() : forceWidth);
h = (forceHeight < 0 ? texture->GetScaledHeightDouble() : forceHeight);
w = (forceWidth < 0 ? texture->GetDisplayWidthDouble() : forceWidth);
h = (forceHeight < 0 ? texture->GetDisplayHeightDouble() : forceHeight);
if(vid_fps && rx < 0 && ry >= 0)
ry += 10;
@@ -1289,10 +1289,10 @@ class DSBarInfo
// Check for clipping
if(clip[0] != 0 || clip[1] != 0 || clip[2] != 0 || clip[3] != 0)
{
rcx = clip[0] == 0 ? 0 : rx+((clip[0] - texture->GetScaledLeftOffsetDouble(0))*Scale.X);
rcy = clip[1] == 0 ? 0 : ry+((clip[1] - texture->GetScaledTopOffsetDouble(0))*Scale.Y);
rcr = clip[2] == 0 ? INT_MAX : rx+w-((clip[2] + texture->GetScaledLeftOffsetDouble(0))*Scale.X);
rcb = clip[3] == 0 ? INT_MAX : ry+h-((clip[3] + texture->GetScaledTopOffsetDouble(0))*Scale.Y);
rcx = clip[0] == 0 ? 0 : rx+((clip[0] - texture->GetDisplayLeftOffsetDouble())*Scale.X);
rcy = clip[1] == 0 ? 0 : ry+((clip[1] - texture->GetDisplayTopOffsetDouble())*Scale.Y);
rcr = clip[2] == 0 ? INT_MAX : rx+w-((clip[2] + texture->GetDisplayLeftOffsetDouble())*Scale.X);
rcb = clip[3] == 0 ? INT_MAX : ry+h-((clip[3] + texture->GetDisplayTopOffsetDouble())*Scale.Y);
}
if(clearDontDraw)
@@ -1389,13 +1389,13 @@ class DSBarInfo
int character = (unsigned char)*str;
if (script->spacingCharacter == '\0') //If we are monospaced lets use the offset
ax += (c->GetLeftOffset(0) + 1); //ignore x offsets since we adapt to character size
ax += (c->GetDisplayLeftOffset() + 1); //ignore x offsets since we adapt to character size
double rx, ry, rw, rh;
rx = ax + xOffset;
ry = ay + yOffset;
rw = c->GetScaledWidthDouble();
rh = c->GetScaledHeightDouble();
rw = c->GetDisplayWidthDouble();
rh = c->GetDisplayHeightDouble();
if(script->spacingCharacter != '\0')
{
@@ -1453,7 +1453,7 @@ class DSBarInfo
DTA_Alpha, Alpha,
TAG_DONE);
if (script->spacingCharacter == '\0')
ax += width + spacing - (c->GetLeftOffset(0) + 1);
ax += width + spacing - (c->GetDisplayLeftOffsetDouble() + 1);
else //width gets changed at the call to GetChar()
ax += font->GetCharWidth((unsigned char) script->spacingCharacter) + spacing;
str++;
@@ -69,8 +69,8 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
{
double scale1, scale2;
scale1 = scale2 = 1.0f;
double texwidth = (int) (texture->GetScaledWidthDouble()*spawnScaleX);
double texheight = (int) (texture->GetScaledHeightDouble()*spawnScaleY);
double texwidth = (int) (texture->GetDisplayWidthDouble()*spawnScaleX);
double texheight = (int) (texture->GetDisplayHeightDouble()*spawnScaleY);
if (w != -1 && (w<texwidth || (flags & DI_FORCESCALE)))
{
@@ -93,8 +93,8 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
}
else if (applyscale)
{
w=(int) (texture->GetScaledWidthDouble()*spawnScaleX);
h=(int) (texture->GetScaledHeightDouble()*spawnScaleY);
w=(int) (texture->GetDisplayWidthDouble()*spawnScaleX);
h=(int) (texture->GetDisplayHeightDouble()*spawnScaleY);
}
statusBar->DrawGraphic(texture, imgx, imgy, block->XOffset(), block->YOffset(), frameAlpha, block->FullScreenOffsets(),
translatable, false, offset, false, w, h);
@@ -300,7 +300,7 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
if (flags & DI_ALTERNATEONFAIL)
{
SetTruth(texture == NULL || texture->UseType == ETextureType::Null, block, statusBar);
SetTruth(texture == NULL || !texture->isValid(), block, statusBar);
}
}
protected:
@@ -2266,11 +2266,11 @@ class CommandDrawInventoryBar : public SBarInfoCommand
int spacing;
if (!vertical)
{
spacing = box->GetScaledWidth();
spacing = box->GetDisplayWidth();
}
else
{
spacing = box->GetScaledHeight();
spacing = box->GetDisplayHeight();
}
return spacing + ((style != STYLE_Strife) ? 1 : -1);
}
@@ -2370,21 +2370,21 @@ class CommandDrawKeyBar : public SBarInfoCommand
if(!vertical)
{
statusBar->DrawGraphic(TexMan(item->TextureIDVar(NAME_Icon)), x+slotOffset, y+rowOffset, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets());
rowWidth = rowIconSize == -1 ? TexMan(item->TextureIDVar(NAME_Icon))->GetScaledHeight()+2 : rowIconSize;
rowWidth = rowIconSize == -1 ? TexMan(item->TextureIDVar(NAME_Icon))->GetDisplayHeight()+2 : rowIconSize;
}
else
{
statusBar->DrawGraphic(TexMan(item->TextureIDVar(NAME_Icon)), x+rowOffset, y+slotOffset, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets());
rowWidth = rowIconSize == -1 ? TexMan(item->TextureIDVar(NAME_Icon))->GetScaledWidth()+2 : rowIconSize;
rowWidth = rowIconSize == -1 ? TexMan(item->TextureIDVar(NAME_Icon))->GetDisplayWidth()+2 : rowIconSize;
}
// If cmd.special is -1 then the slot size is auto detected
if(iconSize == -1)
{
if(!vertical)
slotOffset += (reverse ? -1 : 1) * (TexMan(item->TextureIDVar(NAME_Icon))->GetScaledWidth() + 2);
slotOffset += (reverse ? -1 : 1) * (TexMan(item->TextureIDVar(NAME_Icon))->GetDisplayWidth() + 2);
else
slotOffset += (reverse ? -1 : 1) * (TexMan(item->TextureIDVar(NAME_Icon))->GetScaledHeight() + 2);
slotOffset += (reverse ? -1 : 1) * (TexMan(item->TextureIDVar(NAME_Icon))->GetDisplayHeight() + 2);
}
else
slotOffset += (reverse ? -iconSize : iconSize);
@@ -2504,7 +2504,7 @@ class CommandDrawBar : public SBarInfoCommand
else
{
// Draw background
if (bg != NULL && bg->GetScaledWidth() == fg->GetScaledWidth() && bg->GetScaledHeight() == fg->GetScaledHeight())
if (bg != NULL && bg->GetDisplayWidth() == fg->GetDisplayWidth() && bg->GetDisplayHeight() == fg->GetDisplayHeight())
statusBar->DrawGraphic(bg, this->x, this->y, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets());
else
statusBar->DrawGraphic(fg, this->x, this->y, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets(), false, false, 0, false, -1, -1, nulclip, true);
@@ -2513,15 +2513,15 @@ class CommandDrawBar : public SBarInfoCommand
// {cx, cy, cr, cb}
double Clip[4] = {0, 0, 0, 0};
int sizeOfImage = (horizontal ? fg->GetScaledWidth()-border*2 : fg->GetScaledHeight()-border*2);
int sizeOfImage = (horizontal ? fg->GetDisplayWidth()-border*2 : fg->GetDisplayHeight()-border*2);
Clip[(!horizontal)|((horizontal ? !reverse : reverse)<<1)] = sizeOfImage - sizeOfImage *value;
// Draw background
if(border != 0)
{
for(unsigned int i = 0;i < 4;i++)
Clip[i] += border;
if (bg != NULL && bg->GetScaledWidth() == fg->GetScaledWidth() && bg->GetScaledHeight() == fg->GetScaledHeight())
if (bg != NULL && bg->GetDisplayWidth() == fg->GetDisplayWidth() && bg->GetDisplayHeight() == fg->GetDisplayHeight())
statusBar->DrawGraphic(bg, this->x, this->y, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets(), false, false, 0, false, -1, -1, Clip);
else
statusBar->DrawGraphic(fg, this->x, this->y, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets(), false, false, 0, false, -1, -1, Clip, true);
@@ -2802,7 +2802,7 @@ class CommandDrawBar : public SBarInfoCommand
// [BL] Since we used a percentage (in order to get the most fluid animation)
// we need to establish a cut off point so the last pixel won't hang as the animation slows
if(pixel == -1 && statusBar->Images[foreground])
pixel = MAX(1 / 65536., 1./statusBar->Images[foreground]->GetWidth());
pixel = MAX(1 / 65536., 1./statusBar->Images[foreground]->GetDisplayWidth());
if(fabs(drawValue - value) < pixel)
drawValue = value;
@@ -3115,7 +3115,7 @@ class CommandDrawGem : public SBarInfoCommand
SBarInfoCoordinate drawY = y;
if(wiggle && drawValue != goalValue) // Should only wiggle when the value doesn't equal what is being drawn.
drawY += chainWiggle;
int chainWidth = chainImg->GetScaledWidth();
int chainWidth = chainImg->GetDisplayWidth();
int offset = (int) (((double) (chainWidth-leftPadding-rightPadding)/100)*drawValue);
statusBar->DrawGraphic(chainImg, x+(offset%chainSize), drawY, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets());
if(gemImg != NULL)
Oops, something went wrong.

0 comments on commit 6eab4a8

Please sign in to comment.