mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- Fix compilation with MinGW + w32api and clean up warnings.
SVN r2505 (trunk)
This commit is contained in:
parent
e0bd67de5a
commit
3416a7fc47
9 changed files with 47 additions and 19 deletions
|
@ -185,7 +185,7 @@ void ParseCompatibility()
|
||||||
} while (!sc.Compare("{"));
|
} while (!sc.Compare("{"));
|
||||||
flags.CompatFlags = 0;
|
flags.CompatFlags = 0;
|
||||||
flags.BCompatFlags = 0;
|
flags.BCompatFlags = 0;
|
||||||
flags.ExtCommandIndex = -1;
|
flags.ExtCommandIndex = ~0u;
|
||||||
while (sc.GetString())
|
while (sc.GetString())
|
||||||
{
|
{
|
||||||
if ((i = sc.MatchString(&Options[0].Name, sizeof(*Options))) >= 0)
|
if ((i = sc.MatchString(&Options[0].Name, sizeof(*Options))) >= 0)
|
||||||
|
@ -195,7 +195,7 @@ void ParseCompatibility()
|
||||||
}
|
}
|
||||||
else if (sc.Compare("clearlineflags"))
|
else if (sc.Compare("clearlineflags"))
|
||||||
{
|
{
|
||||||
if (flags.ExtCommandIndex == -1) flags.ExtCommandIndex = CompatParams.Size();
|
if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size();
|
||||||
CompatParams.Push(CP_CLEARFLAGS);
|
CompatParams.Push(CP_CLEARFLAGS);
|
||||||
sc.MustGetNumber();
|
sc.MustGetNumber();
|
||||||
CompatParams.Push(sc.Number);
|
CompatParams.Push(sc.Number);
|
||||||
|
@ -204,7 +204,7 @@ void ParseCompatibility()
|
||||||
}
|
}
|
||||||
else if (sc.Compare("setlineflags"))
|
else if (sc.Compare("setlineflags"))
|
||||||
{
|
{
|
||||||
if (flags.ExtCommandIndex == -1) flags.ExtCommandIndex = CompatParams.Size();
|
if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size();
|
||||||
CompatParams.Push(CP_SETFLAGS);
|
CompatParams.Push(CP_SETFLAGS);
|
||||||
sc.MustGetNumber();
|
sc.MustGetNumber();
|
||||||
CompatParams.Push(sc.Number);
|
CompatParams.Push(sc.Number);
|
||||||
|
@ -213,7 +213,7 @@ void ParseCompatibility()
|
||||||
}
|
}
|
||||||
else if (sc.Compare("setlinespecial"))
|
else if (sc.Compare("setlinespecial"))
|
||||||
{
|
{
|
||||||
if (flags.ExtCommandIndex == -1) flags.ExtCommandIndex = CompatParams.Size();
|
if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size();
|
||||||
CompatParams.Push(CP_SETSPECIAL);
|
CompatParams.Push(CP_SETSPECIAL);
|
||||||
sc.MustGetNumber();
|
sc.MustGetNumber();
|
||||||
CompatParams.Push(sc.Number);
|
CompatParams.Push(sc.Number);
|
||||||
|
@ -232,7 +232,7 @@ void ParseCompatibility()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags.ExtCommandIndex != -1)
|
if (flags.ExtCommandIndex != ~0u)
|
||||||
{
|
{
|
||||||
CompatParams.Push(CP_END);
|
CompatParams.Push(CP_END);
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ const char *FMetaTable::GetMetaString (DWORD id) const
|
||||||
|
|
||||||
CCMD (dumpactors)
|
CCMD (dumpactors)
|
||||||
{
|
{
|
||||||
char * filters[32] =
|
const char *const filters[32] =
|
||||||
{
|
{
|
||||||
"0:All", "1:Doom", "2:Heretic", "3:DoomHeretic", "4:Hexen", "5:DoomHexen", "6:Raven", "7:IdRaven",
|
"0:All", "1:Doom", "2:Heretic", "3:DoomHeretic", "4:Hexen", "5:DoomHexen", "6:Raven", "7:IdRaven",
|
||||||
"8:Strife", "9:DoomStrife", "10:HereticStrife", "11:DoomHereticStrife", "12:HexenStrife",
|
"8:Strife", "9:DoomStrife", "10:HereticStrife", "11:DoomHereticStrife", "12:HexenStrife",
|
||||||
|
|
|
@ -167,7 +167,7 @@ void M_FindResponseFile (void)
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
FILE *handle;
|
FILE *handle;
|
||||||
int size;
|
int size;
|
||||||
long argsize;
|
long argsize = 0;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
// Any more response files after the limit will be removed from the
|
// Any more response files after the limit will be removed from the
|
||||||
|
|
|
@ -2688,7 +2688,7 @@ void A_FaceTarget (AActor *self, angle_t max_turn)
|
||||||
|
|
||||||
// 0 means no limit. Also, if we turn in a single step anyways, no need to go through the algorithms.
|
// 0 means no limit. Also, if we turn in a single step anyways, no need to go through the algorithms.
|
||||||
// It also means that there is no need to check for going past the target.
|
// It also means that there is no need to check for going past the target.
|
||||||
if (max_turn && (max_turn < abs(self->angle - target_angle)))
|
if (max_turn && (max_turn < (angle_t)abs(self->angle - target_angle)))
|
||||||
{
|
{
|
||||||
if (self->angle > target_angle)
|
if (self->angle > target_angle)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1566,7 +1566,7 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
angle_t pitch;
|
angle_t pitch = 0;
|
||||||
if (!(actor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
if (!(actor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
||||||
{ // Need to seek vertically
|
{ // Need to seek vertically
|
||||||
double dist = MAX(1.0, FVector2(target->x - actor->x, target->y - actor->y).Length());
|
double dist = MAX(1.0, FVector2(target->x - actor->x, target->y - actor->y).Length());
|
||||||
|
|
|
@ -1781,6 +1781,7 @@ int OWallMost (short *mostbuf, fixed_t z)
|
||||||
s3 = MulScale16 (globaldclip, WallSZ1); s4 = MulScale16 (globaldclip, WallSZ2);
|
s3 = MulScale16 (globaldclip, WallSZ1); s4 = MulScale16 (globaldclip, WallSZ2);
|
||||||
bad = (z<s1)+((z<s2)<<1)+((z>s3)<<2)+((z>s4)<<3);
|
bad = (z<s1)+((z<s2)<<1)+((z>s3)<<2)+((z>s4)<<3);
|
||||||
|
|
||||||
|
#if 1
|
||||||
if ((bad&3) == 3)
|
if ((bad&3) == 3)
|
||||||
{
|
{
|
||||||
memset (&mostbuf[WallSX1], 0, (WallSX2 - WallSX1)*sizeof(mostbuf[0]));
|
memset (&mostbuf[WallSX1], 0, (WallSX2 - WallSX1)*sizeof(mostbuf[0]));
|
||||||
|
@ -1792,10 +1793,10 @@ int OWallMost (short *mostbuf, fixed_t z)
|
||||||
clearbufshort (&mostbuf[WallSX1], WallSX2 - WallSX1, viewheight);
|
clearbufshort (&mostbuf[WallSX1], WallSX2 - WallSX1, viewheight);
|
||||||
return bad;
|
return bad;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
ix1 = WallSX1; iy1 = WallSZ1;
|
ix1 = WallSX1; iy1 = WallSZ1;
|
||||||
ix2 = WallSX2; iy2 = WallSZ2;
|
ix2 = WallSX2; iy2 = WallSZ2;
|
||||||
|
#if 1
|
||||||
if (bad & 3)
|
if (bad & 3)
|
||||||
{
|
{
|
||||||
int t = DivScale30 (z-s1, s2-s1);
|
int t = DivScale30 (z-s1, s2-s1);
|
||||||
|
@ -1842,7 +1843,38 @@ int OWallMost (short *mostbuf, fixed_t z)
|
||||||
fixed_t yinc = (Scale (z, InvZtoScale, iy2) - y) / (ix2 - ix1);
|
fixed_t yinc = (Scale (z, InvZtoScale, iy2) - y) / (ix2 - ix1);
|
||||||
qinterpolatedown16short (&mostbuf[ix1], ix2-ix1, y + centeryfrac, yinc);
|
qinterpolatedown16short (&mostbuf[ix1], ix2-ix1, y + centeryfrac, yinc);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
double max = viewheight;
|
||||||
|
double zz = z / 65536.0;
|
||||||
|
#if 0
|
||||||
|
double z1 = zz * InvZtoScale / WallSZ1;
|
||||||
|
double z2 = zz * InvZtoScale / WallSZ2 - z1;
|
||||||
|
z2 /= (WallSX2 - WallSX1);
|
||||||
|
z1 += centeryfrac / 65536.0;
|
||||||
|
|
||||||
|
for (int x = WallSX1; x < WallSX2; ++x)
|
||||||
|
{
|
||||||
|
mostbuf[x] = xs_RoundToInt(clamp(z1, 0.0, max));
|
||||||
|
z1 += z2;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
double top, bot, i;
|
||||||
|
|
||||||
|
i = WallSX1 - centerx;
|
||||||
|
top = WallUoverZorg + WallUoverZstep * i;
|
||||||
|
bot = WallInvZorg + WallInvZstep * i;
|
||||||
|
double cy = centeryfrac / 65536.0;
|
||||||
|
|
||||||
|
for (int x = WallSX1; x < WallSX2; x++)
|
||||||
|
{
|
||||||
|
double frac = top / bot;
|
||||||
|
double scale = frac * WallDepthScale + WallDepthOrg;
|
||||||
|
mostbuf[x] = xs_RoundToInt(clamp(zz / scale + cy, 0.0, max));
|
||||||
|
top += WallUoverZstep;
|
||||||
|
bot += WallInvZstep;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
if (mostbuf[ix1] < 0) mostbuf[ix1] = 0;
|
if (mostbuf[ix1] < 0) mostbuf[ix1] = 0;
|
||||||
else if (mostbuf[ix1] > viewheight) mostbuf[ix1] = (short)viewheight;
|
else if (mostbuf[ix1] > viewheight) mostbuf[ix1] = (short)viewheight;
|
||||||
if (mostbuf[ix2] < 0) mostbuf[ix2] = 0;
|
if (mostbuf[ix2] < 0) mostbuf[ix2] = 0;
|
||||||
|
@ -2046,13 +2078,10 @@ void PrepWall (fixed_t *swall, fixed_t *lwall, fixed_t walxrepeat)
|
||||||
{ // swall = scale, lwall = texturecolumn
|
{ // swall = scale, lwall = texturecolumn
|
||||||
double top, bot, i;
|
double top, bot, i;
|
||||||
double xrepeat = walxrepeat;
|
double xrepeat = walxrepeat;
|
||||||
double topinc, botinc;
|
|
||||||
|
|
||||||
i = WallSX1 - centerx;
|
i = WallSX1 - centerx;
|
||||||
top = WallUoverZorg + WallUoverZstep * i;
|
top = WallUoverZorg + WallUoverZstep * i;
|
||||||
bot = WallInvZorg + WallInvZstep * i;
|
bot = WallInvZorg + WallInvZstep * i;
|
||||||
topinc = WallUoverZstep * 4.f;
|
|
||||||
botinc = WallInvZstep * 4.f;
|
|
||||||
|
|
||||||
for (int x = WallSX1; x < WallSX2; x++)
|
for (int x = WallSX1; x < WallSX2; x++)
|
||||||
{
|
{
|
||||||
|
@ -2069,14 +2098,11 @@ void PrepLWall (fixed_t *lwall, fixed_t walxrepeat)
|
||||||
{ // lwall = texturecolumn
|
{ // lwall = texturecolumn
|
||||||
double top, bot, i;
|
double top, bot, i;
|
||||||
double xrepeat = walxrepeat;
|
double xrepeat = walxrepeat;
|
||||||
double topinc, botinc;
|
|
||||||
double topstep;
|
double topstep;
|
||||||
|
|
||||||
i = WallSX1 - centerx;
|
i = WallSX1 - centerx;
|
||||||
top = WallUoverZorg + WallUoverZstep * i;
|
top = WallUoverZorg + WallUoverZstep * i;
|
||||||
bot = WallInvZorg + WallInvZstep * i;
|
bot = WallInvZorg + WallInvZstep * i;
|
||||||
topinc = WallUoverZstep * 4.f;
|
|
||||||
botinc = WallInvZstep * 4.f;
|
|
||||||
|
|
||||||
top *= xrepeat;
|
top *= xrepeat;
|
||||||
topstep = WallUoverZstep * xrepeat;
|
topstep = WallUoverZstep * xrepeat;
|
||||||
|
|
|
@ -1533,7 +1533,7 @@ static void SetCustomLoopPts(FMOD::Sound *sound)
|
||||||
FMOD_MODE mode;
|
FMOD_MODE mode;
|
||||||
if (FMOD_OK == (sound->getMode(&mode)))
|
if (FMOD_OK == (sound->getMode(&mode)))
|
||||||
{
|
{
|
||||||
sound->setMode(mode & ~(FMOD_LOOP_OFF | FMOD_LOOP_NORMAL) | FMOD_LOOP_BIDI);
|
sound->setMode((mode & ~(FMOD_LOOP_OFF | FMOD_LOOP_NORMAL)) | FMOD_LOOP_BIDI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ MUSSong2::MUSSong2 (FILE *file, BYTE *musiccache, int len, EMIDIDevice type)
|
||||||
|
|
||||||
// Read the remainder of the song.
|
// Read the remainder of the song.
|
||||||
len = int(len - start);
|
len = int(len - start);
|
||||||
if (len < sizeof(MusHeader))
|
if (len < (int)sizeof(MusHeader))
|
||||||
{ // It's too short.
|
{ // It's too short.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#define DIRECTDRAW_VERSION 0x0300
|
#define DIRECTDRAW_VERSION 0x0300
|
||||||
#define DIRECT3D_VERSION 0x0900
|
#define DIRECT3D_VERSION 0x0900
|
||||||
|
|
||||||
|
#define _WIN32_WINNT 0x0501
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <ddraw.h>
|
#include <ddraw.h>
|
||||||
|
@ -51,6 +52,7 @@
|
||||||
#include <ddraw.h>
|
#include <ddraw.h>
|
||||||
#include <d3d9.h>
|
#include <d3d9.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#define USE_WINDOWS_DWORD
|
#define USE_WINDOWS_DWORD
|
||||||
#include "doomtype.h"
|
#include "doomtype.h"
|
||||||
|
|
Loading…
Reference in a new issue