Commit graph

15086 commits

Author SHA1 Message Date
Major Cooke
b48f7da43e Renamed to musplaying. 2019-02-28 18:47:28 +01:00
Major Cooke
210af0d414 Exported MusPlayingInfo to ZScript.
- Allows grabbing the currently playing song, base order, and loop properties.
2019-02-28 18:47:28 +01:00
Christoph Oelckers
fab8fed8df - reformat the intermission screen if the text is very long.
This will ensure better visibility on widescreen displays, at least.
2019-02-27 22:52:08 +01:00
nashmuhandes
407983749a Added a master volume setting. 2019-02-27 14:17:45 -05:00
Christopher Bruns
8becc0e78d Enable menu blur in stereo 3d.
Use more blitting to avoid confusing framebuffer state management in stereo 3D.
2019-02-27 09:51:02 +01:00
Christoph Oelckers
90ab830ff9 - added a workaround for mods using the name CONFONT directly.
In the old system it just loaded the font a second time, but with the folder based setup there is no file named CONFONT anymore so it needs to be dealt with explicitly.
2019-02-26 19:19:03 +01:00
Christoph Oelckers
e8f690116b - removed unused gl_spritebrightfog CVAR. 2019-02-26 00:07:30 +01:00
Christoph Oelckers
4a427694ac - changed calculation of the scaling value for the option menu.
This was already far too generous and caused space problems, but with localization these became a lot worse, so now it will try to allocate at least 640 virtual pixels for the menu width and only go below that for small resolution ranges where the smaller value would result in too small text.
2019-02-26 00:07:09 +01:00
Christopher Bruns
051145b2c8 Use flag to avoid second eye stereo color problem 2019-02-25 00:14:41 +01:00
Christopher Bruns
e83092a7eb Fix stereo-3D 2D quad color problem. 2019-02-25 00:14:41 +01:00
Christoph Oelckers
b670d5f372 - fixed utf8_decode.
This function was written for already validated UTF-8 but not for text that can be mixed with ISO-8859-1.
To handle that properly it needs to do a bit more validation to avoid mangling its output and instead reject invalid input.
2019-02-24 13:55:08 +01:00
Christoph Oelckers
0676a98efc - fixed: ACS must use COPY_AAPTREX for all pointer transfers.
It was already correct for most, but two cases have slipped through.
2019-02-24 12:10:56 +01:00
Christoph Oelckers
6129f9a9cc - fixed a warning and set NOINITCALL for a few CVARs accessing the current level.
These inits are done at a time when the data isn't even initialized so they will get overwritten anyway.
2019-02-24 10:05:01 +01:00
Christoph Oelckers
d5f138f14d - made the text comparison for Dehacked case insensitive so that the contents of the string table can be properly capitalized without breaking old-style string replacements. 2019-02-23 20:23:04 +01:00
Rachael Alexanderson
7098748e9e - fix building on case sensitive systems 2019-02-23 13:51:24 -05:00
Christoph Oelckers
bae0094039 - fixed the status bar string drawers which weren't UTF-8 capable yet. 2019-02-23 19:44:00 +01:00
Christoph Oelckers
c5156d4598 - moved around a few more files. 2019-02-23 18:57:49 +01:00
Christoph Oelckers
c3890342e6 - moved the 2D drawing code to its own directory under 'rendering'. 2019-02-23 18:08:57 +01:00
Christoph Oelckers
ef3e5ef01e - moved a few parts from g_level.cpp to better fitting places. 2019-02-23 15:21:54 +01:00
Christoph Oelckers
2874a36fbe - added the final missing piece of localization support, i.e. forcing text based menus.
Now a localization mod can disable the graphics patches containing text entirely so that it can properly localize the text based menu variant.
If this flag gets set in MAPINFO, it will override all user settings.
2019-02-23 10:40:07 +01:00
Christoph Oelckers
add10029b9 - fixed chat input. 2019-02-23 09:54:18 +01:00
Christoph Oelckers
a50a0c5b0d - fixed: empty strings cannot be substituted. 2019-02-23 09:20:30 +01:00
Christoph Oelckers
e091369a38 - removed FCriticalSection and replaced all of its uses with std::mutex.
There's really no need for a non-standard solution here anymore with C++11.
This also fixes an unreleased lock in the WildMidi code.
2019-02-22 20:24:24 +01:00
Christoph Oelckers
3d9dce0156 - fixed DHUDMessageTypeOnFadeOut with empty messages. 2019-02-22 19:58:52 +01:00
Christoph Oelckers
f907bb0484 - moved a few more things and deleted the unused v_pfx implementation.
These were pixel format conversion routines used in the D3D backend. Nothing in here is needed anymore - the FBitmap class offers much of the functionality covered here in a far more concise and approachable manner.
2019-02-22 19:48:18 +01:00
Christoph Oelckers
b386603044 - deleted the unused lumpconfigfile.
The chance that this will ever see some use is precisely zero so there's no need keeping this code around.
2019-02-22 19:13:40 +01:00
Christoph Oelckers
8c06a00ee6 - moved all dialogue loading code into the map loader. 2019-02-22 19:07:58 +01:00
Christoph Oelckers
e06aa28620 - fixed the usedcolor array's base type.
The usedcolors array which counts the number of pixels in a given color in a font used bytes as storage, so any color that just happened to have a count that is a multiple of 256 the color was considered not present.
2019-02-22 18:19:26 +01:00
Christoph Oelckers
2eb312e041 - added a kerning option to FONTDEFS 2019-02-21 01:02:42 +01:00
Christoph Oelckers
2907ba69a0 - implemented OkForLocalization 2019-02-21 00:56:03 +01:00
Christoph Oelckers
48fcdacf06 - more work on graphics substitutiion
* added a CVAR that sets how localizable graphics need to be dealt with.
* pass the substitution string to OkForLocalization so that proper checks can be performed.
* increased item spacing on Doom's list menus to 18 from 16 pixels, because otherwise the diacritic letters would not fit. 20 would have been more ideal but 18 was the limit without compromising its visual style
* added a second text-only main menu because here the spacing cannot be changed. Doing so would render any single-patch main menu non-functional. So here the rules are that if substitution takes place, it will swap out the entire menu class.
* fixed some issues with the summary screen's "entering" and "finished" graphics.
2019-02-21 00:35:27 +01:00
Christoph Oelckers
8bdbd2e915 - fixed layout of summary screen. 2019-02-21 00:16:48 +01:00
Christoph Oelckers
6a742f8d34 - changed all places which used a localized string as a format template for printf, String.Format et.al.
Passing something non-constant at compile time here is extremely dangerous, especially when users can replace those strings if they like.
It now uses FString::Substitute in all cases where something needs to be inserted into a template string.
2019-02-20 20:20:06 +01:00
Christoph Oelckers
15eb57e00d - finalized graphics substitution feature. 2019-02-20 19:40:17 +01:00
Christoph Oelckers
ecb1c2ee4a - initialize the language right after reading the strings. 2019-02-20 19:30:39 +01:00
Christoph Oelckers
0e449405a4 - fixed string checks in dialogue loader. 2019-02-20 19:12:32 +01:00
Christoph Oelckers
d2ac77e721 - fixed reading of exit text replacements and display of intermission text screens for Unicode. 2019-02-20 19:04:34 +01:00
Christoph Oelckers
64dc582fbe - reworked texture lookup for localized textures 2019-02-20 00:52:31 +01:00
Christoph Oelckers
8587f253a8 - fixed a typo 2019-02-20 00:43:06 +01:00
Christoph Oelckers
4eb8b53d95 - enforce that localized graphics need to be the same size as the one they replace.
This is one of those things where the work needed to make it robust stands in no relation to the gain.
This simply isn't worth the hassle of going through the entire code and fixing every single use of the 2D texture drawing functions.

Unfortunately this means that the graphics items for the menu cannot be replaced this way because their size will most likely differ, but considering that the only candidates for this are the contents of Doom's main menu, the episode menu, the skill menu and the single player summary screen, it's simply not worth it.

In all these cases the IWAD contents can just as easily be replaced with text and user mods which want to offer localized menus will have to work within the confines of the system, e.g. making sure that all menu items are designed to have proper size for substitution to work or by requesting text based menus, which will be added as a modding feature later.
2019-02-20 00:42:02 +01:00
Christoph Oelckers
5f25fbb2e3 - added support for localized texture replacements
This reads the textures and builds the data tables, but doesn´t use the textures yet.
A bit more work is needed first.
2019-02-20 00:22:00 +01:00
Christoph Oelckers
5e7fb16d05 - preparation work for substituting the menu and intermission screen text graphics for localization 2019-02-19 01:22:12 +01:00
Christoph Oelckers
10a017e104 - fixed: The language ID was set before reading the config.
This essentially rendered saving the language CVAR useless.
2019-02-19 00:29:22 +01:00
Christoph Oelckers
91206f12be - changed zstrformat to allow %c to emit non-ASCII characters as UTF-8. 2019-02-19 00:27:47 +01:00
Christoph Oelckers
c5a6c72719 - fixed uninitialized variable and a few warnings. 2019-02-18 23:36:56 +01:00
Christoph Oelckers
b98c3b766c - added a function that creates a texture for a text in a given font.
Not tested yet, this is for synthesizing localized variant of Doom's textures with text content.
2019-02-18 20:53:56 +01:00
Christoph Oelckers
5970040672 - fixed: The wbstartstruct that gets passed to the level summary screen needs to be static
This variable is needed long after the function which sets it up will be exited. So this either needs to be dynamically allocated or static, and in this case using a static variable is simpler.  However, unlike before, it is only being accessed in the one function that needs to initialize it and pass to the summary screen and nowhere else.
2019-02-18 00:43:40 +01:00
Christoph Oelckers
aa550310f6 - allow the language table to supersede the title patches, if appropriate
For the Doom IWADs the provided font looks almost identical to the characters used on the title patches. So, for any level name that got replaced in some language, it will now check if the retrieved name comes from the default table, and if not, ignore the title patch and print the name with the specified font.

This also required removing the 'en' label from the default table,  because with this present, the text would always be picked from 'en' instead of 'default'. Since 'en' and 'default' had the same contents, in any English locale the 'default' table was never hit, so this won't make any difference for the texts being chosen.

Last but not least, wminfo has been made a local variable in G_DoCompleted. There were two places where this was accessed from outside the summary screen or its setup code, and both were incorrect.
2019-02-15 00:29:24 +01:00
Christoph Oelckers
44c8c2a79c - added German Umlauts for the BigFont and fixed the character substitution logic.
For pure uppercase fonts it makes no sense to try a lowercase substitution as a first step.
2019-02-17 23:18:28 +01:00
Christoph Oelckers
45d75745f0 - reworked console font loading to use the glyph sheets directly and allowing to load more than one per font. 2019-02-17 19:15:57 +01:00
Christoph Oelckers
95e62e91bb - split the FFont base class into its own file. 2019-02-17 13:50:57 +01:00
Christoph Oelckers
0963156c0a - did a bit of fine tuning to the character replacement mappings:
* prefer accent-less lower case over uppercase letters if an accented lower case letter cannot be found.
* added accent-less mappings for Latin Extended 1 (0x100-0x17f) and some easy to handle characters between 0x200 and 0x220. This should allow to display all Eastern European text without empty gaps for missing letters.
2019-02-17 13:41:04 +01:00
Christoph Oelckers
9102fb86a5 - moved FSpecialFont to its own file. 2019-02-17 12:53:12 +01:00
Christoph Oelckers
1f0c01459a - split FSinglePicFont into its own file. 2019-02-17 12:29:08 +01:00
Christoph Oelckers
7f1f25d998 - split the FSingleLumpFont class into its own file. 2019-02-17 12:00:04 +01:00
Christoph Oelckers
9dfffb6697 - moved font code into a subdirectory. 2019-02-17 11:43:04 +01:00
Christoph Oelckers
78d0fa9269 - fixed Windows startup.
* the window class name was still ASCII, thanks to some totally pointless and ultimately dangerous type cast to LPCTSTR which rendered all type checks ineffective.
* use wWinMain instead of WinMain so that a Unicode argv gets created. For whatever reason, the ANSI startup leaves this variable empty.
* added a 'disablecrashlog' CCMD for Windows. It is a lot more useful with a debugger present to get the standard crash notification from the system which allows opening a debugger than the crash log and no option to open a debugger.
2019-02-17 10:10:41 +01:00
Christoph Oelckers
f512f29270 - fixed crash log display.
This still contained pieces where a multibyte string was passed through SendMessage and WM_SETTEXT. All these have been replaced with SetWindowTextW.
This commit also removes the never used crash log upload code and all associated assets because it is extremely unlikely that such a feature will ever be implemented.
2019-02-17 08:50:49 +01:00
Christoph Oelckers
d39a624942 - fixed the player name display.
This was broken by several small unicode-incompatible code fragments.
This commit also removes the input limit for the player name and the savegame description. With multibyte encoding, limiting them to a fixed length did not work right.
Currently these will just overflow the fields if the text becomes too long, this needs some additional work.
2019-02-16 22:57:02 +01:00
Christoph Oelckers
deb233677e - made the menu's text input handler Unicode capable.
Also make sure that the savegame description remains readable. Unlike in-game text this can be done without double-encoding existing UTF-8.
2019-02-16 21:29:46 +01:00
Christoph Oelckers
54cb16ad8e - made the chat input Unicode-capable.
Also changed this to use the console font because it is far better equipped with special characters than the small font.
2019-02-16 18:49:38 +01:00
Christoph Oelckers
d15e3391a0 Merge remote-tracking branch 'remotes/origin/master' into localization
# Conflicts:
#	src/v_font.cpp
2019-02-16 17:35:15 +01:00
Major Cooke
32e65ff11d Pass the target as the source for active damage modifiers (i.e. PowerDamage) instead of the actual source.
- Getting the victim would be impossible otherwise, and passing in the original source is redundant when there's already the owner.
2019-02-16 17:26:21 +01:00
alexey.lysiuk
3864ed78e0 - fixed: offsets got lost in font's translated textures
https://forum.zdoom.org/viewtopic.php?t=63667
2019-02-16 17:26:02 +01:00
Rachael Alexanderson
35e2d40641 Squashed commit of the following:
- Implement page string names for dialog lumps
    - Create special new GZDoom name space for ZSDF
    - add usdf_gzdoom spec document
    - fixed: restored original behavior with negative conversation id's for the original strife dialog lumps
    - reposition the binary strife fix in a more appropriate location
    - add compatibility fix for negative numbers in responses in USDF/ZSDF (don't know if it's actually necessary)
2019-02-16 17:25:23 +01:00
Robert Cochran
07e0323771 Add handling of left and right mousewheel events to the SDL2 input path 2019-02-16 17:23:14 +01:00
Rachael Alexanderson
0fc4640cc9 - fix building in 32 bit windows 2019-02-16 11:12:10 -05:00
Rachael Alexanderson
9f62289507 Merge branch 'master' of https://github.com/coelckers/gzdoom into localization 2019-02-16 10:50:49 -05:00
Christoph Oelckers
64685705d0 - made the console Unicode-capable.
This also necessitated some character remapping in the console font to move the Windows-1252 extra characters to their proper Unicode code points.
2019-02-16 13:05:19 +01:00
Christoph Oelckers
8018ebfab5 - use the Unicode version of Windows's clipboard functions. 2019-02-16 09:50:00 +01:00
Christoph Oelckers
b4d96aaef9 - made Windows backend parts of the console Unicode capable. 2019-02-15 22:05:26 +01:00
Major Cooke
823eb90af8 - Fixed monsters waking up even if all the damage was absorbed without pain causing flags
- Fixed FORCEPAIN not overriding PainThreshold property
2019-02-15 18:57:34 +01:00
alexey.lysiuk
769be00483 - fixed automap marks placement with custom fonts
Automap rotation wasn't taken into account when drawing marks

https://forum.zdoom.org/viewtopic.php?t=63693
2019-02-15 17:21:59 +02:00
Christoph Oelckers
9fba9eee18 Merge branch 'localization' of https://github.com/coelckers/gzdoom into localization 2019-02-15 10:20:14 +01:00
Christoph Oelckers
c49665684b - fixed DHudMessageTypeOnFadeOut's character counter to be UTF-8 compatible.
This was reading the string by byte and not by character and could end up printing incomplete UTF-8 data.
2019-02-15 08:52:56 +01:00
Christoph Oelckers
340d7bce8d - added some character counting utilities to FString. 2019-02-15 08:51:41 +01:00
Christoph Oelckers
868ac5adf8 - switched the Windows backend to use the Windows Unicode API.
With localization for non-Latin languages on the support list the multibyte API doesn't cut it anymore. It neither can handle system text output outside the local code page nor can an ANSI window receive text input outside its own code page.
Similar problems exist for file names. With the multibyte API it is impossible to handle any file containing characters outside the active local code page.

So as of now, everything that may pass along some Unicode text will use the Unicode API with some text conversion functions. The only places where calls to the multibyte API were left are those where known string literals are passed or where the information is not used for anything but comparing it to other return values from the same API.
2019-02-14 22:23:33 +01:00
Christoph Oelckers
5f574033b5 pass full Unicode characters to EV_GUI_Char for Linux and macOS.
The Linux backend looked like it didn't handle anything non-ASCII at all, but this all needs to be tested.
Windows will be a bit more work because it requires using the Unicode API for creating the main window.
2019-02-14 14:29:49 +01:00
Rachael Alexanderson
0d2a24876b - Remove "gitversion.h" from "version.h" - should result in faster compiles after a commit in Windows
- Fix zdoom.rc to show the actual git commit tag and id for the Product Version
- Made zdoom.rc "codepage 1252" compliant as dictated by the #pragma (if this needs changed the pragma should be updated, this was messing up the version strings in the final compile)
2019-02-13 21:34:44 -05:00
alexey.lysiuk
be6ce43045 - added ability to customize font of automap marks
Set am_markfont CVAR to a desired font name
Use am_markcolor to select a text color, has no effect with the default font, AMMNUMx
2019-02-13 21:47:53 +01:00
Christoph Oelckers
8efc3188b9 - fixed map name setup
This was broken when localization for Hexen was added.
2019-02-13 00:47:03 +01:00
Christoph Oelckers
ef050d700c - Fixed loading of folder based fonts and added a config lump per font.
This is done by putting a font.inf file into the folder.
Current options are "Kerning", "Scale", "FontHeight" and "SpaceWidth"
2019-02-13 00:02:39 +01:00
Christoph Oelckers
e526cebc8e Merge remote-tracking branch 'origin/master' into localization 2019-02-12 00:20:00 +01:00
Christoph Oelckers
0b8fb3ac1a - cleanup of font init to have less special cases
To make things easier, DBIGFONT, SBIGFONT and HBIGFONT will now be renamed in the lump directory to make things a bit easier to handle.

Another change is to make font folders atomic units to prevent cross-pollution between incompatible fonts. The only exception to this are the def* folders because they need to piece together their fonts from both zd_extra.pk3 and the IWADs.
2019-02-12 00:19:44 +01:00
alexey.lysiuk
d4d010ac32 - added compatibility flag for buggy CheckSwitchRange behavior
https://forum.zdoom.org/viewtopic.php?t=63008
https://forum.zdoom.org/viewtopic.php?t=63650
2019-02-11 17:57:03 +01:00
Christoph Oelckers
fe981c68d3 - changed font loader to detect fonts in folders and to find all default fonts in folders. 2019-02-11 01:58:51 +01:00
Christoph Oelckers
e4690b4cd8 - exported all Hexen map names and intermission texts to the language table.
As IWAD content this is in zd_extra.pk3.
2019-02-11 01:33:09 +01:00
Christoph Oelckers
6d19374ae8 Only replace Strife dialogue content if the default strings from zd_extra.pk3 are present.
If not, use the dialogue file's content directly.
2019-02-11 00:46:13 +01:00
Christoph Oelckers
af5a2fe522 - removed the ActiveSequences counter.
It was only used to avoid traversing the list if all sequences were paused which is an exceptional situation.
On the other hand, the way it counted was not correct so rather than fixing it it seemed more appropriate to remove it entirely.
2019-02-10 20:30:40 +01:00
Christoph Oelckers
5e6a96d021 - fixed path of texture directory. 2019-02-10 14:08:27 +01:00
Christoph Oelckers
993a16787c - removed the special exception for those weird "No..." messages and moved the only one that isn't garbage to the language lump. 2019-02-10 09:59:05 +01:00
Christoph Oelckers
e57b16b9e7 - exported the character names of Strife's dialogues. 2019-02-09 13:15:30 +01:00
Christoph Oelckers
b1820039d7 - exported Strife's log texts to the string table.
This is dpne as a two-stage approach. TXT_LOGTEXTxxx will always take precedence over the log lumps, and TXT_ILOGxxx will only replace the original IWAD content.
This is so that PWADs replacing these lumps don't get overridden by the default texts.
2019-02-09 12:52:50 +01:00
Christoph Oelckers
88e227f1f3 Merge branch 'new_level_refactor' into localization 2019-02-09 12:22:15 +01:00
Christoph Oelckers
59954fa4f9 - fixed accidentally duplicated variable name in ChangeLevel function. 2019-02-09 12:07:30 +01:00
Christoph Oelckers
4642df3052 - fixed dropoff checks for portals and 3D floors in the same sector. 2019-02-09 10:39:08 +01:00
Christoph Oelckers
3d3f260137 - exported LevelLocals's compatibility flags to scripting and fixed all places where access to combined compatibility flags is needed. 2019-02-09 09:17:57 +01:00
Christoph Oelckers
8a28134254 Merge remote-tracking branch 'remotes/origin/master' into new_level_refactor 2019-02-09 08:47:07 +01:00
Christoph Oelckers
a5feff7aa0 - fixed: The level's local event manager wasn't fully taken down when freeing the level's data. 2019-02-09 08:46:48 +01:00
Major Cooke
acc510dfb3 Added inflictor, source and flag parameters to GetModifiedDamage on actors and ModifyDamage on inventory.
- The flags are used by DamageMobj so modders can determine radius damage, for example, by checking for DMG_EXPLOSION.
2019-02-08 20:07:49 +01:00
Major Cooke
1b97bae307 Added Z + camera roll relativity for A_QuakeEx's QF_RELATIVE flag. 2019-02-08 20:07:27 +01:00
Christoph Oelckers
449610496f - fixed: 'level.frozen' still needs to be writable and have an effect. 2019-02-08 20:04:45 +01:00
Christoph Oelckers
584dae85f4 - fixed: LEVEL_USEPLAYERSTARTZ was checked on the wrong variable. 2019-02-08 19:58:15 +01:00
Christoph Oelckers
0b2494f9ca - fixed: The global viewpoint's Level member was accessed before it was set.
All affected code needs to get a Level parameter passed in through its arguments.
2019-02-08 13:12:46 +01:00
Christoph Oelckers
bd1f5d9750 - start the HUD message ticker at -1 to compensate for the additional tick they now receive due to the change at which time the status bar gets ticked. 2019-02-08 08:58:16 +01:00
Christoph Oelckers
bcc1aa95b2 - fixed: ACS calls need to explicitly pass the level into COPY_AAPTR.
Unlike from an action function, this can be called with a null actor, which for the player constants still needs to return something valid.
2019-02-07 15:41:35 +01:00
Christoph Oelckers
c0bbb4fd0d - fixed lowercase handling of non-basic-latin characters and added Undead's Russian translation.
The added table may be overkill but this way the font engine is prepared for things to come.
Currently the text placement in the menu seems a bit broken, that's a task for later.
2019-02-07 13:49:54 +01:00
Christoph Oelckers
4d2bb11317 - reworked font loader to make adding multi-lump fonts easier.
A multi-lump font can be created by putting all characters into a subdirectory of fonts/ with the intended name. Each character needs to be named by its character index as hex number.
So far this is only active for the predefined small fonts
2019-02-07 13:12:39 +01:00
Christoph Oelckers
eec53a6670 - print more meaningful info in countdecals CCMD. 2019-02-07 09:39:37 +01:00
Christoph Oelckers
4cdbc99877 - fixed creation of phased light sequences. 2019-02-07 09:39:36 +01:00
Christoph Oelckers
9dec214c15 - properly un-count faded out decals without involving the Destroy method. 2019-02-07 09:39:36 +01:00
Christoph Oelckers
97e3e858a1 - re-count impact decals each time a savegame is loaded.
This counter is not always reliable, especially when running for longer periods, so putting it in a savegame is not a good idea.
2019-02-07 09:39:36 +01:00
Rachael Alexanderson
4f0850b098 Merge remote-tracking branch 'origin/new_level_refactor' into HEAD 2019-02-06 10:30:27 -05:00
Christoph Oelckers
74d34f6171 - fixed typo in ExitPic display.
It read the EnterPic instead.
2019-02-06 15:40:49 +01:00
Christoph Oelckers
f38060d01b - fixed: The static event manager never got a link to the primary level. 2019-02-06 15:40:49 +01:00
Rachael Alexanderson
0590de3be2 Merge remote-tracking branch 'origin/new_level_refactor' into HEAD 2019-02-06 08:05:45 -05:00
Rachael Alexanderson
20a9587bb7 Merge remote-tracking branch 'origin/master' into HEAD 2019-02-06 08:05:38 -05:00
Christoph Oelckers
495298079b - rewrote the language table so that it doesn't have to reload everything on a language change.
It now reads everything into a two-dimensional TMap and creates a list of mappings that apply to the current setting.
The constant need for reloading was the main blocker in redesigning how Dehacked strings get inserted. Currently they override everything, but IWAD-based Dehacked text shouldn't block PWAD overrides from PWADs' LANGUAGE lumps and instead be treated as coming from an [en default] block.

This also renames the main block from [enu default] to [en default], because it should be treated as the English default for all English locales and not just make it fall through to the base default as it did before.
2019-02-06 13:59:41 +01:00
alexey.lysiuk
37a79470de - fixed compilation on POSIX targets
src/p_acs.cpp:3250:75: error: cannot pass object of non-trivial type 'FString' through variadic constructor; call will abort at runtime [-Wnon-pod-varargs]
src/p_conversation.cpp:354:56: error: cannot pass object of non-trivial type 'FString' through variadic constructor; call will abort at runtime [-Wnon-pod-varargs]
src/p_conversation.cpp:438:51: error: cannot pass object of non-trivial type 'FString' through variadic constructor; call will abort at runtime [-Wnon-pod-varargs]
src/p_conversation.cpp:548:58: error: cannot pass object of non-trivial type 'FString' through variadic constructor; call will abort at runtime [-Wnon-pod-varargs]
src/p_conversation.cpp:572:59: error: cannot pass object of non-trivial type 'FString' through variadic constructor; call will abort at runtime [-Wnon-pod-varargs]
src/p_conversation.cpp:584:58: error: cannot pass object of non-trivial type 'FString' through variadic constructor; call will abort at runtime [-Wnon-pod-varargs]
2019-02-06 12:22:05 +02:00
alexey.lysiuk
78c0b7f230 - changed type of Nop expression to void
Control flow statements with constant condition no longer cause misleading fatal errors in ZScript

https://forum.zdoom.org/viewtopic.php?t=63566
2019-02-06 12:09:14 +02:00
Christoph Oelckers
7fa3081581 - fixed some remaining issues with the interpolator.
Thanks to the lazy counter it used in its stat display I never noticed that the serializer was incomplete and that UnlinkFromMap did not call its super method.
After changing the counter to be actively counting on each call, all the other issues became immediately apparent.
2019-02-06 10:44:30 +01:00
Christoph Oelckers
6ae9df6a23 - removed an old comment that no longer applied to the code in question.
The interpolator had been changed long ago to use proper GC tracking, so interpolations only can get collected if they had been fully orphaned.
This comment was the main reason why the design flaw in this code never got fixed until recently.
2019-02-06 09:38:17 +01:00
Christoph Oelckers
c25e7897a7 - fixed bad default initialization of BoundingRect's coordinates. 2019-02-06 09:25:45 +01:00
Christoph Oelckers
5a2d6de296 - split up the OnDestroy method of interpolations.
It seems there can be rare conditions where an interpolation is 'lost' and later garbage collected. If that happens after the owning map is gone, all pointers in the interpolation object will be invalid and Destroy would crash while trying to unlink it. So anything that explicitly deletes an interpolation now has to manually unlink it from the map first so that OnDestroy can be kept clean of map references.
2019-02-05 18:34:02 +01:00
Christoph Oelckers
979f1df281 Merge remote-tracking branch 'remotes/origin/master' into new_level_refactor
# Conflicts:
#	src/g_level.cpp
#	src/p_user.cpp
2019-02-05 13:49:07 +01:00
Christoph Oelckers
0936a2fa19 - exported all texts from Strife's dialogues to the string table.
Now all this content can be localized. However, since this is actual game content it was placed in a secondary file in zd_extra.pk3, so that it won't affect the GPL-compatible status of the main one.
2019-02-05 13:39:38 +01:00
Christoph Oelckers
c0e4ef159b - fixed display of "Find help" text in Strife. Also moved this piece of code to a place where a real player exists. This was set at a point where the map wasn't loaded yet which caused a few problems. 2019-02-05 13:34:49 +01:00
alexey.lysiuk
69492b1e27 - fixed ambient sounds "leaking" into reverb environment
Set speed of sound to 343.3 and init scale to 1 according to @kcat suggestion

https://forum.zdoom.org/viewtopic.php?t=63185
https://forum.zdoom.org/viewtopic.php?t=63524
2019-02-05 13:13:52 +02:00
Christoph Oelckers
ce22f1db51 - fixed: SendPitchLimits is not playsim code so it cannot use the PlayerPawn for anything.
This really needs to operate solely on the static players array.
2019-02-05 11:54:29 +01:00
Christoph Oelckers
546d3d1bf5 - allow localization of Hexen's original ACS strings.
This way of looking up strings is intentionally limited to content from Hexen.wad and Hexdd.wad.
2019-02-05 11:51:19 +01:00
alexey.lysiuk
c026b991ae - do not print initial player's log text on loading of saved game 2019-02-05 12:00:16 +02:00
alexey.lysiuk
7a46d6e9cd - fixed output of localized player's log text to console 2019-02-05 11:56:20 +02:00
Christoph Oelckers
26acd564fb - restored order of destruction of interpolations and thinkers, which got accidentally reversed. 2019-02-04 16:27:57 +01:00
alexey.lysiuk
8892cb619d - disabled usage of intrinsics on non-Intel platforms 2019-02-04 15:53:41 +02:00
alexey.lysiuk
2765159fc6 - disabled VM JIT completely on unsuported platforms 2019-02-04 15:53:35 +02:00
Christoph Oelckers
e41c898817 Merge branch 'master' into new_level_refactor 2019-02-04 13:11:01 +01:00
Christoph Oelckers
496eba3acb - fix polyobject init 2019-02-04 13:10:53 +01:00
Christoph Oelckers
af9636b7c3 - fixed glitches with some poorly set up sector stack portals. 2019-02-04 13:08:30 +01:00
alexey.lysiuk
20f29ab808 - fixed erroneous removal of property flag members
https://forum.zdoom.org/viewtopic.php?t=63520
2019-02-03 12:33:06 +02:00
alexey.lysiuk
8137162ca0 - fixes compilation of POSIX targets
src/posix/cocoa/i_input.mm:95:22: error: use of undeclared identifier 'E_CheckUiProcessors'
src/posix/cocoa/i_input.mm:200:21: error: use of undeclared identifier 'E_CheckRequireMouse'
src/posix/sdl/i_input.cpp:183:19: error: use of undeclared identifier 'E_CheckUiProcessors'
src/events.cpp:540:1: error: pasting formed '::RenderFrame', an invalid preprocessing token
src/events.cpp:541:1: error: pasting formed '::WorldLightning', an invalid preprocessing token
src/events.cpp:542:1: error: pasting formed '::WorldTick', an invalid preprocessing token
src/events.cpp:543:1: error: pasting formed '::UiTick', an invalid preprocessing token
src/events.cpp:544:1: error: pasting formed '::PostUiTick', an invalid preprocessing token
2019-02-03 11:19:17 +02:00
Christoph Oelckers
53162a8a5c Merge branch 'master' into new_level_refactor
# Conflicts:
#	src/am_map.cpp
2019-02-03 09:20:13 +01:00
Christoph Oelckers
2fd1276d28 - fixed: Instead of mapping Hexen's BLANK texture to the null texture, make its actual use type that of a null texture.
The software renderer does not have any safeguards against such a mapping and crashes on it.
This code was a quick hack from ancient times from when ZDoom did not have robust texture management and some recent changes ran afoul of this very special exception.
2019-02-03 08:59:37 +01:00
Christoph Oelckers
2cff43ba90 - fixed: The HUD model code did not account for placeholder sprites. 2019-02-03 08:23:18 +01:00
Alexander
03a2b9dc2e added am_showkeys_always 2019-02-02 17:54:00 +01:00
Christoph Oelckers
9f7fe203fc - had to fix a few things. 2019-02-02 17:29:13 +01:00
Christoph Oelckers
1dbbb56a1b Merge branch 'master' into new_level_refactor
# Conflicts:
#	src/p_user.cpp
2019-02-02 16:58:30 +01:00
Christoph Oelckers
235c4c0499 - allow localization of Strife's log text. 2019-02-02 16:56:58 +01:00
Christoph Oelckers
64476cde7e - fixed: Retriving a key's color did not work. 2019-02-02 16:52:28 +01:00
Christoph Oelckers
66eb4e5048 - separation of static and map-local event handlers into separate lists.
Having everything lumped together made this a maintenance hassle because it affected how the level has to be stored.
This hasn't been tested yet, so it may not work as intended!
2019-02-02 16:43:11 +01:00
Christoph Oelckers
d005e0b483 - changed the place where the CheckRequireMouse event gets called.
The original place in I_CheckNativeMouse is unsafe because that function can get called from the system message queue which can result in a bad global state of the VM for such a call because it can be recursively invoked from code that may temporarily alter some settings.
2019-02-02 11:00:26 +01:00
Nemrtvi
fa53ae21e6 Localized “FIND HELP” in Strife
The very first quest log that appears in Strife, “FIND HELP”, is located in a source file. This moves it to the language files.
2019-02-02 10:57:14 +01:00
Christoph Oelckers
484485f3cf - made the event manager an object so it can be instantiated multiple times. 2019-02-02 10:46:34 +01:00
Christoph Oelckers
8d83f03138 - changed the linedef translator into a struct and reorganized its storage to allow having different ones at the same time.
This was the last piece of data that couldn't be distinct for more than one level.
2019-02-02 01:22:12 +01:00
Christoph Oelckers
45dc9a7b47 - renamed the level variables.
currentUILevel is now primaryLevel.
For ZScript, currentVMLevel was added. This is also exported as 'level' and will change as needed.
This also means that no breaking deprecations will be needed in the future, because in order to sandbox a level only 4 variables need to be handled: level, players, playeringame and consoleplayer.
The remaining global variables are not relevant for the level state.

The static 'level' has been mostly removed from the code except some places that still need work.
2019-02-02 00:25:51 +01:00
Christoph Oelckers
6c006a5fbd - added the missing Level parameters to AActor::StaticSpawn and P_ExecuteSpecial.
I think these were the last two still missing it, all remaining uses of the global level variable are in code that doesn't get run through a level tick and are supposed to access the primary level.
2019-02-01 22:02:16 +01:00
Christoph Oelckers
bf665961cc - moved KEYCONF_only CCMDs out of play files. 2019-02-01 21:19:16 +01:00
Christoph Oelckers
32e5be83ea - moved a few more files and copied the data related parts of p_things.cpp to g_doomedmap.cpp 2019-02-01 19:48:17 +01:00
Christoph Oelckers
a1cc548af4 - moved some more code into the gamedata folder.
Two files were split:

g_level.h contained both the game data definitions and some prototypes belonging to the game logic. These were split up.
decallib.cpp contained both the data and the animation thinkers. The thinkers are now in their own file.
2019-02-01 19:20:58 +01:00
Christoph Oelckers
db77ed79cd - moved the resourcefiles and textures folders into gamedata. 2019-02-01 18:31:57 +01:00
Christoph Oelckers
c1e1284b52 - moved the CCMDs out of a_pickups.cpp. 2019-02-01 18:15:49 +01:00
Christoph Oelckers
3f90764faa - moved the contents of g_inventory to g_shared and gamedata subfolders.
a_pickups only contains a few native remains of the inventory code and the other two only the static data maintenance for their items.
2019-02-01 18:13:12 +01:00
Christoph Oelckers
edb34b9f7f Merge remote-tracking branch 'remotes/origin/master' into new_level_refactor 2019-02-01 17:59:25 +01:00
alexey.lysiuk
5e9001e7bc - fixed potentially incomplete list of argument flags for virtual function
https://forum.zdoom.org/viewtopic.php?t=63450
2019-02-01 17:58:06 +01:00
Christoph Oelckers
202f3d7d80 - changed most places where a player index is calculated by subtracting the player array's base access. 2019-02-01 17:31:11 +01:00
Christoph Oelckers
d358e401ee - removed all access to the consoleplayer variable from the play code
There is one exception in ACS for a net arbitrator check.
Aside from this the bot_observer CVAR was also removed. This was never implemented properly and could stomp upon custom player settings.
2019-02-01 17:02:10 +01:00
Christoph Oelckers
2903025268 - a few minor fixes. 2019-02-01 12:31:08 +01:00
Christoph Oelckers
de24fc2c88 - do not call renderer code directly to reset the view interpolation
The playsim really has no idea what the renderer is supposed to do here and the current system has some serious issues that eventually need addressing. So it is better to just set a flag that an actor needs to have its view interpolation reset if being used as a camera and let the render code deal with it.

This will keep the playsim clean of future changes to this feature.
2019-02-01 12:03:36 +01:00
alexey.lysiuk
5278274acf - fixed compilation errors with POSIX targets
src/posix/cocoa/i_video.mm:559:2: error: use of undeclared identifier 'atterm'
src/posix/sdl/hardware.cpp:85:28: error: ‘atterm’ was not declared in this scope
src/posix/sdl/i_input.cpp:261:10: error: ‘gamestate’ was not declared in this scope
src/posix/sdl/i_input.cpp:261:23: error: ‘GS_LEVEL’ was not declared in this scope
src/posix/sdl/i_input.cpp:263:48: error: ‘GS_INTERMISSION’ was not declared in this scope
src/posix/sdl/i_input.cpp:263:80: error: ‘GS_FINALE’ was not declared in this scope
src/posix/sdl/i_system.cpp:115:25: error: ‘atterm’ was not declared in this scope
src/posix/sdl/i_system.cpp:372:30: error: invalid use of incomplete type ‘const struct dirent’
src/posix/sdl/i_system.cpp:375:42: error: ‘findstate_t’ has not been declared
src/posix/sdl/i_system.cpp:391:12: error: request for member ‘current’ in ‘* fileinfo’, which is of non-class type ‘int’
src/posix/sdl/i_system.cpp:392:12: error: request for member ‘count’ in ‘* fileinfo’, which is of non-class type ‘int’
src/posix/sdl/i_system.cpp:392:56: error: request for member ‘namelist’ in ‘* fileinfo’, which is of non-class type ‘int’
src/posix/sdl/i_system.cpp:393:22: error: ‘alphasort’ was not declared in this scope
src/posix/sdl/i_system.cpp:393:31: error: ‘scandir’ was not declared in this scope
src/posix/sdl/i_system.cpp:394:16: error: request for member ‘count’ in ‘* fileinfo’, which is of non-class type ‘int’
src/posix/sdl/i_system.cpp:401:31: error: ‘findstate_t’ has not been declared
src/posix/sdl/i_system.cpp:403:2: error: ‘findstate_t’ was not declared in this scope
src/posix/sdl/i_system.cpp:403:15: error: ‘state’ was not declared in this scope
src/posix/sdl/i_system.cpp:403:37: error: expected primary-expression before ‘)’ token
src/posix/sdl/i_system.cpp:404:33: error: request for member ‘count’ in ‘* fileinfo’, which is of non-class type ‘int’
src/posix/sdl/i_system.cpp:406:39: error: request for member ‘count’ in ‘* fileinfo’, which is of non-class type ‘int’
src/posix/sdl/i_system.cpp:413:2: error: ‘findstate_t’ was not declared in this scope
src/posix/sdl/i_system.cpp:413:15: error: ‘state’ was not declared in this scope
src/posix/sdl/i_system.cpp:413:37: error: expected primary-expression before ‘)’ token
src/posix/sdl/i_system.cpp:425:16: error: ‘findstate_t’ was not declared in this scope
src/posix/sdl/i_system.cpp:425:29: error: expected primary-expression before ‘const’
src/posix/sdl/i_system.cpp:426:1: error: expected ‘,’ or ‘;’ before ‘{’ token
src/posix/sdl/i_main.cpp:160:6: error: ‘gamestate’ was not declared in this scope
src/posix/sdl/i_main.cpp:160:19: error: ‘GS_LEVEL’ was not declared in this scope
src/posix/sdl/i_main.cpp:160:44: error: ‘GS_TITLELEVEL’ was not declared in this scope
src/posix/sdl/i_main.cpp:217:18: error: ‘atterm’ was not declared in this scope
src/posix/sdl/i_main.cpp:242:11: error: ‘I_Quit’ was not declared in this scope
src/gameconfigfile.cpp:126:27: error: ‘SHARE_DIR’ was not declared in this scope
src/scripting/decorate/thingdef_parse.cpp:929:2: error: use of undeclared identifier 'strlwr'; did you mean 'strlen'?
src/scripting/decorate/thingdef_parse.cpp:937:3: error: use of undeclared identifier 'strlwr'; did you mean 'strlen'?
src/scripting/decorate/thingdef_states.cpp:564:2: error: use of undeclared identifier 'strlwr'; did you mean 'strlen'?
src/scripting/vm/jit_runtime.cpp:957:2: error: ‘unique_ptr’ is not a member of ‘std’
src/scripting/vm/jit_runtime.cpp:957:38: error: expected primary-expression before ‘>’ token
src/scripting/vm/jit_runtime.cpp:957:40: error: ‘nativeSymbols’ was not declared in this scope
src/utility/cmdlib.cpp:962:2: error: ‘DIR’ was not declared in this scope
src/utility/cmdlib.cpp:962:7: error: ‘directory’ was not declared in this scope
src/utility/cmdlib.cpp:962:34: error: ‘opendir’ was not declared in this scope
src/utility/cmdlib.cpp:967:33: error: ‘readdir’ was not declared in this scope
src/utility/cmdlib.cpp:969:10: error: invalid use of incomplete type ‘struct ScanDirectory(TArray<FFileList>&, const char*)::dirent’
src/utility/cmdlib.cpp:973:34: error: invalid use of incomplete type ‘struct ScanDirectory(TArray<FFileList>&, const char*)::dirent’
src/utility/cmdlib.cpp:985:20: error: ‘closedir’ was not declared in this scope
2019-02-01 11:08:58 +02:00
alexey.lysiuk
e400137ffe - fixed compilation of Windows Debug targets
src\sound\mididevices\music_opl_mididevice.cpp(112): error C3861: 'I_DebugPrint': identifier not found
src\sound\mididevices\music_opl_mididevice.cpp(206): error C3861: 'I_DebugPrint': identifier not found
src\sound\mididevices\music_opl_mididevice.cpp(234): error C3861: 'I_DebugPrint': identifier not found
src\sound\mididevices\music_opl_mididevice.cpp(244): error C3861: 'I_DebugPrint': identifier not found
2019-02-01 10:09:36 +02:00
Christoph Oelckers
ba451b46c8 - moved a bunch of files to the utility folder. 2019-02-01 01:18:32 +01:00
Christoph Oelckers
b77e83e0b9 - moved 15 more files to g_shared. 2019-02-01 00:48:21 +01:00
Christoph Oelckers
e3eaa5964d - removed v_video.h include from portals.h
This has no business in a play related file which also made no use of it.
2019-02-01 00:30:21 +01:00
Christoph Oelckers
18fb7fdd81 - moved some diagnostic CCMDs to g_dumpinfo.cpp. 2019-02-01 00:14:31 +01:00
Christoph Oelckers
5010e61309 - moved a few more play files free of global state references to g_shared. 2019-01-31 22:31:41 +01:00
Christoph Oelckers
65c2c318fb - prettification of p_teleport.cpp and some include cleanup. 2019-01-31 22:22:39 +01:00
Christoph Oelckers
ff903da19a Merge remote-tracking branch 'remotes/origin/master' into new_level_refactor 2019-01-31 20:43:24 +01:00
Christoph Oelckers
b40c709b66 - minor corrections. 2019-01-31 20:42:36 +01:00
Christoph Oelckers
7241072b16 - moved most utility code to a subdirectory.
Again no code changes.
2019-01-31 20:33:52 +01:00
Christoph Oelckers
89d607c9a6 - moved all rendering code into a common subdirectory.
No changes to the files themselves was made.
2019-01-31 19:58:17 +01:00
Christoph Oelckers
c77487dab8 - moved the menu.h include from oalsound.h to oalsound.cpp.
The menu is a very 'dirty' header, and forcing it to be pulled in with something entirely unrelated is not good - even though only two files include oalsound.h.
2019-01-31 19:44:04 +01:00
Christoph Oelckers
f6a91e1722 - moved the I_Error prototypes to doomerrors.h to avoid having to include the low level system header for this. 2019-01-31 19:38:04 +01:00
Major Cooke
b1c508fa6c Added CheckReplacee.
- Allows defining of what actor is replacing another for information.
- If multiple arachnotrons, a modder can attribute them as being a replacer of Arachnotron itself, allowing A_BossDeath and GetReplacee to work with it.
2019-01-31 19:05:44 +01:00
Christoph Oelckers
1dcdfec733 - Unload behavior with the map, not outside. 2019-01-31 17:58:18 +01:00
Christoph Oelckers
7b7334e245 - only activate lights if the light actor isn't dormant, and only create a new one if it doesn't already have one.
-
2019-01-31 09:01:02 +01:00
Christoph Oelckers
ddab2c3e78 - removed the playernum parameter from CheckLocalView
This was always used with 'consoleplayer' which really is the only thing making sense here. But this is a part of the global state which should be avoided in play code.

In particular, this makes no real sense in case of secondary maps where it should always return false.
2019-01-31 03:29:25 +01:00
Christoph Oelckers
7149d1d312 - added missing includes 2019-01-31 03:25:49 +01:00
Christoph Oelckers
0a781b9bbb - fixed: DInterpolation was unlinking itself from the wrong interpolator
The global one was just a leftover, the real one is on the current level.
2019-01-31 03:25:26 +01:00
Christoph Oelckers
65f3fec283 - copied a few more map information CCMDs to g_ccmd. 2019-01-31 03:03:56 +01:00
Christoph Oelckers
aa340145ac - moved the remaining thinker code to g_shared 2019-01-31 02:51:07 +01:00
Christoph Oelckers
4984bc8c5f - prettification of a few files 2019-01-31 02:50:12 +01:00
Christoph Oelckers
65a812e316 - moved the door thinkers into g_shared. 2019-01-31 02:38:39 +01:00
Christoph Oelckers
77f8dfeabf - fixed g_dumpinfo.cpp's includes 2019-01-31 02:38:23 +01:00
Christoph Oelckers
51581d018a - moved the hud message and alt hud code from g_shared to g_statusbar
This is where it really belongs, this was simply overlooked when the folder was split.
2019-01-31 02:31:57 +01:00
Christoph Oelckers
25d5b788f5 - reviewed and sorted out the remaining parts of g_shared 2019-01-31 02:27:54 +01:00
Christoph Oelckers
0b4862480e - fixed macOS compilation. 2019-01-31 02:05:33 +01:00
Christoph Oelckers
0f2938089d - started cleaning up the contents of the g_shared directory, starting with a_dynlight.cpp
This is supposed to be come the place where all pure play code should be placed, but for that all CVARs and CCMDs and other things that do not directly handle play data should be taken out to make code reviewing easier. These now get collected in two separate files, g_cvars.cpp and g_dumpinfo.cpp respectively.
The sole ZScript property in here has also been moved - to thingdef_properties.cpp.
2019-01-31 02:05:16 +01:00
Christoph Oelckers
18b8a03f05 - cleaned up the header list in maploader.cpp. 2019-01-31 01:23:06 +01:00
Christoph Oelckers
fa3312e2a9 - moved gamestate_t to g_game.h.
This made reviewing the code for accessing the global state hard, because the doomdef.h contains mainly constants, this particular item was the only thing in there that represents actual engine state.
2019-01-31 00:28:43 +01:00
Christoph Oelckers
c18a0e7736 - replaced DWORD_MAX with UINT_MAX globally.
This was the last remnant of ZDoom's old integer types.
2019-01-30 22:34:11 +01:00
Christoph Oelckers
0eb3b2abca Merge branch 'master' into new_level_refactor 2019-01-30 22:03:21 +01:00