Commit graph

85 commits

Author SHA1 Message Date
Christoph Oelckers
0160841dde - reverse the order of the texture list before resolving it.
Since this deletes the resolved elements one by one and needs to start at the front to ensure consistency, it is better to reverse the order so that the deletions take place at the end of the list which requires a lot less data movement.
On Total Chaos this slowed down texture setup to the point where the mod was basically unlaunchable.
2018-12-19 18:17:59 +01:00
Christoph Oelckers
2cf6d213e2 - fixed compile bugs 2018-12-12 01:27:04 +01:00
Christoph Oelckers
2e7bcf9e41 - implemented a proper texture composition cache.
This will mostly ensure that each patch used for composition is only loaded once and automatically unloaded once no longer needed.
So far only for paletted rendering, but the same logic can be used for true color as well.
2018-12-10 01:17:39 +01:00
Magnus Norddahl
5d052fc565 - fix compile errors 2018-11-29 19:32:08 +01:00
Christoph Oelckers
b8394b2f16 - fixed compilation warnings. 2018-11-29 20:11:28 +01:00
Christoph Oelckers
292cf93fa7 - fixed TArray's Append methods.
I mistakenly assumed that Grow would incease the array's reserved space.
2018-11-18 01:23:14 +01:00
Christoph Oelckers
16053c7cdb - build full argument lists for action function calls.
This uses one static global array to avoid frequent reallocations.
2018-11-16 20:38:52 +01:00
Christoph Oelckers
094afdfd5f - fixed: It may happen that a degenerate subsector ends up without any section or sector. Try to assign the best fit in such a case so that the relevant pointers are not null. 2018-11-11 09:33:40 +01:00
Christoph Oelckers
191f2d9d76 - use TArray and FString in resource file management. 2018-11-10 14:19:55 +01:00
Christoph Oelckers
3448749de6 - replaced a few temporary allocations with TArray and added a few convenience loader functions for this.
Amazingly with today's optimizers this creates code which is just as good as doing it all manually with the added benefit of being safer.
2018-11-10 11:56:18 +01:00
Christoph Oelckers
602ea8f723 - made some minor changes to TArray after finding out that "new int()" is not the same as "new int".
With parentheses this initializes to 0 which created needless initialization code in a few places.
2018-11-10 10:43:35 +01:00
Christoph Oelckers
ddc75f7ba5 - made the common render hacks functional again as separate render items. 2018-11-06 20:31:44 +01:00
Christoph Oelckers
625eb1e76a - FVertexBuilder's output looks correct now. 2018-11-05 21:11:54 +01:00
Christoph Oelckers
49bfdbef9f - create an intermediate structure between sectors and subsectors.
A section is a continuous part of a sector or in some case of several nearby continuous parts. For sectors with far away parts multiple sections will be created, especially when they lie in disjoint parts of the map.
This is mainly supposed to cut down on time for linking dynamic lights. Since they need to traverse subsectors to find all touching sidedefs a more coarse data structure that only contains the info needed for this is more suitable. In particular, this does not contain any intra-sector lines, i.e. those with both sides in the same sector.
2018-11-04 20:10:51 +01:00
Christoph Oelckers
e8eb8dd596 - store the wall render nodes as pointers, not as objects.
This is mainly for future-proofing because storing these as objects in an array not only has a negative impact when using multithreading due to longer blocking time for the threads but also makes it hard to cache this data for reuse.
2018-04-15 14:25:42 +02:00
Christoph Oelckers
c03024e1b0 - fixed last commit 2018-04-14 22:34:25 +02:00
Christoph Oelckers
71c8417578 - removed UniqueLineToLines because it wasn't used anywhere. 2018-04-14 21:24:48 +02:00
Christoph Oelckers
8080e039e0 - moved most of gl_setup.cpp to r_data as this is only some data setup in the main map data structures.
- made currentmapsections array something nicer to look at and made it a member of the scene drawer class.
2018-04-02 09:27:40 +02:00
Christoph Oelckers
1461059dae - moved contents of gl_templates.h to files outside of gl/ 2018-04-01 11:59:12 +02:00
alexey.lysiuk
61ead4f470 Better STL compatibility for array iterator
Extended iterator with types and functions required to use array objects in STL algorithms
2017-11-05 15:20:25 +02:00
Christoph Oelckers
fafc636476 - allow allocating constructor of TArray to also reserve the allocated data and use this to properly handle the precalc arrays for the texture resizer. 2017-11-03 17:27:32 +01:00
Christoph Oelckers
cdff5bdc08 - rewrite of the IWAD loading mechanism.
The old code went through a list of predefined file names and looked each of them up in a list of predefined directories until it found a match. This made it nearly impossible to add custom IWAD support because the list of valid file names could not be extended.
This has now been switched around to run a scan for matching files on each given directory. With this approach it can look for *.iwad and *.ipk3 as IWAD extensions as well and read an IWADINFO out of these files that can be added to the internal list of IWADs, making it finally possible to define custom IWADs without having to add them to the internal list.

(This isn't fully tested yet so some errors may still occur.)
2017-08-19 19:30:48 +02:00
Christoph Oelckers
ea1d6634f7 - moved the Zones array into FLevelLocals.
- replaced TStaticArray with regular TArrays.

They had incomplete implementations preventing proper cleanup of the level loading code. It makes more sense to add the missing methods to the regular TArray and use that.
This also makes some changes to how the game nodes are used to avoid creating a copy: If the head node's pointer is stored in a separate variable, no code needs to check which of the two arrays gets used.
2017-03-17 12:11:37 +01:00
Christoph Oelckers
309d086a15 - GCC complained about this part. 2017-03-17 10:16:04 +01:00
Christoph Oelckers
f201dab534 - moved the subsectors into FLevelLocals. 2017-03-17 00:22:52 +01:00
Christoph Oelckers
a4710bcdb0 - did a bit of header cleanup to reduce the dependency on dobject.h. 2017-03-09 23:30:42 +01:00
Christoph Oelckers
5ef9429ae4 - added the ability to attach a constructor or destructor to an internally defined struct.
There are a few which require explicit native construction or destruction that need to be exported to the VM, e.g. FCheckPosition.
The VM cannot handle this directly, it needs two special functions to be attached to handle such elements.
2017-01-11 23:46:03 +01:00
Christoph Oelckers
de4153ceaf some groundwork for the implementation of dynamic arrays
- created script exports for all relevant functions with all integral types.
- created script side definitions for the underlying data types.
- added a void pointer type so that the prototype for the pointer array can use a generic type every pointer can be assigned to.
2017-01-11 00:57:31 +01:00
Christoph Oelckers
12037fdc95 - made the vertexes array VM friendly. 2017-01-09 00:46:16 +01:00
alexey.lysiuk
e188047d70 Fixed compilation with GCC/Clang 2017-01-08 17:20:27 +02:00
Christoph Oelckers
5ee52f159e - refactored the level backup data needed by the serializer into p_saveg.h. 2017-01-08 12:11:31 +01:00
Christoph Oelckers
c02281a439 - refactored the global sectors array into a more VM friendly type and moved it into FLevelLocals. 2017-01-07 19:32:24 +01:00
alexey.lysiuk
2dec45ca39 Fixed compilation with GCC/Clang
Fixes #175
2017-01-03 09:45:53 +02:00
Christoph Oelckers
1a16f664e4 - added a TStaticArray class that allows safe access to resizable static data (like the sectors, linedefs, etc.) for the VM.
- used this to replace the line list in Sector because that gets already used and implemented proper bounds checks for this type of array.
2017-01-02 21:40:52 +01:00
Christoph Oelckers
810ef8f775 - save global savegame data to JSON as well.
This is incomplete and untested, just a safety commit before going on.
2016-09-21 12:19:13 +02:00
Christoph Oelckers
fd27c8db9e Merge branch 'master' into floatcvt
# Conflicts:
#	src/dobjtype.cpp
#	src/dobjtype.h
#	src/version.h
2016-04-04 01:21:24 +02:00
Randy Heit
7c8cff64e6 Added code to initialize and destroy string variables in classes
- Will require being able to add strings to non-native classes to actually
  test this.
2016-04-03 17:45:04 -05:00
Christoph Oelckers
330ca07f69 Merge branch 'master' into floatcvt 2016-04-03 22:11:50 +02:00
Braden Obrzut
81f29556bf - Refactored SBarInfo flow control so negatable commands are handled statically.
- Made TArray movable and TDeletingArray a move only type.
2016-04-02 23:43:56 -04:00
Christoph Oelckers
c83ad9df6c - removed special treatment for not using stdint.h with MSVC. Current compiler versions have this file.
- removed use of finesine for creating the player backdrop for the menu display. This mostly uses the code from the old 2.0 floating point version but fixes some of the constants in there which were not correct.
2016-03-24 11:30:11 +01:00
Randy Heit
55142078d8 Normalize line endings 2016-03-01 09:47:10 -06:00
Christoph Oelckers
f7a3314a0a - added an iterator to TArray so that it can be used with range-bases 'for' statements. 2016-02-26 16:20:27 +01:00
Christoph Oelckers
7b6b473ec4 - some GCC fixed by Edward-san. 2015-04-29 11:28:04 +02:00
Christoph Oelckers
2e0f999fea Merge branch 'master' into scripting
Conflicts:
	src/p_effect.cpp
	src/p_effect.h
	src/p_local.h
	src/p_map.cpp
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/actor.txt
	wadsrc/static/actors/shared/inventory.txt
	zdoom.vcproj
2015-04-28 14:45:13 +02:00
Chris Robinson
c73d97af44 Use TArray and TMap instead of std::vector and std::map 2014-06-28 00:33:15 -07:00
Randy Heit
e3e32d7cca Added DeleteAndClear method to TDeletingArray.
- Normally, TDeletingArray only deletes its contents when it is destroyed.
  Now you can do it earlier if you want.
2013-07-25 21:41:18 -05:00
Randy Heit
459ad5abff - Updated scripting branch to latest version in trunk.
SVN r4337 (scripting)
2013-06-07 03:31:30 +00:00
Randy Heit
2668988870 - Switched to a genericly extensible representation for userinfo.
- Fixed: The playerinfo CCMD did not range check the player number.

SVN r4253 (trunk)
2013-05-12 18:27:03 +00:00
Randy Heit
562cf04db2 - Update scripting branch to trunk.
SVN r3758 (scripting)
2012-07-14 03:04:41 +00:00
Christoph Oelckers
fd2af54724 - fixed TArray compilation issue with GCC 4.7.
SVN r3524 (trunk)
2012-04-07 12:22:00 +00:00