1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-26 14:38:30 +02:00
VVVVVV/desktop_version/src
Misa 8edf2f0ac6 Refactor custom scripts to not be stored in one giant vector of lines
This commit refactors custom level scripts to no longer be stored in one
giant vector containing not only every single script name, but every
single script's contents as well. More specifically,
scriptclass::customscript has been converted to an std::vector<Script>
scriptclass::customscripts (note the extra S), and a Script is just a
struct with an std::string name and std::vector<std::string> contents.

This is an improvement in both performance and maintainability. The game
no longer has to look through script contents in case they're actually
script names, and then manually extract the script contents from there.
Instead, all it has to do is look for script names only. And the
contents are provided for free. This results in a performance gain.

Also, the old system resulted in lots of boilerplate everywhere anytime
scripts had to be handled or parsed. Now, the boilerplate is only done
when saving or loading a custom level. This makes code quality much,
much better.

To be sure I didn't actually change anything, I tested by first saving
Dimension Open in current 2.3 (because current 2.3 gets rid of the
awful edentity whitespace), and then resaved it on this patch. There is
absolutely no difference between the current-2.3-resave and
this-patch-resave.
2020-06-11 22:13:52 -04:00
..
BinaryBlob.cpp Don't leak binaryBlob 2020-06-07 22:40:03 -04:00
BinaryBlob.h Don't leak binaryBlob 2020-06-07 22:40:03 -04:00
BlockV.cpp Remove blockclass::clear(), simplify blockclass initializations 2020-04-03 23:28:47 -04:00
BlockV.h Remove blockclass::clear(), simplify blockclass initializations 2020-04-03 23:28:47 -04:00
editor.cpp Refactor custom scripts to not be stored in one giant vector of lines 2020-06-11 22:13:52 -04:00
editor.h Fixed some custom asset bugs, added .zip level loading 2020-06-03 15:35:39 -04:00
Ent.cpp Remove entclass::clear(), simplify entclass initializations 2020-04-03 23:28:47 -04:00
Ent.h Remove entclass::clear(), simplify entclass initializations 2020-04-03 23:28:47 -04:00
Entity.cpp Simplify inits/resets in entityclass/mapclass 2020-05-19 20:41:56 -04:00
Entity.h Prevent updating an entity if updateentities() removed it 2020-05-05 17:22:47 -04:00
Enums.h Hello WWWWWWorld! 2020-01-08 10:37:50 -05:00
FileSystemUtils.cpp Whitespace consistency for FileSystemUtils 2020-05-31 19:43:24 -04:00
FileSystemUtils.h Per-level custom asset loading functionality (#262) 2020-05-31 19:31:02 -04:00
Finalclass.cpp Statically allocate level arrays 2020-05-29 10:21:25 -04:00
Finalclass.h Refactor Finalclass.cpp to not use strings for tilemaps 2020-05-17 22:03:29 -04:00
Game.cpp Fix custom assets being unmounted in scriptclass::hardreset() 2020-06-03 21:44:56 -04:00
Game.h Move returning to editor to end of frame 2020-05-09 16:40:01 -04:00
GOGNetwork.c Add support for multiple Network backends, stub in GOGNetwork 2020-01-13 11:15:22 -05:00
Graphics.cpp Fix some leaks 2020-06-07 22:40:03 -04:00
Graphics.h Per-level custom asset loading functionality (#262) 2020-05-31 19:31:02 -04:00
GraphicsResources.cpp Fix some leaks 2020-06-07 22:40:03 -04:00
GraphicsResources.h Fix some leaks 2020-06-07 22:40:03 -04:00
GraphicsUtil.cpp Fix mixed indentation in GraphicsUtil.cpp 2020-04-03 10:40:50 -04:00
GraphicsUtil.h Hello WWWWWWorld! 2020-01-08 10:37:50 -05:00
Input.cpp Clean up all scriptclass externs into one location 2020-05-22 09:46:12 -04:00
Input.h Remove global args from Input.cpp 2020-04-03 10:40:50 -04:00
KeyPoll.cpp Make the toggle fullscreen conditional more readable 2020-03-12 21:20:25 -04:00
KeyPoll.h Add being able to mute the music by pressing N 2020-04-19 20:51:35 -04:00
Labclass.cpp Statically allocate level arrays 2020-05-29 10:21:25 -04:00
Labclass.h Refactor Labclass.cpp to not use strings for tilemaps 2020-05-17 22:03:29 -04:00
Logic.cpp Clean up all scriptclass externs into one location 2020-05-22 09:46:12 -04:00
Logic.h Merge towerlogic() into gamelogic() 2020-04-26 19:07:40 -04:00
main.cpp Removed another stray line 2020-06-03 15:35:39 -04:00
MakeAndPlay.h Re-comment out #define MAKEANDPLAY 2020-02-09 10:42:03 -05:00
Map.cpp Clean up editorclass externs into one location 2020-05-22 09:46:12 -04:00
Map.h Clean up editorclass externs into one location 2020-05-22 09:46:12 -04:00
Maths.h Hello WWWWWWorld! 2020-01-08 10:37:50 -05:00
Music.cpp Don't leak sounds/music 2020-06-07 22:40:03 -04:00
Music.h Don't leak binaryBlob 2020-06-07 22:40:03 -04:00
Network.c Allow for conditional building of Steam and GOG APIs 2020-06-01 14:21:06 -04:00
Network.h Add support for multiple Network backends, stub in GOGNetwork 2020-01-13 11:15:22 -05:00
Otherlevel.cpp Statically allocate level arrays 2020-05-29 10:21:25 -04:00
Otherlevel.h Refactor Otherlevel.cpp to not use strings for tilemaps 2020-05-17 22:03:29 -04:00
preloader.cpp Only render screen effects on the title screen and in-game 2020-04-27 15:07:58 -04:00
preloader.h Remove global args from preloader.cpp 2020-04-03 10:40:50 -04:00
Render.cpp Clean up all scriptclass externs into one location 2020-05-22 09:46:12 -04:00
Render.h Merge towerrender() into gamerender() 2020-04-26 19:07:40 -04:00
Screen.cpp Remove unused variable Screen::glScreen 2020-04-03 10:40:50 -04:00
Screen.h Remove unused variable Screen::glScreen 2020-04-03 10:40:50 -04:00
Script.cpp Refactor custom scripts to not be stored in one giant vector of lines 2020-06-11 22:13:52 -04:00
Script.h Refactor custom scripts to not be stored in one giant vector of lines 2020-06-11 22:13:52 -04:00
Scripts.cpp Statically allocate built-in scripts as well 2020-05-29 12:48:36 -04:00
SoundSystem.cpp Revert "Add destructor for SoundTrack/MusicTrack (and explicitly define move constructor to prevent double-free)" 2020-06-07 22:40:03 -04:00
SoundSystem.h Revert "Add destructor for SoundTrack/MusicTrack (and explicitly define move constructor to prevent double-free)" 2020-06-07 22:40:03 -04:00
Spacestation2.cpp Statically allocate Prize for the Reckless tilemap 2020-05-29 19:39:05 -04:00
Spacestation2.h Refactor Spacestation2.cpp to not use strings for tilemaps 2020-05-17 22:03:29 -04:00
SteamNetwork.c Fix build on DragonFlyBSD 2020-04-23 23:35:33 -04:00
TerminalScripts.cpp Statically allocate built-in scripts as well 2020-05-29 12:48:36 -04:00
Textbox.cpp Remove textboxclass's firstcreate and clear, simplify initializations 2020-04-03 23:28:47 -04:00
Textbox.h Remove textboxclass's firstcreate and clear, simplify initializations 2020-04-03 23:28:47 -04:00
Tower.cpp Remove now-unused fillbackground/fillcontents/fillminitower from Tower 2020-05-17 22:03:29 -04:00
Tower.h Remove now-unused fillbackground/fillcontents/fillminitower from Tower 2020-05-17 22:03:29 -04:00
UtilityClass.cpp Add is_positive_num() to UtilityClass.cpp 2020-04-17 19:14:44 -04:00
UtilityClass.h Add is_positive_num() to UtilityClass.cpp 2020-04-17 19:14:44 -04:00
WarpClass.cpp Statically allocate level arrays 2020-05-29 10:21:25 -04:00
WarpClass.h Refactor WarpClass.cpp to not use strings for tilemaps 2020-05-17 22:03:29 -04:00