Browse Source

Fix some warning in the UI

pull/44/head
Anders Jenbo 7 years ago
parent
commit
aa017838e0
  1. 3
      SourceX/DiabloUI/credits.cpp
  2. 4
      SourceX/DiabloUI/diabloui.cpp
  3. 2
      SourceX/DiabloUI/diabloui.h
  4. 2
      SourceX/DiabloUI/title.cpp

3
SourceX/DiabloUI/credits.cpp

@ -519,7 +519,8 @@ void credts_Render()
x += 40;
}
if (text_surface = TTF_RenderUTF8_Solid(font, the_long_credits[creditLine + i] + offset, color)) {
text_surface = TTF_RenderUTF8_Solid(font, the_long_credits[creditLine + i] + offset, color);
if (text_surface) {
SDL_Rect src_rect = { 0, -y, SCREEN_WIDTH, 251 };
SDL_Rect dsc_rect = { 64 + x, 160 + 114, SCREEN_WIDTH, SCREEN_HEIGHT };
SDL_BlitSurface(text_surface, &src_rect, pal_surface, &dsc_rect);

4
SourceX/DiabloUI/diabloui.cpp

@ -543,7 +543,7 @@ int GetStrWidth(char *str, int size)
{
int strWidth = 0;
for (int i = 0; i < strlen((char *)str); i++) {
for (size_t i = 0; i < strlen((char *)str); i++) {
BYTE w = FontTables[size][*(BYTE *)&str[i] + 2];
if (w)
strWidth += w;
@ -633,7 +633,7 @@ void DrawArtStr(UI_Item *item)
if (item->flags & UIS_VCENTER)
sy += (item->rect.h - ArtFonts[size][color].height) / 2;
for (int i = 0; i < strlen((char *)item->caption); i++) {
for (size_t i = 0; i < strlen((char *)item->caption); i++) {
if (item->caption[i] == '\n') {
sx = x;
sy += ArtFonts[size][color].height;

2
SourceX/DiabloUI/diabloui.h

@ -68,7 +68,7 @@ typedef struct UI_Item {
int flags;
int value;
char *caption;
void *context;
const void *context;
} UI_Item;
extern TTF_Font *font;

2
SourceX/DiabloUI/title.cpp

@ -27,7 +27,7 @@ BOOL UiTitleDialog(int a1)
title_Load();
bool endMenu = false;
int timeOut = SDL_GetTicks() + 7000;
Uint32 timeOut = SDL_GetTicks() + 7000;
SDL_Event event;
while (!endMenu && SDL_GetTicks() < timeOut) {

Loading…
Cancel
Save