diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index 6c2fde91..51329bad 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -112,6 +112,7 @@ Note: All fields default to false unless mentioned otherwise. checkswitchrange = ;// Switches can only be activated when vertically reachable. blockprojectiles = ;// Line blocks all projectiles blockuse = ; // Line blocks all use actions + blocksight = ; // Line blocks monster line of sight } @@ -162,8 +163,8 @@ Note: All fields default to false unless mentioned otherwise. alphafloor = ; // translucency of floor plane (only has meaning with Sector_SetPortal) Default is 1.0. alphaceiling = ; // translucency of ceiling plane (only has meaning with Sector_SetPortal) Default is 1.0. gravity = ; // Sector's gravity. Default is 1.0. - lightcolor = ; // Sector'S light color as RRGGBB value, default = 0xffffff. - fadecolor = ; // Sector'S fog color as RRGGBB value, default = 0x000000. + lightcolor = ; // Sector's light color as RRGGBB value, default = 0xffffff. + fadecolor = ; // Sector's fog color as RRGGBB value, default = 0x000000. desaturation = ; // Color desaturation factor. 0 = none, 1 = full, default = 0. silent = ; // Actors in this sector make no sound, nofallingdamage = ; // Falling damage is disabled in this sector @@ -183,12 +184,8 @@ Note: All fields default to false unless mentioned otherwise. thing { - skill# = // Unlike the base spec, # can range from 1-8. - // 8 is the maximum amount of skills the skill - // menu can display. - class# = // Unlike the base spec, # can range from 1-8. - // 8 is the maximum amount of classes the class - // menu can display. + skill# = // Unlike the base spec, # can range from 1-16. + class# = // Unlike the base spec, # can range from 1-16. conversation = // Assigns a conversation dialogue to this thing. // Parameter is the conversation ID, 0 meaning none. countsecret = ; // Picking up this actor counts as a secret. @@ -292,6 +289,10 @@ Added 'countsecret' actor property. 1.15 14.12.2010 Added vertex floor and ceiling height properties +1.16 23.01.2011 +Added blocksight linedef flag +Removed remarks of 8 being the maximum number of player classes/skill levels the menu can handle so the spec now properly lists 16 as limit. + =============================================================================== EOF =============================================================================== diff --git a/src/actionspecials.h b/src/actionspecials.h index 8fcb3cf8..0751621f 100644 --- a/src/actionspecials.h +++ b/src/actionspecials.h @@ -227,7 +227,7 @@ DEFINE_SPECIAL(Elevator_LowerToNearest, 247, 2, 2, 2) DEFINE_SPECIAL(HealThing, 248, 1, 2, 2) DEFINE_SPECIAL(Door_CloseWaitOpen, 249, 3, 4, 4) DEFINE_SPECIAL(Floor_Donut, 250, 3, 3, 3) -DEFINE_SPECIAL(FloorAndCeiling_LowerRaise, 251, 3, 3, 3) +DEFINE_SPECIAL(FloorAndCeiling_LowerRaise, 251, 3, 3, 4) DEFINE_SPECIAL(Ceiling_RaiseToNearest, 252, 2, 2, 2) DEFINE_SPECIAL(Ceiling_LowerToLowest, 253, 2, 2, 2) DEFINE_SPECIAL(Ceiling_LowerToFloor, 254, 2, 2, 2) diff --git a/src/actor.h b/src/actor.h index 803acc05..b238e889 100644 --- a/src/actor.h +++ b/src/actor.h @@ -325,6 +325,7 @@ enum MF6_ADDITIVEPOISONDAMAGE = 0x00100000, MF6_ADDITIVEPOISONDURATION = 0x00200000, MF6_NOMENU = 0x00400000, // Player class should not appear in the class selection menu. + MF6_BOSSCUBE = 0x00800000, // Actor spawned by A_BrainSpit, flagged for timefreeze reasons. // --- mobj.renderflags --- diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index 0999a77e..705ff2f7 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -269,6 +269,10 @@ void FIWadManager::ParseIWadInfos(const char *fn) } delete resfile; } + if (mIWadNames.Size() == 0 || mIWads.Size() == 0) + { + I_FatalError("No IWAD definitions found"); + } } diff --git a/src/doomdata.h b/src/doomdata.h index 83345a67..64ac86e5 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -152,6 +152,7 @@ enum ELineFlags ML_FIRSTSIDEONLY = 0x00800000, // activated only when crossed from front side ML_BLOCKPROJECTILE = 0x01000000, ML_BLOCKUSE = 0x02000000, // blocks all use actions through this line + ML_BLOCKSIGHT = 0x04000000, // blocks monster line of sight }; diff --git a/src/g_doom/a_bossbrain.cpp b/src/g_doom/a_bossbrain.cpp index 0110b0ae..d0fb03cb 100644 --- a/src/g_doom/a_bossbrain.cpp +++ b/src/g_doom/a_bossbrain.cpp @@ -142,6 +142,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BrainSpit) } // [GZ] Calculates when the projectile will have reached destination spit->special2 += level.maptime; + spit->flags6 |= MF6_BOSSCUBE; } if (!isdefault) diff --git a/src/namedef.h b/src/namedef.h index 52fc87e6..2a3bc3cf 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -443,6 +443,7 @@ xx(smoothlighting) xx(blockprojectiles) xx(blockuse) xx(hidden) +xx(blocksight) xx(Renderstyle) diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index d0518416..60db3661 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -309,7 +309,7 @@ bool P_CheckMissileRange (AActor *actor) { fixed_t dist; - if (!P_CheckSight (actor, actor->target, SF_SEEPASTBLOCKEVERYTHING|SF_SEEPASTSHOOTABLELINES)) + if (!P_CheckSight (actor, actor->target, SF_SEEPASTBLOCKEVERYTHING)) return false; if (actor->flags & MF_JUSTHIT) @@ -1151,7 +1151,7 @@ bool P_IsVisible(AActor *lookee, AActor *other, INTBOOL allaround, FLookExParams } // P_CheckSight is by far the most expensive operation in here so let's do it last. - return P_CheckSight(lookee, other, SF_SEEPASTBLOCKEVERYTHING); + return P_CheckSight(lookee, other, SF_SEEPASTSHOOTABLELINES); } //--------------------------------------------------------------------------- diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 1b3f627a..88801733 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -2473,6 +2473,7 @@ FUNC(LS_Line_SetBlocking) ML_BLOCKEVERYTHING, ML_RAILING, ML_BLOCKUSE, + ML_BLOCKSIGHT, -1 }; diff --git a/src/p_map.cpp b/src/p_map.cpp index 2acb718c..49277e7f 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -740,7 +740,8 @@ bool PIT_CheckLine (line_t *ld, const FBoundingBox &box, FCheckPosition &tm) // so don't mess around with the z-position if (ld->frontsector->floorplane==ld->backsector->floorplane && ld->frontsector->floorplane==tm.thing->Sector->floorplane && - !ld->frontsector->e->XFloor.ffloors.Size() && !ld->backsector->e->XFloor.ffloors.Size()) + !ld->frontsector->e->XFloor.ffloors.Size() && !ld->backsector->e->XFloor.ffloors.Size() && + !open.abovemidtex) { open.bottom=INT_MIN; } diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index d769f414..f52be1fc 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -299,9 +299,12 @@ void AActor::Serialize (FArchive &arc) << BlockingLine << pushfactor << Species - << Score - << DesignatedTeam - << lastpush << lastbump + << Score; + if (SaveVersion >= 3113) + { + arc << DesignatedTeam; + } + arc << lastpush << lastbump << PainThreshold << DamageFactor << WeaveIndexXY << WeaveIndexZ @@ -2747,6 +2750,11 @@ void AActor::Tick () //Added by MC: Freeze mode. if (bglobal.freeze || level.flags2 & LEVEL2_FROZEN) { + // Boss cubes shouldn't be accelerated by timefreeze + if (flags6 & MF6_BOSSCUBE) + { + special2++; + } return; } } @@ -2777,6 +2785,11 @@ void AActor::Tick () if (!(flags5 & MF5_NOTIMEFREEZE)) { + // Boss cubes shouldn't be accelerated by timefreeze + if (flags6 & MF6_BOSSCUBE) + { + special2++; + } //Added by MC: Freeze mode. if (bglobal.freeze && !(player && !player->isbot)) { diff --git a/src/p_sight.cpp b/src/p_sight.cpp index 359b5d4d..3e699cab 100644 --- a/src/p_sight.cpp +++ b/src/p_sight.cpp @@ -256,7 +256,7 @@ bool SightCheck::P_SightCheckLine (line_t *ld) } // try to early out the check - if (!ld->backsector || !(ld->flags & ML_TWOSIDED)) + if (!ld->backsector || !(ld->flags & ML_TWOSIDED) || (ld->flags & ML_BLOCKSIGHT)) return false; // stop checking // [RH] don't see past block everything lines diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 72c3cb24..1215d083 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -874,6 +874,10 @@ public: Flag(ld->flags, ML_BLOCKUSE, key); continue; + case NAME_blocksight: + Flag(ld->flags, ML_BLOCKSIGHT, key); + continue; + default: break; } diff --git a/src/sdl/i_input.cpp b/src/sdl/i_input.cpp index 60467366..4f933826 100644 --- a/src/sdl/i_input.cpp +++ b/src/sdl/i_input.cpp @@ -21,7 +21,7 @@ static void I_CheckGUICapture (); static void I_CheckNativeMouse (); -static bool GUICapture; +bool GUICapture; static bool NativeMouse = true; extern int paused; @@ -36,6 +36,9 @@ EXTERN_CVAR (Bool, fullscreen) extern int WaitingForKey, chatmodeon; extern constate_e ConsoleState; +extern SDL_Surface *cursorSurface; +extern SDL_Rect cursorBlit; + static BYTE KeySymToDIK[SDLK_LAST], DownState[SDLK_LAST]; static WORD DIKToKeySym[256] = @@ -114,6 +117,11 @@ static void I_CheckGUICapture () GUICapture = wantCapt; if (wantCapt) { + int x, y; + SDL_GetMouseState (&x, &y); + cursorBlit.x = x; + cursorBlit.y = y; + FlushDIKState (); memset (DownState, 0, sizeof(DownState)); repeat = !sdl_nokeyrepeat; @@ -260,15 +268,14 @@ static void I_CheckNativeMouse () if (wantNative != NativeMouse) { NativeMouse = wantNative; + SDL_ShowCursor (wantNative ? cursorSurface == NULL : 0); if (wantNative) { - SDL_ShowCursor (1); SDL_WM_GrabInput (SDL_GRAB_OFF); FlushDIKState (KEY_MOUSE1, KEY_MOUSE8); } else { - SDL_ShowCursor (0); SDL_WM_GrabInput (SDL_GRAB_ON); CenterMouse (); } @@ -347,8 +354,8 @@ void MessagePump (const SDL_Event &sev) int x, y; SDL_GetMouseState (&x, &y); - event.data1 = x; - event.data2 = y; + cursorBlit.x = event.data1 = x; + cursorBlit.y = event.data2 = y; event.type = EV_GUI_Event; if(sev.type == SDL_MOUSEMOTION) event.subtype = EV_GUI_MouseMove; diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index af717324..49628eef 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -60,6 +60,9 @@ #include "i_system.h" #include "c_dispatch.h" #include "templates.h" +#include "v_palette.h" +#include "textures.h" +#include "bitmap.h" #include "stats.h" #include "hardware.h" @@ -830,7 +833,39 @@ unsigned int I_MakeRNGSeed() return seed; } +SDL_Surface *cursorSurface = NULL; +SDL_Rect cursorBlit = {0, 0, 32, 32}; bool I_SetCursor(FTexture *cursorpic) { - return false; + if (cursorpic != NULL && cursorpic->UseType != FTexture::TEX_Null) + { + // Must be no larger than 32x32. + if (cursorpic->GetWidth() > 32 || cursorpic->GetHeight() > 32) + { + return false; + } + + 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)); + + SDL_ShowCursor(0); + SDL_LockSurface(cursorSurface); + BYTE buffer[32*32*4]; + memset(buffer, 0, 32*32*4); + FBitmap bmp(buffer, 32*4, 32, 32); + cursorpic->CopyTrueColorPixels(&bmp, 0, 0); + memcpy(cursorSurface->pixels, bmp.GetPixels(), 32*32*4); + SDL_UnlockSurface(cursorSurface); + } + else + { + SDL_ShowCursor(1); + + if (cursorSurface != NULL) + { + SDL_FreeSurface(cursorSurface); + cursorSurface = NULL; + } + } + return true; } diff --git a/src/sdl/sdlvideo.cpp b/src/sdl/sdlvideo.cpp index b028aafa..efff9470 100644 --- a/src/sdl/sdlvideo.cpp +++ b/src/sdl/sdlvideo.cpp @@ -76,6 +76,9 @@ void DoBlending (const PalEntry *from, PalEntry *to, int count, int r, int g, in // EXTERNAL DATA DECLARATIONS ---------------------------------------------- extern IVideo *Video; +extern SDL_Surface *cursorSurface; +extern SDL_Rect cursorBlit; +extern bool GUICapture; EXTERN_CVAR (Float, Gamma) @@ -404,7 +407,13 @@ void SDLFB::Update () } SDL_UnlockSurface (Screen); - + + if (cursorSurface != NULL && GUICapture) + { + // SDL requires us to draw a surface to get true color cursors. + SDL_BlitSurface(cursorSurface, NULL, Screen, &cursorBlit); + } + SDLFlipCycles.Clock(); SDL_Flip (Screen); SDLFlipCycles.Unclock(); diff --git a/src/svnrevision.h b/src/svnrevision.h index 48e8561b..1936c742 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 "3111" -#define ZD_SVN_REVISION_NUMBER 3111 +#define ZD_SVN_REVISION_STRING "3121" +#define ZD_SVN_REVISION_NUMBER 3121 diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index e6dabe00..5d448fd2 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -528,10 +528,7 @@ OptionMenu "MouseOptions" Option "Enable mouse", "use_mouse", "YesNo" Option "Enable mouse in menus", "m_use_mouse", "MenuMouse", "use_mouse" Option "Show back button", "m_show_backbutton", "Corners", "use_mouse" - IfOption(Windows) // No cursors on SDL right now. - { - Option "Cursor", "vid_cursor", "Cursors" - } + Option "Cursor", "vid_cursor", "Cursors" StaticText "" Slider "Overall sensitivity", "mouse_sensitivity", 0.5, 2.5, 0.1 Option "Prescale mouse movement", "m_noprescale", "NoYes"