diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 1a535c0880..2d10a9ccba 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -70,6 +70,27 @@ @end +@interface NSWindow(EnterFullscreenOnZoom) +- (void)enterFullscreenOnZoom; +@end + +@implementation NSWindow(EnterFullscreenOnZoom) + +- (void)enterFullscreen:(id)sender +{ + ToggleFullscreen = true; +} + +- (void)enterFullscreenOnZoom +{ + NSButton* zoomButton = [self standardWindowButton:NSWindowZoomButton]; + [zoomButton setEnabled:YES]; + [zoomButton setAction:@selector(enterFullscreen:)]; + [zoomButton setTarget:self]; +} + +@end + EXTERN_CVAR(Bool, ticker ) EXTERN_CVAR(Bool, vid_vsync) @@ -676,6 +697,7 @@ void CocoaVideo::SetWindowedMode(const int width, const int height) [m_window setContentSize:windowSize]; [m_window center]; + [m_window enterFullscreenOnZoom]; [m_window exitAppOnClose]; } diff --git a/src/r_draw.cpp b/src/r_draw.cpp index 08519c088b..f82a843d8a 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -1797,8 +1797,8 @@ void R_DrawFogBoundary (int x1, int x2, short *uclip, short *dclip) // we need to use a new colormap. fixed_t lightstep = rw_lightstep; - fixed_t light = rw_light+lightstep*(x2-x1); - int x = x2; + fixed_t light = rw_light+lightstep*(x2-x1-1); + int x = x2-1; int t2 = uclip[x]; int b2 = dclip[x]; int rcolormap = GETPALOOKUP (light, wallshade); diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index f49b925230..8608915f4c 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -6200,6 +6200,7 @@ enum CBF CBF_SETMASTER = 1 << 2, //^ but with master. CBF_SETTRACER = 1 << 3, //^ but with tracer. CBF_SETONPTR = 1 << 4, //Sets the pointer change on the actor doing the checking instead of self. + CBF_DROPOFF = 1 << 5, //Check for dropoffs. }; DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock) @@ -6219,7 +6220,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock) } //Nothing to block it so skip the rest. - if (P_TestMobjLocation(mobj)) return; + bool checker = (flags & CBF_DROPOFF) ? P_CheckMove(mobj, mobj->X(), mobj->Y()) : P_TestMobjLocation(mobj); + if (checker) return; if (mobj->BlockingMobj) { diff --git a/src/w_wad.cpp b/src/w_wad.cpp index 42e5c17b9f..d4127ae7ba 100644 --- a/src/w_wad.cpp +++ b/src/w_wad.cpp @@ -979,9 +979,11 @@ void FWadCollection::FixMacHexen() const long iwadSize = reader->GetLength(); static const long DEMO_SIZE = 13596228; + static const long BETA_SIZE = 13749984; static const long FULL_SIZE = 21078584; if ( DEMO_SIZE != iwadSize + && BETA_SIZE != iwadSize && FULL_SIZE != iwadSize) { return; @@ -1000,13 +1002,22 @@ void FWadCollection::FixMacHexen() 0x4b, 0x0a, 0x6a, 0x3b, 0xed, 0x3a, 0x6f, 0x31 }; + static const BYTE HEXEN_BETA_MD5[16] = + { + 0x2a, 0xf1, 0xb2, 0x7c, 0xd1, 0x1f, 0xb1, 0x59, + 0xe6, 0x08, 0x47, 0x2a, 0x1b, 0x53, 0xe4, 0x0e + }; + static const BYTE HEXEN_FULL_MD5[16] = { 0xb6, 0x81, 0x40, 0xa7, 0x96, 0xf6, 0xfd, 0x7f, 0x3a, 0x5d, 0x32, 0x26, 0xa3, 0x2b, 0x93, 0xbe }; - if ( 0 != memcmp(HEXEN_DEMO_MD5, checksum, sizeof checksum) + const bool isBeta = 0 == memcmp(HEXEN_BETA_MD5, checksum, sizeof checksum); + + if ( !isBeta + && 0 != memcmp(HEXEN_DEMO_MD5, checksum, sizeof checksum) && 0 != memcmp(HEXEN_FULL_MD5, checksum, sizeof checksum)) { return; @@ -1014,7 +1025,10 @@ void FWadCollection::FixMacHexen() static const int EXTRA_LUMPS = 299; - const int lastLump = GetLastLump(IWAD_FILENUM); + // Hexen Beta is very similar to Demo but it has MAP41: Maze at the end of the WAD + // So keep this map if it's present but discard all extra lumps + + const int lastLump = GetLastLump(IWAD_FILENUM) - (isBeta ? 12 : 0); assert(GetFirstLump(IWAD_FILENUM) + 299 < lastLump); for (int i = lastLump - EXTRA_LUMPS + 1; i <= lastLump; ++i) diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index f02240eda2..ad90e71d85 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -516,6 +516,7 @@ enum CBF_SETMASTER = 1 << 2, //^ but with master. CBF_SETTRACER = 1 << 3, //^ but with tracer. CBF_SETONPTR = 1 << 4, //Sets the pointer change on the actor doing the checking instead of self. + CBF_DROPOFF = 1 << 5, //Check for dropoffs. }; enum diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 0417d7a89b..8bd205636d 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -896,6 +896,10 @@ OptionMenu "MiscOptions" Option "Merge left+right Alt/Ctrl/Shift", "k_mergekeys", "OnOff" Option "Alt-Enter toggles fullscreen", "k_allowfullscreentoggle", "OnOff" } + IfOption(Mac) + { + Option "Command-F toggles fullscreen", "k_allowfullscreentoggle", "OnOff" + } Option "Show IWAD selection dialog", "queryiwad", "OnOff" StaticText " " Option "Enable cheats from all games", "allcheats", "OnOff"