Commit Graph
22 Commits
Author SHA1 Message Date
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Thierry Crozat 5dde667371 NANCY: Silence variable shadowing warnings 2021-04-13 20:49:46 +03:00
fracturehill 9bb543a69e NANCY: Common sound handling changes
SoundManager is now responsible for loading and storing all common sounds (sounds with their own BOOT chunk). All playSound() calls with a hardcoded channel ID now use the chunk name instead. Also fixed some sound inaccuracies when switching between states.
2021-04-08 21:42:52 +03:00
fracturehill 85f8bf294d NANCY: Includes cleanup
Reordered and cleaned up #includes in the engine.
2021-04-01 21:25:32 +03:00
fracturehill ff078328bc NANCY: Includes cleanup
Cleaned up the engine's #includes. Also moved the NancyEngine::GameState enum to commontypes.h and renamed it to NancyState.
2021-03-26 01:17:07 +02:00
fracturehill 16c083d015 NANCY: Add warnings for unknown dependency types
Added the two unknown dependency types to the ActionRecord::DependencyType enum and added warnings for when they get used.
2021-03-24 17:20:46 +01:00
fracturehill eb2fe847d7 NANCY: Improve code readability in actionmanager.cpp
Added a local variable to the debug output section of ActionManager::addNewActionRecord() to improve code readability.
2021-03-24 17:20:46 +01:00
fracturehill bfc6586f78 NANCY: Add reserve() calls before initializing arrays
Added calls to reserve() before initializing most arrays in the engine to reduce unnecessary allocations when pushing back elements one by one.
2021-03-24 17:20:46 +01:00
fracturehill e9adea4c4e NANCY: Formatting fixes
Almost every file in the engine code was using spaces instead of tabs, which is now fixed. Also added some missing spaces in a couple of files.
2021-03-24 17:20:46 +01:00
fracturehill 54bdb420b0 NANCY: String reading fixes
Added a \0 to every instance of a char buffer being loaded into a Common::String. Fixed an instance of a large buffer getting repeatedly allocated and deleted inside a for loop. Fixed an instance of a small char buffer being unnecessarily allocated on the heap. Also added a readFilename() convenience function to util.h for reading 8-character filenames found in the data.
2021-03-24 17:20:46 +01:00
fracturehill 6728c96e68 NANCY: Add underscore to class member names
Fixed many instances of class member names not beginning with an underscore.
2021-03-24 17:20:46 +01:00
fracturehill a286a287f2 NANCY: Replace NanEngine macro
Replaced the nonstandard NanEngine macro with a proper pointer to the current NancyEngine instance.
2021-03-24 17:20:46 +01:00
fracturehill e324adf05f NANCY: Code cleanup
Did some cleanup of the engine, mostly focusing on the NancyEngine class. Reordered several classes' members, removed unused functions, edited comments, and renamed arfactory_v1.cpp to arfactory.cpp.
2021-03-24 17:20:46 +01:00
fracturehill 6eb5be2c51 NANCY: Action record reading changes
Action records are no longer expected to return how much data they've read, which will be helpful with supporting different versions in the same class. Also added a much more helpful error message on a bad read.
2021-03-24 17:20:46 +01:00
fracturehill 20f432f8d3 NANCY: Engine refactor
Made all states (Scene, Credits, Help, etc.) singletons, as well as subclasses of a common State parent with a proper state switching API. Moved the OnPause virtual function from RenderObject to ActionRecord and hooked it into the state switching code. Also got rid of the NancyEngine pointer that got passed around between most classes, and replaced it with several convenience macros. As a result of these changes action records that render to the viewport no longer disappear after opening the menu, and state changes feel snappier.
2021-03-24 17:20:46 +01:00
fracturehill a752f1a4f2 NANCY: Initial save/load support
Added initial support for savestates. The format will most likely change with future commits, but I will only start versioning once the engine supports more than a single game. To support proper serialization the Scene state has had its kInit state split into kInit and kInitStatic, InventoryBox had some of its code reordered, and members of several classes have had their types changed.
2021-03-24 17:20:46 +01:00
fracturehill 7fcdeb641c NANCY: Time fixes
Got rid of the useless tickCount variable and made sure the total play time gets adjusted after switching back to Scene from another state.
2021-03-24 17:20:46 +01:00
fracturehill 0fdda6fbfc NANCY: Code formatting fixes
Fixed a lot of code formatting issues, including switch case statements being indented, some curly braces not being left hanging, if and for statements not being surrounded by newlines, some double spaces, and more.
2021-03-24 17:20:46 +01:00
fracturehill 145d5fd735 NANCY: Add ActionRecord and Scene debug channels
Added debug channels for action records and scenes, and added proper output to their respective loading functions.
2021-03-24 17:20:46 +01:00
fracturehill 6a4e1ecb8e NANCY: Implement repeating action records
Implemented the finishExecution function, which allows some action records with the correct execType to restart after they've been triggered. Since this can result in objects getting added to the graphics manager twice, also added checks to the addObject function to avoid duplicates.
2021-03-24 17:20:46 +01:00
fracturehill e4890a18fc NANCY: Sound manager improvements
The original engine stores sound information in at least four different types of structs, all of which can now be loaded and played back. Also implemented sound types, which will be configurable from the ScummVM interface, added the correct number of sound channels, and implemented sound fx in a couple of action record types.
2021-03-24 17:20:46 +01:00
fracturehill 3aaf2a9bea NANCY: Major engine rewrite
Rewrote most of the engine using a much more object-oriented approach and using more of ScummVM's common classes. This design deviates quite a lot from the original engine's, but should be more maintainable and extensible in the future.
2021-03-24 17:20:46 +01:00