-
Notifications
You must be signed in to change notification settings - Fork 196
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
Use liblcf string and array types #2280
Conversation
src/cache.cpp
Outdated
bool transparent, const uint32_t flags) { | ||
const auto key = MakeHashKey(folder_name, filename, transparent); | ||
|
||
auto it = cache.find(key); | ||
|
||
if (it == cache.end()) { | ||
const std::string path = FileFinder::FindImage(folder_name, filename); | ||
// FIXME: STRING_VIEW string copies here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this fixme for later PRs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I didn't fully StringView'ify filefinder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer it when you don't touch the FileFinder too much otherwise my next big FS PR will be terrible to rebase.
} | ||
} } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Highlighting these ugly hacks to get fmtlib working without needing to include <fmt/format.h>
everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any hack that doesn't increase buildtime by 100% because of libfmt is good.
src/string_view.h
Outdated
|
||
namespace lcf { | ||
// FIXME: This is hacky, but unfortunately nowhere else convenient to put this to be able to print DBString ... | ||
inline fmt::basic_string_view<char> to_string_view(const lcf::DBString& s) { | ||
return to_string_view(StringView(s)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this one, which is worse because we shouldn't even be including DBString here, but nowhere else to put this..
723ce46
to
3c3ceac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more numbers for the title screen. The memory usage of the map is hard to determine but likely also saves some KB to MB there depending on the events
- Alter Aila Genesis: 297 -> 185
- Heros Realm: 297 -> 177
- Il mito: 120 -> 92
- Final Tear 3: 146 -> 93
- VH1: 101 -> 74
- TTHW: 88 -> 58
- DQ4: 66 -> 49
- Frozen Triggers: 60 -> 48
- 7thJojo: 54 -> 40
- Lakria Legends: 53 -> 40
- Sternenkindsaga: 40 -> 31
- Pokekon Eevee: 36 -> 32
- Wolfenhain: 29 -> 25
- Vampires Dawn II: 21 -> 20
- ゆめ2っきver0.113a: 24 -> 21
- DEEP 8 Demo: 26 -> 23
- Unterwegs in Düsterburg: 18 -> 17
- Yume Nikki: 15 -> 14,5
- Ib: 13,9 -> 13,8
Allows abstraction between different underlying string types
Some more numbers for reduced memory usage in MB on the title screen. The memory usage of the map is hard to determine but likely also saves some KB to MB there depending on the events
|
Depends on: EasyRPG/liblcf#379
See liblcf PR for details.