mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- Fix warnings reported by gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
SVN r3293 (trunk)
This commit is contained in:
parent
d6b6a73fee
commit
de8bf651f2
6 changed files with 103 additions and 13 deletions
|
@ -513,9 +513,9 @@ bool EV_SilentLineTeleport (line_t *line, int side, AActor *thing, int id, INTBO
|
|||
while (P_PointOnLineSide(x, y, l) != side && --fudge >= 0)
|
||||
{
|
||||
if (abs(l->dx) > abs(l->dy))
|
||||
y -= l->dx < 0 != side ? -1 : 1;
|
||||
y -= (l->dx < 0) != side ? -1 : 1;
|
||||
else
|
||||
x += l->dy < 0 != side ? -1 : 1;
|
||||
x += (l->dy < 0) != side ? -1 : 1;
|
||||
}
|
||||
|
||||
// Adjust z position to be same height above ground as before.
|
||||
|
|
|
@ -417,8 +417,6 @@ void FVoxel::Remap()
|
|||
|
||||
static bool VOX_ReadSpriteNames(FScanner &sc, TArray<DWORD> &vsprites)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
vsprites.Clear();
|
||||
while (sc.GetString())
|
||||
{
|
||||
|
@ -442,8 +440,7 @@ static bool VOX_ReadSpriteNames(FScanner &sc, TArray<DWORD> &vsprites)
|
|||
else
|
||||
{
|
||||
int frame = (sc.StringLen == 4) ? 255 : sc.String[4] - 'A';
|
||||
|
||||
i = GetSpriteIndex(sc.String, false);
|
||||
int i = GetSpriteIndex(sc.String, false);
|
||||
if (i != -1)
|
||||
{
|
||||
vsprites.Push((frame << 24) | i);
|
||||
|
|
|
@ -186,7 +186,7 @@ int FDirectory::AddDirectory(const char *dirpath)
|
|||
{
|
||||
if (strstr(fileinfo.name, ".orig") || strstr(fileinfo.name, ".bak"))
|
||||
{
|
||||
// We shuuldn't add backup files to the lump directory
|
||||
// We shouldn't add backup files to the lump directory
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -211,8 +211,8 @@ int FDirectory::AddDirectory(const char *dirpath)
|
|||
DIR* directory = opendir(scanDirectories[i].GetChars());
|
||||
if (directory == NULL)
|
||||
{
|
||||
Printf("Could not ready directory: %s\n", strerror(errno));
|
||||
return NULL;
|
||||
Printf("Could not read directory: %s\n", strerror(errno));
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct dirent *file;
|
||||
|
@ -250,7 +250,7 @@ int FDirectory::AddDirectory(const char *dirpath)
|
|||
|
||||
int FDirectory::AddDirectory(const char *dirpath)
|
||||
{
|
||||
char *argv [2] = {NULL, NULL };
|
||||
char *argv [2] = { NULL, NULL };
|
||||
argv[0] = new char[strlen(dirpath)+1];
|
||||
strcpy(argv[0], dirpath);
|
||||
FTS *fts;
|
||||
|
@ -261,7 +261,7 @@ int FDirectory::AddDirectory(const char *dirpath)
|
|||
if (fts == NULL)
|
||||
{
|
||||
Printf("Failed to start directory traversal: %s\n", strerror(errno));
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
while ((ent = fts_read(fts)) != NULL)
|
||||
{
|
||||
|
|
|
@ -81,6 +81,10 @@ extern "C" int cc_install_handlers(int, char**, int, int*, const char*, int(*)(c
|
|||
|
||||
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
|
||||
|
||||
#ifdef USE_XCURSOR
|
||||
extern bool UseXCursor;
|
||||
#endif
|
||||
|
||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
||||
#ifndef NO_GTK
|
||||
|
@ -256,7 +260,7 @@ int main (int argc, char **argv)
|
|||
cc_install_handlers(argc, argv, 4, s, "zdoom-crash.log", DoomSpecificInfo);
|
||||
}
|
||||
|
||||
printf(GAMENAME" v%s - SVN revision %s - SDL version\nCompiled on %s\n\n",
|
||||
printf(GAMENAME" v%s - SVN revision %s - SDL version\nCompiled on %s\n",
|
||||
DOTVERSIONSTR_NOREV,SVN_REVISION_STRING,__DATE__);
|
||||
|
||||
seteuid (getuid ());
|
||||
|
@ -279,6 +283,19 @@ int main (int argc, char **argv)
|
|||
}
|
||||
atterm (SDL_Quit);
|
||||
|
||||
{
|
||||
char viddriver[80];
|
||||
|
||||
if (SDL_VideoDriverName(viddriver, sizeof(viddriver)) != NULL)
|
||||
{
|
||||
printf("Using video driver %s\n", viddriver);
|
||||
#ifdef USE_XCURSOR
|
||||
UseXCursor = (strcmp(viddriver, "x11") == 0);
|
||||
#endif
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
SDL_WM_SetCaption (GAMESIG " " DOTVERSIONSTR " (" __DATE__ ")", NULL);
|
||||
|
||||
try
|
||||
|
|
|
@ -79,6 +79,13 @@
|
|||
#include "m_fixed.h"
|
||||
#include "g_level.h"
|
||||
|
||||
#ifdef USE_XCURSOR
|
||||
// Xlib has its own GC, so don't let it interfere.
|
||||
#define GC XGC
|
||||
#include <X11/Xcursor/Xcursor.h>
|
||||
#undef GC
|
||||
#endif
|
||||
|
||||
EXTERN_CVAR (String, language)
|
||||
|
||||
extern "C"
|
||||
|
@ -92,6 +99,11 @@ extern bool GtkAvailable;
|
|||
#elif defined(__APPLE__)
|
||||
int I_PickIWad_Cocoa (WadStuff *wads, int numwads, bool showwin, int defaultiwad);
|
||||
#endif
|
||||
#ifdef USE_XCURSOR
|
||||
bool UseXCursor;
|
||||
SDL_Cursor *X11Cursor;
|
||||
SDL_Cursor *FirstCursor;
|
||||
#endif
|
||||
|
||||
DWORD LanguageIDs[4] =
|
||||
{
|
||||
|
@ -830,6 +842,47 @@ unsigned int I_MakeRNGSeed()
|
|||
return seed;
|
||||
}
|
||||
|
||||
#ifdef USE_XCURSOR
|
||||
// Hack! Hack! SDL does not provide a clean way to get the XDisplay.
|
||||
// On the other hand, there are no more planned updates for SDL 1.2,
|
||||
// so we should be fine making assumptions.
|
||||
struct SDL_PrivateVideoData
|
||||
{
|
||||
int local_X11;
|
||||
Display *X11_Display;
|
||||
};
|
||||
|
||||
struct SDL_VideoDevice
|
||||
{
|
||||
const char *name;
|
||||
int (*functions)()[9];
|
||||
SDL_VideoInfo info;
|
||||
SDL_PixelFormat *displayformatalphapixel;
|
||||
int (*morefuncs)()[9];
|
||||
Uint16 *gamma;
|
||||
int (*somefuncs)()[9];
|
||||
unsigned int texture; // Only here if SDL was compiled with OpenGL support. Ack!
|
||||
int is_32bit;
|
||||
int (*itsafuncs)()[13];
|
||||
SDL_Surface *surfaces[3];
|
||||
SDL_Palette *physpal;
|
||||
SDL_Color *gammacols;
|
||||
char *wm_strings[2];
|
||||
int offsets[2];
|
||||
SDL_GrabMode input_grab;
|
||||
int handles_any_size;
|
||||
SDL_PrivateVideoData *hidden; // Why did they have to bury this so far in?
|
||||
};
|
||||
|
||||
extern SDL_VideDevice *current_video;
|
||||
#define SDL_Display (current_video->hidden->X11_Display)
|
||||
|
||||
SDL_Cursor *CreateColorCursor(FTexture *cursorpic)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
SDL_Surface *cursorSurface = NULL;
|
||||
SDL_Rect cursorBlit = {0, 0, 32, 32};
|
||||
bool I_SetCursor(FTexture *cursorpic)
|
||||
|
@ -842,6 +895,21 @@ bool I_SetCursor(FTexture *cursorpic)
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifdef USE_XCURSOR
|
||||
if (UseXCursor)
|
||||
{
|
||||
if (FirstCursor == NULL)
|
||||
{
|
||||
FirstCursor = SDL_GetCursor();
|
||||
}
|
||||
X11Cursor = CreateColorCursor(cursorpic);
|
||||
if (X11Cursor != NULL)
|
||||
{
|
||||
SDL_SetCursor(X11Cursor);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (cursorSurface == NULL)
|
||||
cursorSurface = SDL_CreateRGBSurface (0, 32, 32, 32, MAKEARGB(0,255,0,0), MAKEARGB(0,0,255,0), MAKEARGB(0,0,0,255), MAKEARGB(255,0,0,0));
|
||||
|
||||
|
@ -863,6 +931,14 @@ bool I_SetCursor(FTexture *cursorpic)
|
|||
SDL_FreeSurface(cursorSurface);
|
||||
cursorSurface = NULL;
|
||||
}
|
||||
#ifdef USE_XCURSOR
|
||||
if (X11Cursor != NULL)
|
||||
{
|
||||
SDL_SetCursor(FirstCursor);
|
||||
SDL_FreeCursor(X11Cursor);
|
||||
X11Cursor = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -3888,7 +3888,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_WolfAttack)
|
|||
if (dpuff->flags2 & MF2_THRUGHOST && self->target->flags3 & MF3_GHOST)
|
||||
damage = 0;
|
||||
|
||||
if (0 && dpuff->flags3 & MF3_PUFFONACTORS || !spawnblood)
|
||||
if ((0 && dpuff->flags3 & MF3_PUFFONACTORS) || !spawnblood)
|
||||
{
|
||||
spawnblood = false;
|
||||
P_SpawnPuff(self, pufftype, dx, dy, dz, angle, 0);
|
||||
|
|
Loading…
Reference in a new issue