-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove code smells from stonesense
, pt. 2
#128
Open
ab9rf
wants to merge
25
commits into
master
Choose a base branch
from
desmell
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
use std::filesystem::path instead of allegro routines. this also fixes an issue that could arise if a user used (on windows) a drive path that started with a drive letter also use `const std::string&` in a couple functions instead of `const char*`
rewritten to use std::find_if also does not force the use of `const char *` (all of the types in current use are actually using `std::string` so this pushes the conversion out to the call site instead of inside the iteration) eliminated code duplication (and fixed spelling error) in `lookupIndexedPointerType`
iterate a const list instead of repeated code in `loadGraphicsFromDisk` and `flushImgFiles` ideally this would be a destructor, but not there yet this removes a leak on unload
eliminates uses of `ALLEGRO_PATH` in favor of `std::filesystem::path` also works (unlike the prior commit)
remove `using namespace std` push local functions into anonymous namespace partially rewrite the image list and image cache with more reasonable data structures (not fully done) dedup code n `getImgFile`
fix type error remove lots of dead code
`std::filesystem::path` does the same thing but more cleanly
this whole section of code sucks but trying to do this incrementally
only used in one place and could be reduced to a single template so this was done
simplify repetitive code remove a ton of dead code
remove `using namespace std` convert `#define` to `constexpr`
remove `using namespace std` remove some random useless casting
remove `using namespace std` use a proper constructor change building x/y/z to signed to match DF remove dead code
Releasing pt. 2 for review |
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.
Further work toward modernizing
stonesense
's codebase