21 Commits
Author SHA1 Message Date
Silent dd4f6a3036 Platform.Win32: Remove the last MAX_PATH 2025-02-15 11:54:13 +01:00
Silent 031daceb6c EditorObjectSelectionWindow: Remove MAX_PATH 2025-02-15 11:54:12 +01:00
Silent 0763fd5a78 Fix GfxWrapString potentially corrupting the in/out buffer
Fixes a consistent assertion when displaying "Cannot start construction"
in Japanese, but it has potential fix countless other crashes
related to string wrapping/display.
2023-02-14 09:50:05 +01:00
Silent 8216d00522 Set the container type in LanguagePack::FromFile to std::string
The code interpreting fileData assumes the string has a valid null terminator,
which is not guaranteed by std::vector, but is guaranteed by std::string.
2023-02-14 09:50:05 +01:00
Silent 0f978fe907 Remove the last non-Unicode Windows functions 2022-10-07 15:05:43 +02:00
Silent e825ffade7 Platform.Win32: Migrate to modern locale functions and names 2022-10-07 15:05:43 +02:00
Silent 771637f24c Refactor filename_valid_characters into Platform::IsFilenameValid 2022-03-16 21:56:54 +01:00
Silent 28b0a39a73 Refactor CmdlineSprite.cpp and remove path_end_with_separator 2022-03-16 21:56:54 +01:00
Silent 159a76d7ec Refactor uses of safe_strcat_path 2022-03-10 20:18:17 +01:00
Silent 3773fa4cb0 Refactor uses of path_append_extension 2022-03-10 20:18:17 +01:00
Silent 4621cc4264 Json: Fix wrong implicit path typecasts in ReadFromFile and WriteToFile
These functions accepted fs::path which meant passing a u8string to them
wrongly assumed an ANSI encoding and not UTF-8. This would be
a non-issue in C++20 where char8_t is separate, but until then it was an issue
causing incorrect character conversions, and thus an exception.
2022-02-12 14:36:37 +01:00
Silent 46deac8620 Fix a crash in WindowLoadsaveOpen when last_game_directory is empty
The variable path was left unitialized, which worked fine
in Release builds most of the time, but consistently crashed in Debug.
2022-02-12 00:53:26 +01:00
Silent daef940bc8 Fix LargeSceneryObject and WaterObject not tearing down the image ID 2021-10-10 00:09:36 +02:00
Silent 3e64a227e5 Fix Object Selection not freeing the object when unhovering
Fixes a double-free on previews.
2021-10-09 21:48:43 +02:00
Silent 5fcbc3a53d Fix #15299: Breakpad crash dumps are created in game directory 2021-10-05 18:23:06 +02:00
Silent 66abc69690 Add a persistentChunks flag to SawyerChunkReader
New behaviour of SawyerChunkReader is to skip shrinking the chunk
memory unless persistentChunks is set to true. At the moment all uses
of SawyerChunks created by the reader are temporary and shrinking memory
right before freeing them is a waste of time.

Speeds up loading times and index building
2021-05-23 15:04:50 +02:00
Silent fb602ec0c9 Fix allocator mismatch in SawyerChunk on Windows with Debug
This change allows to use HeapReAlloc in FinaliseLargeTempBuffer
when running Debug builds.
2021-05-23 15:04:02 +02:00
Silent e280eb2083 FileStream::Read: Throw the exception basing on fread return value
This change removes ftell/GetPosition() from hot spots during the startup,
"optimizing" the function for success cases - reading past EOF should
never/rarely happen so it seems fine to let it try to read before checking
2021-05-21 19:55:43 +02:00
Silent 724a3c0579 Obtain file sizes without seeking where possible 2021-05-21 19:55:43 +02:00
Silent 95388cfbb1 Add File::GetSize to get object size in a simpler way
Drastically reduces startup speed because of the
optimization applied to ObjectAsset::GetSize - now the file
size is obtained without reading the entire file into memory.
2021-05-21 19:55:42 +02:00
Silent 94da3cf422 Fix #13445: Make FileScanner::ScanDirectory return a unique_ptr
Also fixes a resource leak in TitleSequence::GetSaves.
2021-05-20 19:22:36 +02:00