Browse Source

fix rest on the GUI

pull/411/head
Mathieu Maret 6 years ago
parent
commit
90e60654fe
  1. 1
      SourceX/DiabloUI/art_draw.cpp
  2. 2
      SourceX/DiabloUI/diabloui.cpp
  3. 5
      SourceX/DiabloUI/text_draw.cpp

1
SourceX/DiabloUI/art_draw.cpp

@ -8,6 +8,7 @@ extern unsigned int pal_surface_palette_version;
void DrawArt(int screenX, int screenY, Art *art, int nFrame,
decltype(SDL_Rect().w) srcW, decltype(SDL_Rect().h) srcH)
{
screenX += PANEL_LEFT;
if (screenY >= SCREEN_Y + SCREEN_HEIGHT || screenX >= SCREEN_X + SCREEN_WIDTH || art->surface == nullptr)
return;

2
SourceX/DiabloUI/diabloui.cpp

@ -483,7 +483,7 @@ BOOL UiCreatePlayerDescription(_uiheroinfo *info, DWORD mode, char *desc)
int GetCenterOffset(int w, int bw)
{
if (bw == 0) {
bw = SCREEN_WIDTH;
bw = PANEL_WIDTH;
}
return (bw - w) / 2;

5
SourceX/DiabloUI/text_draw.cpp

@ -32,10 +32,13 @@ int AlignXOffset(int flags, const SDL_Rect &dest, int w)
} // namespace
void DrawTTF(const char *text, const SDL_Rect &rect, int flags,
void DrawTTF(const char *text, const SDL_Rect &rectIn, int flags,
const SDL_Color &text_color, const SDL_Color &shadow_color,
TtfSurfaceCache **render_cache)
{
SDL_Rect rect(rectIn);
if(! (flags & UIS_CENTER))
rect.x += PANEL_LEFT;
if (font == nullptr || text == nullptr || *text == '\0')
return;
if (*render_cache == nullptr) {

Loading…
Cancel
Save