fix: refactor and clean up code across multiple files - #72
Open
Niravanaa wants to merge 1 commit into
Open
Conversation
- Updated logging function in Global.h to use localtime_s for safer time handling. - Initialized pointers to nullptr in EndScreenState.h, IntroState.h, MainGameState.h, MapEditorState.h, MapSelectState.h, OptionsState.h, and TitleState.h to prevent potential dereferencing of uninitialized pointers. - Added destructor to Tower class to manage memory for critterTargettingStrategy. - Changed return types of getBuyingCost and getTotalTowersPlaced to const in Tower and TowerGroup classes respectively. - Updated ParallaxBackground and ParallaxLayer to use float instead of int for dimensions and positions, improving precision. - Removed unnecessary dynamic memory allocations and replaced them with stack allocations where applicable. - Cleaned up memory management in various classes, ensuring proper deletion of dynamically allocated objects. - Adjusted volume slider constructor to accept float parameters for position.
Collaborator
Author
|
One thing to note is that when calling For example, the FastCritter, which should just be a bee, has the slime texture rendered under-neath it in wave 2 . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Proposed Changes:
This PR improves code safety, memory management, and precision by initializing pointers, cleaning up dynamic allocations, refining type usage, and enhancing UI component flexibility.
📝 Details: