From a166af82f8721c994104fafe329f56abb11c3cf0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 7 Apr 2019 09:11:16 +0200 Subject: [PATCH 1/6] - added layout adjustment to the skill menu as well and shortened the Italian text for "I'm too young to die" because it did not fit the minimum available space. --- src/menu/menudef.cpp | 30 +++++++++++++++++++++++++++--- wadsrc/static/language.csv | 26 +++++++++++++------------- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index d32dce5c5..0ae8cb99d 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -1599,7 +1599,7 @@ void M_StartupSkillMenu(FGameStartup *gs) if ((*desc)->IsKindOf(RUNTIME_CLASS(DListMenuDescriptor))) { DListMenuDescriptor *ld = static_cast(*desc); - int x = (int)ld->mXpos; + int posx = (int)ld->mXpos; int y = (int)ld->mYpos; // Delete previous contents @@ -1653,6 +1653,30 @@ void M_StartupSkillMenu(FGameStartup *gs) } } + for (unsigned int i = 0; i < MenuSkills.Size(); i++) + { + FSkillInfo &skill = *MenuSkills[i]; + DMenuItemBase *li = nullptr; + + FString *pItemText = nullptr; + if (gs->PlayerClass != nullptr) + { + pItemText = skill.MenuNamesForPlayerClass.CheckKey(gs->PlayerClass); + } + + if (skill.PicName.Len() != 0 && pItemText == nullptr) + { + FTextureID tex = GetMenuTexture(skill.PicName); + if (skill.MenuName.IsEmpty() || TexMan.OkForLocalization(tex, skill.MenuName)) + continue; + } + const char *c = pItemText ? pItemText->GetChars() : skill.MenuName.GetChars(); + 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); + } + unsigned firstitem = ld->mItems.Size(); for(unsigned int i = 0; i < MenuSkills.Size(); i++) { @@ -1673,11 +1697,11 @@ void M_StartupSkillMenu(FGameStartup *gs) { FTextureID tex = GetMenuTexture(skill.PicName); if (skill.MenuName.IsEmpty() || TexMan.OkForLocalization(tex, skill.MenuName)) - li = CreateListMenuItemPatch(ld->mXpos, y, ld->mLinespacing, skill.Shortcut, tex, action, SkillIndices[i]); + li = CreateListMenuItemPatch(posx, y, ld->mLinespacing, skill.Shortcut, tex, action, SkillIndices[i]); } if (li == nullptr) { - li = CreateListMenuItemText(x, y, ld->mLinespacing, skill.Shortcut, + li = CreateListMenuItemText(posx, y, ld->mLinespacing, skill.Shortcut, pItemText? *pItemText : skill.MenuName, ld->mFont, color,ld->mFontColor2, action, SkillIndices[i]); } ld->mItems.Push(li); diff --git a/wadsrc/static/language.csv b/wadsrc/static/language.csv index ff6186974..c6f8a72e1 100644 --- a/wadsrc/static/language.csv +++ b/wadsrc/static/language.csv @@ -1717,8 +1717,8 @@ Options,MNU_OPTIONS,,,,,Optionen,Opciones,,Options,,Opzioni,Opções,Настр Game Files,MNU_GAMEFILES,,,,,Spieldateien,Archivos del Juego,,Fichiers de jeu,,File di gioco,Jogos salvos,Файлы игры,Фајлови игре Info,MNU_INFO,,,,,Informationen,Información,,Info,,Informazioni,Info,Информация,Подаци Quit Game,MNU_QUITGAME,,,,,Spiel verlassen,Salir del juego,,Quitter le jeu,,Esci dal gioco,Sair,Выход,Заврши игру -Choose Skill Level:,MNU_CHOOSESKILL,"DE, ES, FR had to be shortened to fit the available space",,,,Schwierigkeitsgrad:,Elige nivel de dificultad:,,Difficulté:,,Scegli il livello di difficoltà:,Escolha Dificuldade:,Уровень сложности:,Изаберите ниво тежине: -I'm too young to die.,SKILL_BABY,,,,,Ich bin zu jung zum Sterben.,Soy muy joven para morir.,,Trop jeune pour mourir!,,Sono troppo giovane per morire.,Facil,Мне рано умирать.,Премлад сам да умрем +Choose Skill Level:,MNU_CHOOSESKILL,This text is extremely space limited!,,,,Schwierigkeitsgrad:,Elige nivel de dificultad:,,Difficulté:,,Livello di difficoltà:,Escolha Dificuldade:,Уровень сложности:,Изаберите ниво тежине: +I'm too young to die.,SKILL_BABY,,,,,Ich bin zu jung zum Sterben.,Soy muy joven para morir.,,Trop jeune pour mourir!,,Troppo giovane per morire.,Facil,Мне рано умирать.,Премлад сам да умрем "Hey, not too rough.",SKILL_EASY,,,,,"He, nicht so ruppig.","Oye, no tan rudo.",,"Hé, pas trop fort!",,"Ehi, non troppo duro!",Medio,"Эй, не так грубо.","Хеј, не претерано грубо" Hurt me plenty.,SKILL_NORMAL,,,,,Tu mir weh.,Lastímame suficiente.,,Fais-moi mal!,,Fammi molto male.,Dificil,Сделай мне больно.,Повреди ме кол'ко можеш Ultra-Violence.,SKILL_HARD,,,,,Volle Gewalt.,Ultra-Violencia.,,Ultra-Violence!,,Ultra-violenza.,Desafio,Ультранасилие.,Ултра-насилно @@ -2014,14 +2014,14 @@ Show time,ALTHUDMNU_SHOWTIME,,,,,Zeige Zeit,Mostrar tiempo,,Afficher temps nivea Time color,ALTHUDMNU_TIMECOLOR,,,Time colour,,Zeiot-Farbe,Color del tiempo,,Couleur du timer,,Colore del tempo,,Цвет времени, Show network latency,ALTHUDMNU_SHOWLAG,,,,,Zeige Netzwerk-Latenz,Mostrar latencia de red,,Afficher latence réseau,,Mostra la latenza del network,,Отображение задержки сети, Ammo display order,ALTHUDMNU_AMMOORDER,,,,,Munitionsreihenfolge,Orden vista de munición,,Ordre d'affichage des munitions,,Ordine mostra delle munizioni,,Порядок отображения боеприпасов, -Red ammo display below %,ALTHUDMNU_AMMORED,,,,,Rot für Munition unter %,Porcent. de munición en rojo,,Compteur de munitions rouge sous,,Contatore delle munizioni di colore rosso sotto,,Кр. отображение боеприпасов под %, -Yellow ammo display below %,ALTHUDMNU_AMMOYELLOW,,,,,Gelb für Munition unter %,Porcent. de munición en amarillo,,Compteur de munitions jaune sous,,Contatore delle munizioni di colore giallo sotto,,Жл. отображение боеприпасов под %, -Red health display below,ALTHUDMNU_HEALTHRED,,,,,Rot für Gesundheit unter %,Porcent. de salud en rojo,,Compteur de santé rouge sous,,Contatore della salute di colore rosso sotto,,Красное отображение здоровья под, -Yellow health display below,ALTHUDMNU_HEALTHYELLOW,,,,,Gelb für Gesundheit unter %,Porcent. de salud en amarillo,,Compteur de santé jaune sous,,Contatore della salute di colore giallo sotto,,Жёлтое отображение здоровья под, -Green health display below,ALTHUDMNU_HEALTHGREEN,,,,,Grün für Gesundheit unter %,Porcent. de salud en verde,,Compteur de santé vert sous,,Contatore della salute di colore verde sotto,,Зел. отображение здоровья под, -Red armor display below,ALTHUDMNU_ARMORRED,,,Red armour display below,,Rot für Panzerung unter %,Porcent. de blindaje en rojo,,Compteur d' armure rouge sous,,Contatore dell'armatura di colore rosso sotto,,Красное отображение броня под, -Yellow armor display below,ALTHUDMNU_ARMORYELLOW,,,Yellow armour display below,,Gelb für Panzerung unter %,Porcent. de blindaje en amarillo,,Compteur d' armure jaune sous,,Contatore dell'armatura di colore giallo sotto,,Жёлтое отображение броня под, -Green armor display below,ALTHUDMNU_ARMORGREEN,,,Green armour display below,,Grün für Panzerung unter %,Porcent. de blindaje en verde,,Compteur d' armure bleu sous,,Contatore dell'armatura di colore verde sotto,,Зел. отображение броня под, +Red ammo display below %,ALTHUDMNU_AMMORED,,,,,Rot für Munition unter %,Porcent. de munición en rojo,,Compteur de munitions rouge sous,,Contatore delle munizioni di colore rosso sotto,,"Отображение боеприпасов красным ниже, %", +Yellow ammo display below %,ALTHUDMNU_AMMOYELLOW,,,,,Gelb für Munition unter %,Porcent. de munición en amarillo,,Compteur de munitions jaune sous,,Contatore delle munizioni di colore giallo sotto,,"Отображение боеприпасов жёлтым ниже, %", +Red health display below,ALTHUDMNU_HEALTHRED,,,,,Rot für Gesundheit unter %,Porcent. de salud en rojo,,Compteur de santé rouge sous,,Contatore della salute di colore rosso sotto,,"Отображение здоровья красным ниже, %", +Yellow health display below,ALTHUDMNU_HEALTHYELLOW,,,,,Gelb für Gesundheit unter %,Porcent. de salud en amarillo,,Compteur de santé jaune sous,,Contatore della salute di colore giallo sotto,,"Отображение здоровья жёлтым ниже, %", +Green health display below,ALTHUDMNU_HEALTHGREEN,,,,,Grün für Gesundheit unter %,Porcent. de salud en verde,,Compteur de santé vert sous,,Contatore della salute di colore verde sotto,,"Отображение здоровья зелёным ниже, %", +Red armor display below,ALTHUDMNU_ARMORRED,,,Red armour display below,,Rot für Panzerung unter %,Porcent. de blindaje en rojo,,Compteur d' armure rouge sous,,Contatore dell'armatura di colore rosso sotto,,"Отображение брони красным ниже, %", +Yellow armor display below,ALTHUDMNU_ARMORYELLOW,,,Yellow armour display below,,Gelb für Panzerung unter %,Porcent. de blindaje en amarillo,,Compteur d' armure jaune sous,,Contatore dell'armatura di colore giallo sotto,,"Отображение брони жёлтым ниже, %", +Green armor display below,ALTHUDMNU_ARMORGREEN,,,Green armour display below,,Grün für Panzerung unter %,Porcent. de blindaje en verde,,Compteur d' armure bleu sous,,Contatore dell'armatura di colore verde sotto,,"Отображение брони зелёным ниже, %", Alternative Automap HUD,ALTHUDMNU_AUTOMAPHUD,,,,,Alternatives Automap HUD,HUD alternativo del automapa,,ATH Alternatif pour carte,,HUD automappa alternativo,,Альт. HUD на автокарте, Map title color,ALTHUDMNU_TITLECOLOR,,,Map title colour,,Farbe für Levelnamen,Color del título del mapa,,Couleur titre du niveau,,Colore titolo mappa,,Цвет названия уровня, Map time color,ALTHUDMNU_MAPTIMECOLOR,,,Map time colour,,Farbe für Level-Zeit,Color del tiempo del mapa,,Couleur temps du niveau,,Colore tempo mappa,,Цвет времени для уровней, @@ -2291,11 +2291,11 @@ Select configuration,ADVSNDMNU_SELCONFIG,,,,,Konfiguration wählen,Seleccionar c Global,ADVSNDMNU_GLOBAL,,,,,,Global,,,,Globale,,Общие, Freeverb,ADVSNDMNU_FREEVERB,,,,,,,,,,,,, Global Freeverb,ADVSNDMNU_GLOBAL_FREEVERB,,,,,Globales Freeverb,Freeverb Global,,Freeverb Global,,Freeverb globale,,Глобальный Freeverb, -Advanced Resampling,ADVSNDMNU_ADVRESAMPLING,,,,,Erweitertes Resampling,Resampleo Avanzado,,Resampling Avancé,,Resampling avanzato,,Продвинутый ресемплинг, +Advanced Resampling,ADVSNDMNU_ADVRESAMPLING,,,,,Erweitertes Resampling,Resampleo Avanzado,,Resampling Avancé,,Resampling avanzato,,Продвинутый ресэмплинг, OPL Bank,ADVSNDMNU_OPLBANK,,,,,,Banco OPL,,Banque OPL,,,,Банк OPL, OPL Emulator Core,ADVSNDMNU_ADLOPLCORES,,,,,OPL Emulatorkern,Núcleos de Emulador OPL,,Cœur Emulateur OPL,,,,Ядро эмуляции OPL, Run emulator at PCM rate,ADVSNDMNU_RUNPCMRATE,,,,,Emulator benutzt PCM Samplerate,Ejecutar emulador a velocidad PCM,,Emulateur utilise cadence PCM,,Esegui l'emulatore con rate PCM,,Использовать с частотой PCM, -Number of emulated OPL chips,ADVSNDMNU_ADLNUMCHIPS,,,,,Anzahl OPL Chips,Número de chips OPL emulados,,Puces OPL émulées,,Numero di chip OPL emulati,,Количество эмулируемых чипов OPL, +Number of emulated OPL chips,ADVSNDMNU_ADLNUMCHIPS,,,,,Anzahl OPL Chips,Número de chips OPL emulados,,Puces OPL émulées,,Numero di chip OPL emulati,,Количество эмулируемых OPL-чипов, Volume model,ADVSNDMNU_VLMODEL,,,,,Lautstärkemodell,Modelo de Volumen,,Modèle de Volume,,Modello di volume,,Модель громкости, Number of emulated OPN chips,ADVSNDMNU_OPNNUMCHIPS,,,,,Anzahl OPN Chips,Número de chip OPN emulados,,Puces OPN émulées,,Numero di chip OPN emulati,,Количество эмулируемых чипов OPN, Use custom WOPL bank,ADVSNDMNU_ADLCUSTOMBANK,,,,,Benutzerdefinierte WOPL Bank,Utilizar banco WOPL personalizado,,Utiliser Banque WOPL perso,,Usa WOPL bank personalizzato,,Использовать собственный банк WOPL, @@ -2778,7 +2778,7 @@ Warning: The Vulkan renderer is highly experimental!,VK_WARNING,,,,,Achtung: Der These options will require a restart to take effect.,VK_RESTART,,,,,Diese Option erfordert einen Neustart!,Estas opciones requieren reiniciar para tener efecto.,,Ces options nécessitent un redémarrage.,,Queste opzioni richiedono il riavvio per avere effetto.,,Для применения изменений требуется рестарт., Select Vulkan Device,VKMNU_DEVICESELECT,This is not yet implemented - but it is planned,,,,Vulkan Gerät auswählen,Seleccionar Dispositivo Vulkan,,Sélectionner périphérique Vulkan,,Seleziona il Dispositivo Vulkan,,Выберите устройство Vulkan, Press any key or click anywhere in the window to quit.,TXT_QUITENDOOM,,,,,Drücke eine Taste oder klicke mit der Maus ins Fenster zum Beenden.,Presiona una tecla o haz click en cualquier lugar de la ventana para salir.,Presiona una tecla o da click en cualquier lugar de la ventana para salir.,Appuyez sur une touche ou cliquez pour quitter.,,Premi un qualunque tasto o fai un click ovunque nella finestra per uscire.,,Нажмите любую клавишу или кликните по окну чтобы выйти., -No vertical thrust from explosions,CMPTMNU_EXPLODE1,,,,,Keine vertikale Bewegung durch Explosionen,No causar empuje vertical en explosiones,,Explosions sans propulsion verticale,,Nessuna spinta verticale dalle esplosioni,,Без вертикальной тяги от взрывов, +No vertical thrust from explosions,CMPTMNU_EXPLODE1,,,,,Keine vertikale Bewegung durch Explosionen,No causar empuje vertical en explosiones,,Explosions sans propulsion verticale,,Nessuna spinta verticale dalle esplosioni,,Взрывы не отбрасывают вверх/вниз, Use original Doom explosion behavior,CMPTMNU_EXPLODE2,,,Use original Doom explosion behaviour,,Benutze Original Doom Explosionsverhalten,Usar comportamiento de explosiones del DOOM original,,Utiliser comportement Doom original,,Usa l'originale comportamento dell'esplosione di Doom,,Использовать модель взрывов из оригинального Doom., Screen Blend Options,HUDMNU_FLASH,,,,,Überblendoptionen,,,Options de blending écran,,Opzioni Blending dello Schermo,,Настройки смешивания экрана, Postprocessing,GLMNU_POSTPROCESS,,,,,,Postprocesado,,,,,,Постобработка, From 45c35586929ab349276b4c1ade36f9e544aaba57 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 7 Apr 2019 09:31:32 +0200 Subject: [PATCH 2/6] - 4.1pre --- src/version.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/version.h b/src/version.h index 5c9b2c936..5e161dae2 100644 --- a/src/version.h +++ b/src/version.h @@ -41,15 +41,15 @@ const char *GetVersionString(); /** Lots of different version numbers **/ -#define VERSIONSTR "3.8pre" +#define VERSIONSTR "4.1pre" // The version as seen in the Windows resource -#define RC_FILEVERSION 3,7,9999,0 -#define RC_PRODUCTVERSION 3,7,9999,0 +#define RC_FILEVERSION 4,0,9999,0 +#define RC_PRODUCTVERSION 4,0,9999,0 #define RC_PRODUCTVERSION2 VERSIONSTR // These are for content versioning. -#define VER_MAJOR 3 -#define VER_MINOR 8 +#define VER_MAJOR 4 +#define VER_MINOR 1 #define VER_REVISION 0 // Version identifier for network games. From 1096c14a3a2d7c7f97b949724fbc999985444ab7 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 7 Apr 2019 06:01:47 -0400 Subject: [PATCH 3/6] - remove 320x240 from the list of resolution presets - enforce a minimum CleanXfac scaling in the menu to prevent accidental divide by 0's --- src/v_video.cpp | 2 +- wadsrc/static/menudef.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/v_video.cpp b/src/v_video.cpp index 227d8b84d..22cb48593 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -546,7 +546,7 @@ void V_UpdateModeSize (int width, int height) // 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); + CleanXfac = std::max(std::min(screen->GetWidth() / 400, screen->GetHeight() / 240), 1); 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; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index a8270496f..6ab81ffa5 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -2188,7 +2188,6 @@ OptionMenu CustomResolutionMenu protected StaticText "$VIDMNU_RESPRESETHEAD" StaticText "" StaticText "$VIDMNU_ASPECT43" - Command "320x240", "menu_resolution_set_custom 320 240" Command "640x480", "menu_resolution_set_custom 640 480" Command "1024x768", "menu_resolution_set_custom 1024 768" Command "1280x960", "menu_resolution_set_custom 1280 960" From b60024b9c8721b98e449e00bb7eea19598c7d585 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 7 Apr 2019 12:05:24 +0200 Subject: [PATCH 4/6] - fixed: The WideString conversion function was missing a null check. --- src/utility/zstring.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utility/zstring.cpp b/src/utility/zstring.cpp index f3bdbd567..6bcf36c7f 100644 --- a/src/utility/zstring.cpp +++ b/src/utility/zstring.cpp @@ -1314,6 +1314,7 @@ FString &FString::operator=(const wchar_t *copyStr) std::wstring WideString(const char *cin) { + if (!cin) return L""; const uint8_t *in = (const uint8_t*)cin; // This is a bit tricky because we need to support both UTF-8 and legacy content in ISO-8859-1 // and thanks to user-side string manipulation it can be that a text mixes both. From f4ea44b76003c85ba4af586eaf37d51f7a90e49e Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 7 Apr 2019 06:49:54 -0400 Subject: [PATCH 5/6] - consolidate minimum screen resolution so that it's easier to change --- src/posix/cocoa/gl_sysfb.h | 2 -- src/posix/cocoa/i_video.mm | 7 ++++--- src/r_videoscale.cpp | 16 ++++++++-------- src/v_framebuffer.cpp | 4 ++-- src/v_video.h | 3 +++ src/win32/i_input.cpp | 4 ++-- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/posix/cocoa/gl_sysfb.h b/src/posix/cocoa/gl_sysfb.h index 2a2b8a5d2..664abee81 100644 --- a/src/posix/cocoa/gl_sysfb.h +++ b/src/posix/cocoa/gl_sysfb.h @@ -91,8 +91,6 @@ private: int GetTitleBarHeight() const; - static const int MINIMUM_WIDTH = 640; - static const int MINIMUM_HEIGHT = 400; }; #endif // COCOA_GL_SYSFB_H_INCLUDED diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index d18099ca1..58a929f9b 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -35,6 +35,7 @@ #include "i_common.h" +#include "v_video.h" #include "bitmap.h" #include "c_dispatch.h" #include "doomstat.h" @@ -345,7 +346,7 @@ void SystemGLFrameBuffer::ToggleFullscreen(bool yes) void SystemGLFrameBuffer::SetWindowSize(int width, int height) { - if (width < MINIMUM_WIDTH || height < MINIMUM_HEIGHT) + if (width < VID_MIN_WIDTH || height < VID_MIN_HEIGHT) { return; } @@ -426,8 +427,8 @@ void SystemGLFrameBuffer::SetWindowedMode() [m_window setHidesOnDeactivate:NO]; } - const int minimumFrameWidth = MINIMUM_WIDTH; - const int minimumFrameHeight = MINIMUM_HEIGHT + GetTitleBarHeight(); + const int minimumFrameWidth = VID_MIN_WIDTH; + const int minimumFrameHeight = VID_MIN_HEIGHT + GetTitleBarHeight(); const NSSize minimumFrameSize = NSMakeSize(minimumFrameWidth, minimumFrameHeight); [m_window setMinSize:minimumFrameSize]; diff --git a/src/r_videoscale.cpp b/src/r_videoscale.cpp index fbd7393c5..493fd122a 100644 --- a/src/r_videoscale.cpp +++ b/src/r_videoscale.cpp @@ -32,16 +32,16 @@ extern bool setsizeneeded; EXTERN_CVAR(Int, vid_aspect) -CUSTOM_CVAR(Int, vid_scale_customwidth, 640, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Int, vid_scale_customwidth, VID_MIN_WIDTH, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { - if (self < 640) - self = 640; + if (self < VID_MIN_WIDTH) + self = VID_MIN_WIDTH; setsizeneeded = true; } -CUSTOM_CVAR(Int, vid_scale_customheight, 400, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Int, vid_scale_customheight, VID_MIN_HEIGHT, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { - if (self < 400) - self = 400; + if (self < VID_MIN_HEIGHT) + self = VID_MIN_HEIGHT; setsizeneeded = true; } CVAR(Bool, vid_scale_customlinear, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) @@ -116,7 +116,7 @@ int ViewportScaledWidth(int width, int height) vid_scalemode = 0; if (vid_cropaspect && height > 0) width = ((float)width/height > ActiveRatio(width, height)) ? (int)(height * ActiveRatio(width, height)) : width; - return (int)MAX((int32_t)320, (int32_t)(vid_scalefactor * vScaleTable[vid_scalemode].GetScaledWidth(width))); + return (int)MAX((int32_t)VID_MIN_WIDTH, (int32_t)(vid_scalefactor * vScaleTable[vid_scalemode].GetScaledWidth(width))); } int ViewportScaledHeight(int width, int height) @@ -125,7 +125,7 @@ int ViewportScaledHeight(int width, int height) vid_scalemode = 0; if (vid_cropaspect && height > 0) height = ((float)width/height < ActiveRatio(width, height)) ? (int)(width / ActiveRatio(width, height)) : height; - return (int)MAX((int32_t)200, (int32_t)(vid_scalefactor * vScaleTable[vid_scalemode].GetScaledHeight(height))); + return (int)MAX((int32_t)VID_MIN_HEIGHT, (int32_t)(vid_scalefactor * vScaleTable[vid_scalemode].GetScaledHeight(height))); } bool ViewportIsScaled43() diff --git a/src/v_framebuffer.cpp b/src/v_framebuffer.cpp index 3a569cb1d..24cbb1914 100644 --- a/src/v_framebuffer.cpp +++ b/src/v_framebuffer.cpp @@ -210,8 +210,8 @@ void DFrameBuffer::Update() int initialHeight = GetClientHeight(); int clientWidth = ViewportScaledWidth(initialWidth, initialHeight); int clientHeight = ViewportScaledHeight(initialWidth, initialHeight); - if (clientWidth < 640) clientWidth = 640; - if (clientHeight < 400) clientHeight = 400; + if (clientWidth < VID_MIN_WIDTH) clientWidth = VID_MIN_WIDTH; + if (clientHeight < VID_MIN_HEIGHT) clientHeight = VID_MIN_HEIGHT; if (clientWidth > 0 && clientHeight > 0 && (GetWidth() != clientWidth || GetHeight() != clientHeight)) { SetVirtualSize(clientWidth, clientHeight); diff --git a/src/v_video.h b/src/v_video.h index 7f35f3322..39089388c 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -46,6 +46,9 @@ #include "v_2ddrawer.h" #include "hwrenderer/dynlights/hw_shadowmap.h" +static const int VID_MIN_WIDTH = 640; +static const int VID_MIN_HEIGHT = 400; + struct sector_t; class IShaderProgram; class FTexture; diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index b8f5ba777..74791cc5c 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -525,8 +525,8 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) } else { - mmi->ptMinTrackSize.x = 640; - mmi->ptMinTrackSize.y = 400; + mmi->ptMinTrackSize.x = VID_MIN_WIDTH; + mmi->ptMinTrackSize.y = VID_MIN_HEIGHT; } return 0; } From c3b927e502782f70e707c5245c68a0f29fbef30d Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 7 Apr 2019 06:59:34 -0400 Subject: [PATCH 6/6] - complete the changes from the previous commit for the SDL backend --- src/posix/sdl/gl_sysfb.h | 3 --- src/posix/sdl/sdlglvideo.cpp | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/posix/sdl/gl_sysfb.h b/src/posix/sdl/gl_sysfb.h index 6b1df1cc3..404c45b72 100644 --- a/src/posix/sdl/gl_sysfb.h +++ b/src/posix/sdl/gl_sysfb.h @@ -46,9 +46,6 @@ protected: SDL_GLContext GLContext; void UpdateColors (); - - static const int MIN_WIDTH = 640; - static const int MIN_HEIGHT = 400; }; #endif // __POSIX_SDL_GL_SYSFB_H__ diff --git a/src/posix/sdl/sdlglvideo.cpp b/src/posix/sdl/sdlglvideo.cpp index d92c6fa9a..340947dfd 100644 --- a/src/posix/sdl/sdlglvideo.cpp +++ b/src/posix/sdl/sdlglvideo.cpp @@ -245,7 +245,7 @@ SystemGLFrameBuffer::SystemGLFrameBuffer (void *, bool fullscreen) if (Screen != NULL) { // enforce minimum size limit - SDL_SetWindowMinimumSize(Screen, MIN_WIDTH, MIN_HEIGHT); + SDL_SetWindowMinimumSize(Screen, VID_MIN_WIDTH, VID_MIN_HEIGHT); GLContext = SDL_GL_CreateContext(Screen); if (GLContext != NULL) @@ -340,10 +340,10 @@ int SystemGLFrameBuffer::GetClientHeight() void SystemGLFrameBuffer::SetWindowSize(int w, int h) { - if (w < MIN_WIDTH || h < MIN_HEIGHT) + if (w < VID_MIN_WIDTH || h < VID_MIN_HEIGHT) { - w = MIN_WIDTH; - h = MIN_HEIGHT; + w = VID_MIN_WIDTH; + h = VID_MIN_HEIGHT; } win_w = w; win_h = h;