Commit graph

132 commits

Author SHA1 Message Date
Christoph Oelckers
ff21cee842 - fixed: SBARInfo's Tick function was using actor references from its last Draw operation.
Between these two calls these can change so these need to be retrieved each time either Draw or Tick are called.
2019-04-28 22:53:06 +02:00
Christoph Oelckers
40ad9a2584 - allow localization of Strife's log text. 2019-04-27 13:37:44 +02:00
alexey.lysiuk
d8d290cd51 - fixed many compilation errors with GCC and Clang
# Conflicts:
#	src/dobjgc.h
2019-04-26 17:14:12 +02:00
Christoph Oelckers
251b096b48 - removed all remaining native parts of APlayerPawn.
Unlike the other classes, the places where variables from this class were accessed were quite scattered so there isn't much scriptified code. Instead, most of these places are now using the script variable access methods.
This was the last remaining subclass of AActor, meaning that class Actor can now be opened for user-side extensions.
2019-04-26 01:20:02 +02:00
Christoph Oelckers
99dd234d10 - exported all native components of APlayerPawn.
Only the class definition itself remains and needs to be taken care of.

# Conflicts:
#	src/g_statusbar/sbarinfo_commands.cpp
#	src/hu_scores.cpp
#	src/scripting/thingdef_data.cpp

# Conflicts:
#	src/actorinlines.h
#	src/hu_scores.cpp
2019-04-25 17:42:11 +02:00
Christoph Oelckers
8e376754fc - did some more lightening on the PlayerPawn class. 4 more properties and one native member function have been handled. 2019-04-25 17:34:47 +02:00
Christoph Oelckers
cb2e46a4fe - scriptified A_SkullPop and ObtainInventory.
These were the last relevant items to access PlayerPawn.InvFirst.
2019-04-25 17:34:43 +02:00
Christoph Oelckers
d54ef75311 - added missing null pointer check to SBarInfo's inventory bar drawer. 2019-04-25 13:03:42 +02:00
Christoph Oelckers
c0c5df0e6e - fixed: ST_FormatMapName did not clear the string it wrote to before appending text. 2019-04-17 15:11:17 +02:00
Christoph Oelckers
b8e1218645 Removed all remaining references to AInventory
What remains is the class definition and one single reference that will be scriptified.
2019-04-16 23:57:12 +02:00
Christoph Oelckers
b762c0f49c Removed more literal references to AInventory.
# Conflicts:
#	src/hwrenderer/scene/hw_drawinfo.cpp
#	src/v_draw.cpp
2019-04-16 23:57:07 +02:00
Christoph Oelckers
d173ad753f - started removing literal references of AInventory, so far only simple stuff. 2019-04-16 23:57:02 +02:00
Christoph Oelckers
fa2e2e78b4 - removed all direct access to AInventory's members.
We are getting closer to make class Inventory fully scripted.
2019-04-16 22:01:04 +02:00
Magnus Norddahl
82a0acbc19 - add bool and unsigned int to the allowed types
- fix one case where floats were used (the JIT always calls with doubles)
2019-04-16 22:00:57 +02:00
Magnus Norddahl
cd03a487fe - GetInventoryIcon must return an integer for it to work for VM native calls 2019-04-16 22:00:48 +02:00
Christoph Oelckers
59e0871f00 - fixed: The static variant of PClass::FindFunction may only be used for actual static variables. 2019-04-16 21:52:56 +02:00
Christoph Oelckers
c0686309fc - removed all direct references of AInventory::Owner and AInventory::Amount from the C++ code. 2019-04-16 21:52:53 +02:00
Christoph Oelckers
a2ffe6327b - took the last methods aside from Tick and Serialize out of AInventory.
# Conflicts:
#	src/g_inventory/a_pickups.cpp
#	src/g_inventory/a_pickups.h
2019-04-16 21:28:19 +02:00
Christoph Oelckers
a1615457ac - properly hook up the alt HUD with the status bar.
# Conflicts:
#	src/d_main.cpp
2019-04-16 19:09:14 +02:00
Christoph Oelckers
0d8975ed31 - scriptified the last components of the alternative HUD.
- moved the ALTHUDCF parser PClass::StaticInit, so that it gets done right after creating the actor definitions.

All left to do is not to reallocate the AltHud object for each frame but store it in a better suited place.

# Conflicts:
#	src/d_main.cpp

# Conflicts:
#	src/info.cpp
2019-04-16 19:03:43 +02:00
Christoph Oelckers
f509fdfdaa - scriptified and cleaned up the AltHUD's DrawCoordinates, DrawTime and DrawLatency functions.
Some backing functionality was moved elsewhere because scripting should not have access to low level system information.
2019-04-16 19:01:53 +02:00
Christoph Oelckers
081d0bbcca - moved ValidateInvFirst to the script side because this was one of the major functions that directly reference AInventory. 2019-04-16 18:45:52 +02:00
Christoph Oelckers
a614f2a81e - scriptified UseInventory and several functions using the already scriptified ones,
# Conflicts:
#	src/g_statusbar/sbar.h
2019-04-16 18:45:36 +02:00
Christoph Oelckers
057604a7b1 - added direct native variants to nearly all status bar function.
I skipped ValidateInvFirst because that one will have to be scriptified soon.
2019-04-16 18:44:49 +02:00
Christoph Oelckers
4049b56d50 - a bit of code reordering for adding direct native entry points.
- offloaded key list generation for alternative HUD to non-UI parts.

This change also revealed a problem with handling empty sprites in the key list so this got fixed, too.

# Conflicts:
#	src/g_shared/shared_hud.cpp
2019-04-16 18:17:05 +02:00
Christoph Oelckers
76ac8bf27c Direct native functions for SBarInfo
Mostly pointless because they all get used only once and aren't even virtual overrides, but I only realized this after everything was complete…
2019-04-16 15:26:13 +02:00
Christoph Oelckers
96e9dbd967 - removed all remaining native components of the weapon class. 2019-04-15 22:29:52 +02:00
Christoph Oelckers
309cc57504 - removed all direct access to AWeapon's members to prepare moving this class fully to the script side.
Disregarding UI-side and setup-related calls there's unfortunately still 6 places in the native game code which require direct access.
2019-04-15 22:29:43 +02:00
Christoph Oelckers
04cd432159 - a little bit of cleanup on some code that repeatedly accessed some fields in AWeapon and produced far too many search results when looking for this. 2019-04-15 22:29:17 +02:00
Christoph Oelckers
af4c37471e - took the weapon selection logic out of the WeaponSlots data and blocked all direct access to the weapon slots internals
This seriously needs to be independent from the data store and better abstracted. More work to come to move this to its proper place.

# Conflicts:
#	src/g_inventory/a_pickups.cpp
2019-04-15 21:59:05 +02:00
Christoph Oelckers
08059f718b - scriptified FilterCoopRespawnInventory. 2019-04-15 21:59:00 +02:00
Christoph Oelckers
9d126954d1 - removed the default parameter handling from all native script functions because it is no longer needed.
# Conflicts:
#	src/p_actionfunctions.cpp

# Conflicts:
#	src/hwrenderer/postprocessing/hw_postprocessshader.cpp
#	src/v_2ddrawer.cpp
2019-04-15 14:59:00 +02:00
alexey.lysiuk
bde980d5e8 - fixed potential crash when drawing status bar log
src/g_statusbar/shared_sbar.cpp:1133:34: warning: comparison of integers of different signs: 'unsigned int' and 'int'
[-Wsign-compare]
2018-11-02 13:31:41 +01:00
Christoph Oelckers
0dba8e4f4a - use a saner data structure to store the BrokenLines.
Calling the old method with a pointer to an array of unspecified length 'dirty' would be an understatement.
Now it uses a TArray to store the single elements

# Conflicts:
#	src/g_shared/hudmessages.cpp
#	src/v_font.cpp
2018-11-01 21:08:17 +01:00
Rachael Alexanderson
35bf70456a - fixed: attaching a new status bar to a player now calls 'setsizeneeded' - fixes an issue where the screen geometry is out of sync with the characteristics of the new status bar. 2018-10-20 21:22:24 +02:00
Christoph Oelckers
542da7425c Fixed: DBaseStatusBar::Draw did not use its ticFrac parameter when being called from scripts
Instead it directly went to the global viewpoint again which would be inconsistent.
2018-08-22 01:01:47 +02:00
Christoph Oelckers
0fd1909f2c - got rid of FNameNoInit and made the default constructor of FName non-initializing.
This setup has been a constant source of problems so now I reviewed all uses of FName to make sure that everything that needs to be initialized is done manually.
This also merges the player_t constructor into the class definition as default values.
2018-08-19 10:36:10 +02:00
drfrag666
65bed492a2 - Scale status bar to fullscreen by default. 2018-07-28 21:41:29 +02:00
alexey.lysiuk
1629b25bfb - added extra validation for status bar classes
Print a message when status bar class defined in GAMEINFO is missing or when it's not derived from BaseStatusBar
Validate internal status bar classes for basic consistency in Debug configuration

(cherry picked from commit 907ce777a3)
2018-06-29 14:02:04 +02:00
alexey.lysiuk
7425a73d90 - prevented crashes caused by inconsistent status bar
Incorrectly initialized or deliberately broken status bar could lead to integer division by zero and null pointer dereference

class BuggyStatusBar : DoomStatusBar
{
    override void Init()
    {
        // No super.Init()
    }
}

(cherry picked from commit 832de42c24)
2018-06-17 18:55:43 +02:00
alexey.lysiuk
2642cae3cd Fixed dangling links to garbage collected HUD message objects
https://forum.zdoom.org/viewtopic.php?t=60262
(cherry picked from commit 7a11be8615)
2018-05-09 12:31:39 +02:00
Christoph Oelckers
e89a598b31 - renamed FTexture's UseType flags and gave them a dedicated type.
This was done mainly to reduce the amount of occurences of the word FTexture but it immediately helped detect two small and mostly harmless bugs that were found due to the stricter type checks.
2018-03-25 20:26:16 +02:00
Marisa Kirisame
634a10db52 Adds "DI_MIRROR" flag to statusbar image drawing. Useful for rearview mirror camera textures, for example. 2018-03-24 00:29:50 +01:00
alexey.lysiuk
e51a1867df Added default values for BaseStatusBar.AttachMessage() arguments 2018-03-07 16:00:08 +02:00
Christoph Oelckers
bb16e34bf4 - exposed the HUD message interface to ZScript.
Note that this is just the bare abstract interface. It is up to content makers to define usable HUD message classes and optionally contribute them to the engine.
2018-03-01 11:45:19 +01:00
Christoph Oelckers
dd893b6a0c - split off the interface part of DHUDMessage into an abstract base class.
The purpose is to allow creating custom message types in ZScript.
2018-03-01 10:33:03 +01:00
Jameson Ernst
e8a7f00b9b Adjust FNF enum to fix FILLZEROS 2018-01-07 23:44:03 +01:00
alexey.lysiuk
2e33165edf Moved freeing of data stored in HUD message objects to OnDestroy() function
https://forum.zdoom.org/viewtopic.php?t=57163
2017-07-10 10:41:50 +03:00
Christoph Oelckers
1df7dc81e6 - fixed: The statusbar's MustDrawLog method was called with an incorrect number of parameters. 2017-06-03 19:44:22 +02:00
Christoph Oelckers
be2cfddb17 - handle the case where SBARINFO only contains a mugshot definition and fall back to the current statusbarclass if creating an SBARINFO-based statusbar fails. 2017-05-21 12:06:22 +02:00