Merge branch 'master' into vulkan2

This commit is contained in:
Christoph Oelckers 2019-04-07 08:17:12 +02:00
commit 6afe9d09f3
33 changed files with 4267 additions and 3899 deletions

View file

@ -394,6 +394,7 @@ bool FCajunMaster::DoAddBot (FLevelLocals *Level, uint8_t *info, botskill_t skil
else else
Printf ("%s joined the game\n", players[bnum].userinfo.GetName()); Printf ("%s joined the game\n", players[bnum].userinfo.GetName());
Level->localEventManager->PlayerEntered(bnum, false);
Level->DoReborn (bnum, true); Level->DoReborn (bnum, true);
return true; return true;
} }

View file

@ -1754,7 +1754,7 @@ void C_MidPrint (FFont *font, const char *msg, bool bold)
if (msg != nullptr) if (msg != nullptr)
{ {
auto color = (EColorRange)PrintColors[bold? PRINTLEVELS+1 : PRINTLEVELS]; auto color = (EColorRange)PrintColors[bold? PRINTLEVELS+1 : PRINTLEVELS];
Printf(PRINT_NONOTIFY, TEXTCOLOR_ESCAPESTR "%c%s\n%s\n%s\n", color, console_bar, msg, console_bar); Printf(PRINT_HIGH|PRINT_NONOTIFY, TEXTCOLOR_ESCAPESTR "%c%s\n%s\n%s\n", color, console_bar, msg, console_bar);
bool altscale = false; bool altscale = false;
if (font == nullptr) if (font == nullptr)

View file

@ -44,7 +44,6 @@
#include "utf8.h" #include "utf8.h"
EventManager staticEventManager; EventManager staticEventManager;
EventManager eventManager;
void EventManager::CallOnRegister() void EventManager::CallOnRegister()
{ {
@ -262,7 +261,12 @@ void EventManager::InitStaticHandlers(FLevelLocals *l, bool map)
void EventManager::Shutdown() void EventManager::Shutdown()
{ {
// delete handlers. // delete handlers.
TArray<DStaticEventHandler *> list;
for (DStaticEventHandler* handler = LastEventHandler; handler; handler = handler->prev) for (DStaticEventHandler* handler = LastEventHandler; handler; handler = handler->prev)
{
list.Push(handler);
}
for (auto handler : list)
{ {
handler->Destroy(); handler->Destroy();
} }
@ -631,11 +635,6 @@ DEFINE_ACTION_FUNCTION(DStaticEventHandler, SetOrder)
PARAM_SELF_PROLOGUE(DStaticEventHandler); PARAM_SELF_PROLOGUE(DStaticEventHandler);
PARAM_INT(order); PARAM_INT(order);
/* not really needed - this is never checked again. To re-add, the handlers need a pointer to their manager but that's not worth it just for this check.
if (eventManager.CheckHandler(self))
return 0;
*/
self->Order = order; self->Order = order;
return 0; return 0;
} }
@ -1223,7 +1222,7 @@ void DStaticEventHandler::NewGame()
// //
void DStaticEventHandler::OnDestroy() void DStaticEventHandler::OnDestroy()
{ {
eventManager.UnregisterHandler(this); owner->UnregisterHandler(this);
Super::OnDestroy(); Super::OnDestroy();
} }

View file

@ -332,5 +332,4 @@ struct EventManager
}; };
extern EventManager eventManager; extern EventManager staticEventManager;
extern EventManager staticEventManager;

View file

@ -80,7 +80,6 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
noTranslate = notranslate; noTranslate = notranslate;
Lump = fdlump; Lump = fdlump;
FontHeight = 0;
GlobalKerning = false; GlobalKerning = false;
FontName = name; FontName = name;
Next = FirstFont; Next = FirstFont;
@ -111,9 +110,8 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
// For anything else, each folder is being treated as an atomic, self-contained unit and mixing from different glyph sets is blocked. // For anything else, each folder is being treated as an atomic, self-contained unit and mixing from different glyph sets is blocked.
Wads.GetLumpsInFolder(path, folderdata, nametemplate == nullptr); Wads.GetLumpsInFolder(path, folderdata, nametemplate == nullptr);
if (nametemplate == nullptr) //if (nametemplate == nullptr)
{ {
// Only take font.inf from the actual folder we are processing but not from an older folder that may have been superseded.
FStringf infpath("fonts/%s/font.inf", filetemplate); FStringf infpath("fonts/%s/font.inf", filetemplate);
unsigned index = folderdata.FindEx([=](const FolderEntry &entry) unsigned index = folderdata.FindEx([=](const FolderEntry &entry)

View file

@ -47,6 +47,7 @@
#include "i_soundfont.h" #include "i_soundfont.h"
#include "i_system.h" #include "i_system.h"
#include "v_video.h" #include "v_video.h"
#include "gstrings.h"
void ClearSaveGames(); void ClearSaveGames();
@ -1105,6 +1106,7 @@ void M_StartupEpisodeMenu(FGameStartup *gs)
} }
int posx = (int)ld->mXpos;
int posy = (int)ld->mYpos; int posy = (int)ld->mYpos;
int topy = posy; int topy = posy;
@ -1132,6 +1134,23 @@ void M_StartupEpisodeMenu(FGameStartup *gs)
} }
if (!isOld) ld->mSelectedItem = ld->mItems.Size(); if (!isOld) ld->mSelectedItem = ld->mItems.Size();
for (unsigned i = 0; i < AllEpisodes.Size(); i++)
{
DMenuItemBase *it = nullptr;
if (AllEpisodes[i].mPicName.IsNotEmpty())
{
FTextureID tex = GetMenuTexture(AllEpisodes[i].mPicName);
if (AllEpisodes[i].mEpisodeName.IsEmpty() || TexMan.OkForLocalization(tex, AllEpisodes[i].mEpisodeName))
continue; // We do not measure patch based entries. They are assumed to fit
}
const char *c = AllEpisodes[i].mEpisodeName;
if (*c == '$') c = GStrings(c + 1);
int textwidth = ld->mFont->StringWidth(c);
int textright = posx + textwidth;
if (posx + textright > 320) posx = std::max(0, 320 - textright);
}
for(unsigned i = 0; i < AllEpisodes.Size(); i++) for(unsigned i = 0; i < AllEpisodes.Size(); i++)
{ {
DMenuItemBase *it = nullptr; DMenuItemBase *it = nullptr;
@ -1139,11 +1158,11 @@ void M_StartupEpisodeMenu(FGameStartup *gs)
{ {
FTextureID tex = GetMenuTexture(AllEpisodes[i].mPicName); FTextureID tex = GetMenuTexture(AllEpisodes[i].mPicName);
if (AllEpisodes[i].mEpisodeName.IsEmpty() || TexMan.OkForLocalization(tex, AllEpisodes[i].mEpisodeName)) if (AllEpisodes[i].mEpisodeName.IsEmpty() || TexMan.OkForLocalization(tex, AllEpisodes[i].mEpisodeName))
it = CreateListMenuItemPatch(ld->mXpos, posy, ld->mLinespacing, AllEpisodes[i].mShortcut, tex, NAME_Skillmenu, i); it = CreateListMenuItemPatch(posx, posy, ld->mLinespacing, AllEpisodes[i].mShortcut, tex, NAME_Skillmenu, i);
} }
if (it == nullptr) if (it == nullptr)
{ {
it = CreateListMenuItemText(ld->mXpos, posy, ld->mLinespacing, AllEpisodes[i].mShortcut, it = CreateListMenuItemText(posx, posy, ld->mLinespacing, AllEpisodes[i].mShortcut,
AllEpisodes[i].mEpisodeName, ld->mFont, ld->mFontColor, ld->mFontColor2, NAME_Skillmenu, i); AllEpisodes[i].mEpisodeName, ld->mFont, ld->mFontColor, ld->mFontColor2, NAME_Skillmenu, i);
} }
ld->mItems.Push(it); ld->mItems.Push(it);

View file

@ -993,7 +993,7 @@ void FLevelLocals::Serialize(FSerializer &arc, bool hubload)
// [ZZ] serialize events // [ZZ] serialize events
arc("firstevent", localEventManager->FirstEventHandler) arc("firstevent", localEventManager->FirstEventHandler)
("lastevent", localEventManager->LastEventHandler); ("lastevent", localEventManager->LastEventHandler);
localEventManager->CallOnRegister(); if (arc.isReading()) localEventManager->CallOnRegister();
Thinkers.SerializeThinkers(arc, hubload); Thinkers.SerializeThinkers(arc, hubload);
arc("polyobjs", Polyobjects); arc("polyobjs", Polyobjects);
SerializeSubsectors(arc, "subsectors"); SerializeSubsectors(arc, "subsectors");

View file

@ -548,6 +548,14 @@ void V_UpdateModeSize (int width, int height)
// The optimal scale will always be to fit a virtual 640 pixel wide display onto the screen. // The optimal scale will always be to fit a virtual 640 pixel wide display onto the screen.
// Exceptions are made for a few ranges where the available virtual width is > 480. // Exceptions are made for a few ranges where the available virtual width is > 480.
// This reference size is being used so that on 800x450 (small 16:9) a scale of 2 gets used.
CleanXfac = std::min(screen->GetWidth() / 400, screen->GetHeight() / 240);
if (CleanXfac >= 4) CleanXfac--; // Otherwise we do not have enough space for the episode/skill menus in some languages.
CleanYfac = CleanXfac;
CleanWidth = screen->GetWidth() / CleanXfac;
CleanHeight = screen->GetHeight() / CleanYfac;
int w = screen->GetWidth(); int w = screen->GetWidth();
int factor; int factor;
if (w < 640) factor = 1; if (w < 640) factor = 1;
@ -555,10 +563,6 @@ void V_UpdateModeSize (int width, int height)
else if (w >= 1600 && w < 1920) factor = 3; else if (w >= 1600 && w < 1920) factor = 3;
else factor = w / 640; else factor = w / 640;
CleanXfac = CleanYfac = factor;
CleanWidth = width / CleanXfac;
CleanHeight = height / CleanYfac;
CleanYfac_1 = CleanXfac_1 = MAX(1, int (CleanXfac * 0.7)); CleanYfac_1 = CleanXfac_1 = MAX(1, int (CleanXfac * 0.7));
CleanWidth_1 = width / CleanXfac_1; CleanWidth_1 = width / CleanXfac_1;
CleanHeight_1 = height / CleanYfac_1; CleanHeight_1 = height / CleanYfac_1;

View file

@ -433,7 +433,6 @@ IWad
Compatibility = "Shorttex" Compatibility = "Shorttex"
MustContain = "MAP01" MustContain = "MAP01"
BannerColors = "a8 00 00", "a8 a8 a8" BannerColors = "a8 00 00", "a8 a8 a8"
Load = "nerve.wad"
IgnoreTitlePatches = 1 IgnoreTitlePatches = 1
} }

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,9 @@
name,language,male,female,neutral,object name,language,male,female,neutral,object
ao_esp,es,o,a,o,o ao_esp,es,o,a,o,o
e_de,de,,e,, e_de,de,,e,,
e_in,de,,in,, in_de,de,,in,,
e_fr,fr,,e,, e_fr,fr,,e,,
ao_ptb,ptb,o,a,o,o ao_ptb,pt,o,a,o,o
,,,,, ,,,,,
,,,,, ,,,,,
ao_rus,ru,,а,о,о ao_rus,ru,,а,о,о

1 name language male female neutral object
2 ao_esp es o a o o
3 e_de de e
4 e_in in_de de in
5 e_fr fr e
6 ao_ptb ptb pt o a o o
7
8
9 ao_rus ru а о о

View file

@ -0,0 +1,2 @@
FontHeight 11

File diff suppressed because it is too large Load diff