Browse Source

Fix a few compiler warnings

pull/259/head
Anders Jenbo 7 years ago
parent
commit
5cadee74c2
  1. 2
      3rdParty/Storm/Source/storm.h
  2. 2
      SourceX/DiabloUI/credits.cpp
  3. 12
      SourceX/DiabloUI/diabloui.cpp
  4. 2
      SourceX/DiabloUI/diabloui.h
  5. 2
      SourceX/DiabloUI/progress.cpp
  6. 4
      SourceX/miniwin/ddraw.cpp
  7. 2
      SourceX/storm/storm.cpp

2
3rdParty/Storm/Source/storm.h vendored

@ -62,7 +62,7 @@ typedef struct _WSIZE
} WSIZE, *PWSIZE;
#ifdef __cplusplus
static float infinity = std::numeric_limits<float>::infinity();
//static float infinity = std::numeric_limits<float>::infinity();
struct CCritSect {
CRITICAL_SECTION m_critsect;

2
SourceX/DiabloUI/credits.cpp

@ -505,7 +505,7 @@ void credts_Render()
lastYbase = ybase;
if (font != NULL) {
SDL_Color color = palette->colors[224], black_color = {0, 0, 0};
SDL_Color color = palette->colors[224], black_color = {0, 0, 0, 0};
SDL_Surface *text_surface, *shadow_surface;
for (int i = 0; i < lineCount; i++) {
if (creditLine + i < 0) {

12
SourceX/DiabloUI/diabloui.cpp

@ -471,8 +471,8 @@ BOOL UiValidPlayerName(char *name)
if (strpbrk(name, ",<>%&\\\"?*#/:") || strpbrk(name, " "))
return false;
for (char *letter = name; *letter; letter++)
if (*letter < 0x20 || *letter > 0x7E && *letter < 0xC0)
for (BYTE *letter = (BYTE *)name; *letter; letter++)
if (*letter < 0x20 || (*letter > 0x7E && *letter < 0xC0))
return false;
return true;
@ -553,14 +553,14 @@ BOOL UiCreatePlayerDescription(_uiheroinfo *info, DWORD mode, char *desc)
return true;
}
void DrawArt(int screenX, int screenY, Art *art, int nFrame, int drawW)
void DrawArt(int screenX, int screenY, Art *art, int nFrame, DWORD drawW)
{
BYTE *src = (BYTE *)art->data + (art->width * art->height * nFrame);
BYTE *dst = &gpBuffer[screenX + 64 + (screenY + SCREEN_Y) * BUFFER_WIDTH];
drawW = drawW ? drawW : art->width;
for (int i = 0; i < art->height && i + screenY < SCREEN_HEIGHT; i++, src += art->width, dst += BUFFER_WIDTH) {
for (int j = 0; j < art->width && j + screenX < SCREEN_WIDTH; j++) {
for (DWORD i = 0; i < art->height && i + screenY < SCREEN_HEIGHT; i++, src += art->width, dst += BUFFER_WIDTH) {
for (DWORD j = 0; j < art->width && j + screenX < SCREEN_WIDTH; j++) {
if (j < drawW && (!art->masked || src[j] != art->mask))
dst[j] = src[j];
}
@ -785,6 +785,8 @@ void UiRenderItems(UI_Item *items, int size)
continue;
if (SelectedItem == items[i].value)
DrawSelector(&items[i]);
DrawArtStr(&items[i]);
break;
case UI_BUTTON:
case UI_TEXT:
DrawArtStr(&items[i]);

2
SourceX/DiabloUI/diabloui.h

@ -101,7 +101,7 @@ bool UiFocusNavigation(SDL_Event *event);
bool UiItemMouseEvents(SDL_Event *event, UI_Item *items, int size);
int GetAnimationFrame(int frames, int fps = 60);
int GetCenterOffset(int w, int bw = 0);
void DrawArt(int screenX, int screenY, Art *art, int nFrame = 0, int drawW = 0);
void DrawArt(int screenX, int screenY, Art *art, int nFrame = 0, DWORD drawW = 0);
void DrawLogo(int t = 0, int size = LOGO_MED);
void DrawMouse();
void LoadArt(char *pszFile, Art *art, int frames = 1, PALETTEENTRY *pPalette = NULL);

2
SourceX/DiabloUI/progress.cpp

@ -22,7 +22,7 @@ void progress_Load(char *msg)
LoadArt("ui_art\\but_sml.pcx", &ButImage, 15);
if (font != NULL) {
SDL_Color color = { 243, 243, 243 };
SDL_Color color = { 243, 243, 243, 0 };
msgSurface = TTF_RenderUTF8_Solid(font, msg, color);
cancleSurface = TTF_RenderUTF8_Solid(font, "Cancel", color);

4
SourceX/miniwin/ddraw.cpp

@ -241,7 +241,7 @@ HRESULT StubPalette::GetCaps(LPDWORD lpdwCaps)
HRESULT StubPalette::GetEntries(DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries)
{
for (int i = 0; i < dwNumEntries; i++) {
for (DWORD i = 0; i < dwNumEntries; i++) {
lpEntries[i].peFlags = 0;
lpEntries[i].peRed = system_palette[i].peRed;
lpEntries[i].peGreen = system_palette[i].peGreen;
@ -252,7 +252,7 @@ HRESULT StubPalette::GetEntries(DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries,
HRESULT StubPalette::SetEntries(DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries)
{
for (int i = 0; i < dwCount; i++) {
for (DWORD i = 0; i < dwCount; i++) {
system_palette[i].peFlags = 0;
system_palette[i].peRed = lpEntries[i].peRed;
system_palette[i].peGreen = lpEntries[i].peGreen;

2
SourceX/storm/storm.cpp

@ -157,7 +157,7 @@ BOOL SFileOpenFile(const char *filename, HANDLE *phFile)
if (directFileAccess) {
char directPath[DVL_MAX_PATH] = "\0";
for (int i = 0; i < strlen(filename); i++) {
for (size_t i = 0; i < strlen(filename); i++) {
directPath[i] = AsciiToLowerTable_Path[filename[i]];
}
result = SFileOpenFileEx((HANDLE)0, directPath, 0xFFFFFFFF, phFile);

Loading…
Cancel
Save