From f474931ea89aa741cd6bada93807da97c0936b36 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 11 Aug 2010 06:40:06 +0000 Subject: [PATCH] - Version bump to 1.5.0. - Update to ZDoom r2509: * Set explicit positioning for the gameplay options menu instead of relying on the automatic positioning. * Fix compilation with MinGW + w32api and clean up warnings. * Clean up vid_listadapters code. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@880 b0f79afe-0144-0410-b225-9a4edf0717df --- src/compatibility.cpp | 10 +++++----- src/dobject.cpp | 2 +- src/m_misc.cpp | 2 +- src/m_options.cpp | 2 +- src/p_enemy.cpp | 2 +- src/p_mobj.cpp | 2 +- src/r_segs.cpp | 42 ++++++++++++++++++++++++++++++++-------- src/sdl/hardware.h | 1 + src/svnrevision.h | 4 ++-- src/v_video.cpp | 2 -- src/version.h | 10 +++++----- src/win32/hardware.h | 4 ---- src/win32/win32iface.h | 1 - src/win32/win32video.cpp | 11 ++++++++++- 14 files changed, 62 insertions(+), 33 deletions(-) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index b93cb68f..e091a7f1 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -185,7 +185,7 @@ void ParseCompatibility() } while (!sc.Compare("{")); flags.CompatFlags = 0; flags.BCompatFlags = 0; - flags.ExtCommandIndex = -1; + flags.ExtCommandIndex = ~0u; while (sc.GetString()) { if ((i = sc.MatchString(&Options[0].Name, sizeof(*Options))) >= 0) @@ -195,7 +195,7 @@ void ParseCompatibility() } 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); sc.MustGetNumber(); CompatParams.Push(sc.Number); @@ -204,7 +204,7 @@ void ParseCompatibility() } 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); sc.MustGetNumber(); CompatParams.Push(sc.Number); @@ -213,7 +213,7 @@ void ParseCompatibility() } 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); sc.MustGetNumber(); CompatParams.Push(sc.Number); @@ -232,7 +232,7 @@ void ParseCompatibility() break; } } - if (flags.ExtCommandIndex != -1) + if (flags.ExtCommandIndex != ~0u) { CompatParams.Push(CP_END); } diff --git a/src/dobject.cpp b/src/dobject.cpp index 073be864..3bd815bd 100644 --- a/src/dobject.cpp +++ b/src/dobject.cpp @@ -190,7 +190,7 @@ const char *FMetaTable::GetMetaString (DWORD id) const 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", "8:Strife", "9:DoomStrife", "10:HereticStrife", "11:DoomHereticStrife", "12:HexenStrife", diff --git a/src/m_misc.cpp b/src/m_misc.cpp index 1f8b9f3e..324095d5 100644 --- a/src/m_misc.cpp +++ b/src/m_misc.cpp @@ -167,7 +167,7 @@ void M_FindResponseFile (void) int argc = 0; FILE *handle; int size; - long argsize; + long argsize = 0; int index; // Any more response files after the limit will be removed from the diff --git a/src/m_options.cpp b/src/m_options.cpp index 06d9f8ae..b20cc8e3 100644 --- a/src/m_options.cpp +++ b/src/m_options.cpp @@ -1103,7 +1103,7 @@ static menu_t DMFlagsMenu = "GAMEPLAY OPTIONS", 0, countof(DMFlagsItems), - 0, + 222, DMFlagsItems, }; diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 8168543c..53d87e3d 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -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. // 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) { diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 16c70ef1..39a56ece 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1566,7 +1566,7 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci } else { - angle_t pitch; + angle_t pitch = 0; if (!(actor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))) { // Need to seek vertically double dist = MAX(1.0, FVector2(target->x - actor->x, target->y - actor->y).Length()); diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 5bb3a09f..eed5d78a 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -1781,6 +1781,7 @@ int OWallMost (short *mostbuf, fixed_t z) s3 = MulScale16 (globaldclip, WallSZ1); s4 = MulScale16 (globaldclip, WallSZ2); bad = (zs3)<<2)+((z>s4)<<3); +#if 1 if ((bad&3) == 3) { 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); return bad; } - +#endif ix1 = WallSX1; iy1 = WallSZ1; ix2 = WallSX2; iy2 = WallSZ2; - +#if 1 if (bad & 3) { 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); 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; else if (mostbuf[ix1] > viewheight) mostbuf[ix1] = (short)viewheight; 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 double top, bot, i; double xrepeat = walxrepeat; - double topinc, botinc; i = WallSX1 - centerx; top = WallUoverZorg + WallUoverZstep * i; bot = WallInvZorg + WallInvZstep * i; - topinc = WallUoverZstep * 4.f; - botinc = WallInvZstep * 4.f; for (int x = WallSX1; x < WallSX2; x++) { @@ -2069,14 +2098,11 @@ void PrepLWall (fixed_t *lwall, fixed_t walxrepeat) { // lwall = texturecolumn double top, bot, i; double xrepeat = walxrepeat; - double topinc, botinc; double topstep; i = WallSX1 - centerx; top = WallUoverZorg + WallUoverZstep * i; bot = WallInvZorg + WallInvZstep * i; - topinc = WallUoverZstep * 4.f; - botinc = WallInvZstep * 4.f; top *= xrepeat; topstep = WallUoverZstep * xrepeat; diff --git a/src/sdl/hardware.h b/src/sdl/hardware.h index 073a555b..5b14b7cb 100644 --- a/src/sdl/hardware.h +++ b/src/sdl/hardware.h @@ -52,6 +52,7 @@ class IVideo virtual bool SetResolution (int width, int height, int bits); + virtual void DumpAdapters(); }; void I_InitGraphics (); diff --git a/src/svnrevision.h b/src/svnrevision.h index 5fa73171..9bdbaf75 100644 --- a/src/svnrevision.h +++ b/src/svnrevision.h @@ -3,5 +3,5 @@ // This file was automatically generated by the // updaterevision tool. Do not edit by hand. -#define ZD_SVN_REVISION_STRING "2504" -#define ZD_SVN_REVISION_NUMBER 2504 +#define ZD_SVN_REVISION_STRING "2509" +#define ZD_SVN_REVISION_NUMBER 2509 diff --git a/src/v_video.cpp b/src/v_video.cpp index c32561af..1e8993e7 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -1769,7 +1769,6 @@ const int BaseRatioSizes[5][4] = { 960, 640, (int)(6.5*FRACUNIT), 48*15/16 } // 5:4 320, 213.3333, multiplied by three }; -#ifndef unix void IVideo::DumpAdapters () { Printf("Multi-monitor support unavailable.\n"); @@ -1780,4 +1779,3 @@ CCMD(vid_listadapters) if (Video != NULL) Video->DumpAdapters(); } -#endif \ No newline at end of file diff --git a/src/version.h b/src/version.h index 885e6fdf..b5ba57a8 100644 --- a/src/version.h +++ b/src/version.h @@ -41,17 +41,17 @@ /** Lots of different version numbers **/ -#define DOTVERSIONSTR_NOREV "1.4.8" -#define ZDVER_STRING "2.4.1" +#define DOTVERSIONSTR_NOREV "1.5.0" +#define ZDVER_STRING "2.5.0" // The version string the user actually sees. #define DOTVERSIONSTR DOTVERSIONSTR_NOREV " (r" SVN_REVISION_STRING ") / ZDoom " ZDVER_STRING " (r" ZD_SVN_REVISION_STRING ")" // The version as seen in the Windows resource -#define RC_FILEVERSION 1,4,8,SVN_REVISION_NUMBER -#define RC_PRODUCTVERSION 1,4,8,0 +#define RC_FILEVERSION 1,5,0,SVN_REVISION_NUMBER +#define RC_PRODUCTVERSION 1,5,0,0 #define RC_FILEVERSION2 DOTVERSIONSTR -#define RC_PRODUCTVERSION2 "1.4" +#define RC_PRODUCTVERSION2 "1.5" // Version identifier for network games. // Bump it every time you do a release unless you're certain you diff --git a/src/win32/hardware.h b/src/win32/hardware.h index e18b7ae4..223ba621 100644 --- a/src/win32/hardware.h +++ b/src/win32/hardware.h @@ -52,11 +52,7 @@ class IVideo virtual bool SetResolution (int width, int height, int bits); -#ifndef unix - // Base class implementation does something sensible. virtual void DumpAdapters(); -#endif - }; void I_InitGraphics (); diff --git a/src/win32/win32iface.h b/src/win32/win32iface.h index 0b68da18..e46c392c 100644 --- a/src/win32/win32iface.h +++ b/src/win32/win32iface.h @@ -58,7 +58,6 @@ class D3DPal; class Win32Video : public IVideo { public: - Win32Video (int parm); ~Win32Video (); diff --git a/src/win32/win32video.cpp b/src/win32/win32video.cpp index 86c5fe88..e9df043d 100644 --- a/src/win32/win32video.cpp +++ b/src/win32/win32video.cpp @@ -38,6 +38,7 @@ #define DIRECTDRAW_VERSION 0x0300 #define DIRECT3D_VERSION 0x0900 +#define _WIN32_WINNT 0x0501 #define WIN32_LEAN_AND_MEAN #include #include @@ -51,6 +52,7 @@ #include #include #include +#include #define USE_WINDOWS_DWORD #include "doomtype.h" @@ -351,12 +353,19 @@ void Win32Video::BlankForGDI () // // Win32Video :: DumpAdapters // -// Dumps the list of display adapters to the console. +// Dumps the list of display adapters to the console. Only meaningful for +// Direct3D. // //========================================================================== void Win32Video::DumpAdapters() { + if (D3D == NULL) + { + Printf("Multi-monitor support requires Direct3D.\n"); + return; + } + UINT num_adapters = D3D->GetAdapterCount(); for (UINT i = 0; i < num_adapters; ++i)