Skip to content

Commit

Permalink
Merge branch 'master' into maint3_2
Browse files Browse the repository at this point in the history
  • Loading branch information
madame-rachelle committed Oct 22, 2017
2 parents e0d4d9a + 88deddb commit efff148
Show file tree
Hide file tree
Showing 42 changed files with 131 additions and 378 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ endif()

if( APPLE )
set_target_properties(zdoom PROPERTIES
LINK_FLAGS "-framework Carbon -framework Cocoa -framework IOKit -framework OpenGL"
LINK_FLAGS "-framework Cocoa -framework IOKit -framework OpenGL"
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/posix/osx/zdoom-info.plist" )

endif()
Expand Down
2 changes: 1 addition & 1 deletion src/compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ void CheckCompatibility(MapData *map)
// When playing Doom IWAD levels force COMPAT_SHORTTEX and COMPATF_LIGHT.
// I'm not sure if the IWAD maps actually need COMPATF_LIGHT but it certainly does not hurt.
// TNT's MAP31 also needs COMPATF_STAIRINDEX but that only gets activated for TNT.WAD.
if (Wads.GetLumpFile(map->lumpnum) == 1 && (gameinfo.flags & GI_COMPATSHORTTEX) && level.maptype == MAPTYPE_DOOM)
if (Wads.GetLumpFile(map->lumpnum) == Wads.GetIwadNum() && (gameinfo.flags & GI_COMPATSHORTTEX) && level.maptype == MAPTYPE_DOOM)
{
ii_compatflags = COMPATF_SHORTTEX|COMPATF_LIGHT;
if (gameinfo.flags & GI_COMPATSTAIRS) ii_compatflags |= COMPATF_STAIRINDEX;
Expand Down
16 changes: 16 additions & 0 deletions src/d_iwad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,21 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize,
sc.MustGetString();
iwad->Required = sc.String;
}
else if (sc.Compare("StartupType"))
{
sc.MustGetStringName("=");
sc.MustGetString();
FString sttype = sc.String;
if (!sttype.CompareNoCase("DOOM"))
iwad->StartupType = FStartupInfo::DoomStartup;
else if (!sttype.CompareNoCase("HERETIC"))
iwad->StartupType = FStartupInfo::HereticStartup;
else if (!sttype.CompareNoCase("HEXEN"))
iwad->StartupType = FStartupInfo::HexenStartup;
else if (!sttype.CompareNoCase("STRIFE"))
iwad->StartupType = FStartupInfo::StrifeStartup;
else iwad->StartupType = FStartupInfo::DefaultStartup;
}
else
{
sc.ScriptError("Unknown keyword '%s'", sc.String);
Expand Down Expand Up @@ -739,6 +754,7 @@ const FIWADInfo *FIWadManager::FindIWAD(TArray<FString> &wadfiles, const char *i
DoomStartupInfo.BkColor = iwad_info->BkColor;
DoomStartupInfo.FgColor = iwad_info->FgColor;
}
if (DoomStartupInfo.Type == 0) DoomStartupInfo.Type = iwad_info->StartupType;
I_SetIWADInfo();
return iwad_info;
}
4 changes: 2 additions & 2 deletions src/d_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,12 @@ void D_PostEvent (const event_t *ev)
int look = int(ev->y * m_pitch * mouse_sensitivity * 16.0);
if (invertmouse)
look = -look;
G_AddViewPitch (look);
G_AddViewPitch (look, true);
events[eventhead].y = 0;
}
if (!Button_Strafe.bDown && !lookstrafe)
{
G_AddViewAngle (int(ev->x * m_yaw * mouse_sensitivity * 8.0));
G_AddViewAngle (int(ev->x * m_yaw * mouse_sensitivity * 8.0), true);
events[eventhead].x = 0;
}
if ((events[eventhead].x | events[eventhead].y) == 0)
Expand Down
36 changes: 18 additions & 18 deletions src/d_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,23 @@ struct WadStuff
FString Name;
};

struct FStartupInfo
{
FString Name;
uint32_t FgColor; // Foreground color for title banner
uint32_t BkColor; // Background color for title banner
FString Song;
int Type;
enum
{
DefaultStartup,
DoomStartup,
HereticStartup,
HexenStartup,
StrifeStartup,
};
};

struct FIWADInfo
{
FString Name; // Title banner text for this IWAD
Expand All @@ -85,6 +102,7 @@ struct FIWADInfo
uint32_t FgColor = 0; // Foreground color for title banner
uint32_t BkColor = 0xc0c0c0; // Background color for title banner
EGameType gametype = GAME_Doom; // which game are we playing?
int StartupType = FStartupInfo::DefaultStartup; // alternate startup type
FString MapInfo; // Base mapinfo to load
TArray<FString> Load; // Wads to be loaded with this one.
TArray<FString> Lumps; // Lump names for identification
Expand All @@ -104,24 +122,6 @@ struct FFoundWadInfo
}
};

struct FStartupInfo
{
FString Name;
uint32_t FgColor; // Foreground color for title banner
uint32_t BkColor; // Background color for title banner
FString Song;
int Type;
enum
{
DefaultStartup,
DoomStartup,
HereticStartup,
HexenStartup,
StrifeStartup,
};

};

extern FStartupInfo DoomStartupInfo;

//==========================================================================
Expand Down
16 changes: 5 additions & 11 deletions src/g_game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,24 +608,20 @@ void G_BuildTiccmd (ticcmd_t *cmd)
if (Button_Right.bDown)
{
G_AddViewAngle (angleturn[tspeed]);
LocalKeyboardTurner = true;
}
if (Button_Left.bDown)
{
G_AddViewAngle (-angleturn[tspeed]);
LocalKeyboardTurner = true;
}
}

if (Button_LookUp.bDown)
{
G_AddViewPitch (lookspeed[speed]);
LocalKeyboardTurner = true;
}
if (Button_LookDown.bDown)
{
G_AddViewPitch (-lookspeed[speed]);
LocalKeyboardTurner = true;
}

if (Button_MoveUp.bDown)
Expand Down Expand Up @@ -701,12 +697,10 @@ void G_BuildTiccmd (ticcmd_t *cmd)
if (joyaxes[JOYAXIS_Pitch] != 0)
{
G_AddViewPitch(joyint(joyaxes[JOYAXIS_Pitch] * 2048));
LocalKeyboardTurner = true;
}
if (joyaxes[JOYAXIS_Yaw] != 0)
{
G_AddViewAngle(joyint(-1280 * joyaxes[JOYAXIS_Yaw]));
LocalKeyboardTurner = true;
}

side -= joyint(sidemove[speed] * joyaxes[JOYAXIS_Side]);
Expand Down Expand Up @@ -794,7 +788,7 @@ void G_BuildTiccmd (ticcmd_t *cmd)
//[Graf Zahl] This really helps if the mouse update rate can't be increased!
CVAR (Bool, smooth_mouse, false, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)

void G_AddViewPitch (int look)
void G_AddViewPitch (int look, bool mouse)
{
if (gamestate == GS_TITLELEVEL)
{
Expand Down Expand Up @@ -837,11 +831,11 @@ void G_AddViewPitch (int look)
}
if (look != 0)
{
LocalKeyboardTurner = smooth_mouse;
LocalKeyboardTurner = (!mouse || smooth_mouse);
}
}

void G_AddViewAngle (int yaw)
void G_AddViewAngle (int yaw, bool mouse)
{
if (gamestate == GS_TITLELEVEL)
{
Expand All @@ -857,7 +851,7 @@ void G_AddViewAngle (int yaw)
LocalViewAngle -= yaw;
if (yaw != 0)
{
LocalKeyboardTurner = smooth_mouse;
LocalKeyboardTurner = (!mouse || smooth_mouse);
}
}

Expand Down Expand Up @@ -2199,7 +2193,7 @@ static void PutSaveWads (FSerializer &arc)
arc.AddString("Game WAD", name);

// Name of wad the map resides in
if (Wads.GetLumpFile (level.lumpnum) > 1)
if (Wads.GetLumpFile (level.lumpnum) > Wads.GetIwadNum())
{
name = Wads.GetWadName (Wads.GetLumpFile (level.lumpnum));
arc.AddString("Map WAD", name);
Expand Down
4 changes: 2 additions & 2 deletions src/g_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ void G_DoReborn (int playernum, bool freshbot);
void G_DoPlayerPop(int playernum);

// Adds pitch to consoleplayer's viewpitch and clamps it
void G_AddViewPitch (int look);
void G_AddViewPitch (int look, bool mouse = false);

// Adds to consoleplayer's viewangle if allowed
void G_AddViewAngle (int yaw);
void G_AddViewAngle (int yaw, bool mouse = false);

#define BODYQUESIZE 32
class AActor;
Expand Down
5 changes: 4 additions & 1 deletion src/gameconfigfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ FGameConfigFile::FGameConfigFile ()
SetValueForKey ("Path", "$PROGDIR", true);
#else
SetValueForKey ("Path", "~/" GAME_DIR, true);
SetValueForKey ("Path", SHARE_DIR, true);
SetValueForKey ("Path", "/usr/local/share/doom", true);
SetValueForKey ("Path", "/usr/local/share/games/doom", true);
SetValueForKey ("Path", "/usr/share/doom", true);
SetValueForKey ("Path", "/usr/share/games/doom", true);
#endif
SetValueForKey ("Path", "$DOOMWADDIR", true);
}
Expand Down
3 changes: 2 additions & 1 deletion src/gi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, intermissioncounter)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_single)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_coop)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_dm)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, mSliderColor)


const char *GameNames[17] =
Expand Down Expand Up @@ -382,9 +383,9 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_COLOR(dimcolor, "dimcolor")
GAMEINFOKEY_FLOAT(dimamount, "dimamount")
GAMEINFOKEY_FLOAT(bluramount, "bluramount")
GAMEINFOKEY_STRING(mSliderColor, "menuslidercolor")
GAMEINFOKEY_INT(definventorymaxamount, "definventorymaxamount")
GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime")
GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime")
GAMEINFOKEY_INT(defaultdropstyle, "defaultdropstyle")
GAMEINFOKEY_STRING(Endoom, "endoom")
GAMEINFOKEY_STRINGARRAY(quitmessages, "addquitmessages", 0, false)
Expand Down
1 change: 1 addition & 0 deletions src/gi.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ struct gameinfo_t
FName mFontColorHeader;
FName mFontColorHighlight;
FName mFontColorSelection;
FName mSliderColor;
FString mBackButton;
double gibfactor;
int TextScreenX;
Expand Down
2 changes: 1 addition & 1 deletion src/gl/data/gl_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void AdjustSpriteOffsets()

for (int i = 0; i < numtex; i++)
{
if (Wads.GetLumpFile(i) > 1) break; // we are past the IWAD
if (Wads.GetLumpFile(i) > Wads.GetIwadNum()) break; // we are past the IWAD
if (Wads.GetLumpNamespace(i) == ns_sprites && Wads.GetLumpFile(i) == Wads.GetIwadNum())
{
char str[9];
Expand Down
2 changes: 1 addition & 1 deletion src/gl/shaders/gl_postprocessshader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void PostProcessShaderInstance::BindTextures()
GLuint handle = 0;
glGenTextures(1, &handle);
glBindTexture(GL_TEXTURE_2D, handle);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, tex->GetWidth(), tex->GetHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, bitmap.GetPixels());
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, tex->GetWidth(), tex->GetHeight(), 0, GL_BGRA, GL_UNSIGNED_BYTE, bitmap.GetPixels());
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
mTextureHandles[tex] = handle;
Expand Down
6 changes: 4 additions & 2 deletions src/gl/system/gl_framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ void OpenGLFrameBuffer::Update()
Unlock();
CheckBench();

int clientWidth = ViewportScaledWidth(IsFullscreen() ? VideoWidth : GetClientWidth());
int clientHeight = ViewportScaledHeight(IsFullscreen() ? VideoHeight : GetClientHeight());
int initialWidth = IsFullscreen() ? VideoWidth : GetClientWidth();
int initialHeight = IsFullscreen() ? VideoHeight : GetClientHeight();
int clientWidth = ViewportScaledWidth(initialWidth, initialHeight);
int clientHeight = ViewportScaledHeight(initialWidth, initialHeight);
if (clientWidth > 0 && clientHeight > 0 && (Width != clientWidth || Height != clientHeight))
{
// Do not call Resize here because it's only for software canvases
Expand Down
4 changes: 2 additions & 2 deletions src/gl/system/gl_swframebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1304,8 +1304,8 @@ void OpenGLSWFrameBuffer::Flip()

if (!IsFullscreen())
{
int clientWidth = ViewportScaledWidth(GetClientWidth());
int clientHeight = ViewportScaledHeight(GetClientHeight());
int clientWidth = ViewportScaledWidth(GetClientWidth(), GetClientHeight());
int clientHeight = ViewportScaledHeight(GetClientWidth(), GetClientHeight());
if (clientWidth > 0 && clientHeight > 0 && (Width != clientWidth || Height != clientHeight))
{
Resize(clientWidth, clientHeight);
Expand Down
16 changes: 12 additions & 4 deletions src/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,16 @@ void PClassActor::RegisterIDs()
return;
}

FActorInfo *actorInfo = ActorInfo();

if (nullptr == actorInfo)
{
// Undefined class, exiting
return;
}

// Conversation IDs have never been filtered by game so we cannot start doing that.
auto ConversationID = ActorInfo()->ConversationID;
auto ConversationID = actorInfo->ConversationID;
if (ConversationID > 0)
{
StrifeTypes[ConversationID] = cls;
Expand All @@ -365,9 +373,9 @@ void PClassActor::RegisterIDs()
Printf(TEXTCOLOR_RED"Conversation ID %d refers to hidden class type '%s'\n", ConversationID, cls->TypeName.GetChars());
}
}
if (ActorInfo()->GameFilter == GAME_Any || (ActorInfo()->GameFilter & gameinfo.gametype))
if (actorInfo->GameFilter == GAME_Any || (ActorInfo()->GameFilter & gameinfo.gametype))
{
auto SpawnID = ActorInfo()->SpawnID;
auto SpawnID = actorInfo->SpawnID;
if (SpawnID > 0)
{
SpawnableThings[SpawnID] = cls;
Expand All @@ -376,7 +384,7 @@ void PClassActor::RegisterIDs()
Printf(TEXTCOLOR_RED"Spawn ID %d refers to hidden class type '%s'\n", SpawnID, cls->TypeName.GetChars());
}
}
auto DoomEdNum = ActorInfo()->DoomEdNum;
auto DoomEdNum = actorInfo->DoomEdNum;
if (DoomEdNum != -1)
{
FDoomEdEntry *oldent = DoomEdMap.CheckKey(DoomEdNum);
Expand Down
2 changes: 1 addition & 1 deletion src/intermission/intermission_parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ bool FIntermissionActionTextscreen::ParseKey(FScanner &sc)
else
{
// only print an error if coming from a PWAD
if (Wads.GetLumpFile(sc.LumpNum) > 1)
if (Wads.GetLumpFile(sc.LumpNum) > Wads.GetIwadNum())
sc.ScriptMessage("Unknown text lump '%s'", sc.String);
mText.Format("Unknown text lump '%s'", sc.String);
}
Expand Down
Loading

0 comments on commit efff148

Please sign in to comment.