Commit Graph

415 Commits

Author SHA1 Message Date
ZehMatt 0e7d05a5ad
Add TileCoordsXYZD serialiser traits 2021-07-27 20:15:10 +03: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
Duncan d46e4a9bb1
Network serialiser for entities (#14541)
* Start a network serialiser for entities

will be used only for checksums and replay diffs

* Continue work

* Use the new serailser for checksums

* Use new serialiser for replays

* keep compilers happy

* Try create checksum stream

* Fix compiling

* Split off class into seperate file

* Update Xcode project

* Increment network version

* Fix pragma mistake

* Fix none network builds

* Update replays

* Improve ChecksumStream and use FNV internally

* Small cleanups

* satisfy compilers

* Revert change of checksum size to simplfy rerecording

* Zero initialise data

* Fix serialiser

* Update replays again

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
Co-authored-by: Matt <m.moninger.h@gmail.com>
2021-05-09 19:12:44 +01:00
Tulio Leao 2d1557e48e
Merge pull request #13444 from tupaschoal/extract-ifdefed-functions
Extract ifdefed functions
2021-03-27 10:00:01 -03:00
Tulio Leao 62fc4c8034 Extract ResolveCasing to Platform 2021-03-26 23:17:01 -03:00
Tulio Leao c7ae064a4c Extract ShouldIgnoreCase to Platform 2021-03-26 23:17:01 -03:00
Tulio Leao 9a071aef76 Extract GetAbsolutePath to Platform 2021-03-26 23:17:01 -03:00
Tulio Leao f15bbd220a Extract IsPathSeparator to Platform 2021-03-25 23:45:01 -03:00
Duncanspumpkin 0957542503
Implement C++ solution to truncate UTF8 strings 2021-03-18 22:14:12 +01:00
Tulio Leao f372117939 Extract GetLastModified to Platform 2021-03-14 09:36:44 -03:00
Ted John 2b3e7b98b8 Roll our own implementation of parse 2021-02-21 03:14:19 +00:00
Ted John 2b197d0fb2 Fix parsing of shortcuts 2021-02-21 03:14:18 +00:00
Ted John 46c3fd4e5f Use FileStream instead of fstream 2021-02-21 03:14:18 +00:00
Ted John af0ed416f5 Implement loading / saving of new shortcuts 2021-02-21 03:14:18 +00:00
Ted John e7ae9f9f15 Read legacy shortcuts and move to constants 2021-02-21 03:14:17 +00:00
Ted John e5f263a0fc Get new manager showing in window 2021-02-21 03:13:27 +00:00
Ted John 1523597b50 Fix test failures 2021-02-16 20:25:11 +00:00
Ted John 3f5698b1e0 Fix REPL write line on Linux 2021-02-16 20:24:51 +00:00
Matt c30bd1266f
Refactor IStream::ReadArray to return unique_ptr 2021-02-12 19:30:53 +02:00
ζeh Matt 15ef22c2f6
Merge pull request #13970 from ZehMatt/refactor/fixed-vector
Use FixedVector for paint_structs
2021-01-30 12:57:12 +02:00
Matt 3fecb36a19
Use fixed vector for paint_entry 2021-01-30 09:16:42 +02:00
Michael Steenbeek d3a4c16270
Reserve room for tile owner 2021-01-29 16:56:33 +01:00
Ted John 28f4ec2b43 Implement code review suggestions 2021-01-27 18:45:28 +00:00
Ted John d9b8413ec4 Use IStream for zip streaming 2021-01-27 18:45:27 +00:00
Ted John 2f39442d25 Implement ride music objects and refactor 2021-01-27 18:45:27 +00:00
ζeh Matt bc20efb3df
Merge pull request #13822 from ZehMatt/refactor/fixedvector
Avoid some allocations by using a fixed size vector
2021-01-22 16:17:14 +02:00
Michał Janiszewski 4a21676d17 Plug memory leak in DataSerialiser 2021-01-19 22:11:08 +01:00
Matt e9cdb559e3
Avoid some allocations by using a fixed size vector 2021-01-14 12:27:54 +02:00
skdltmxn 7ef4d7762f
Refactor to avoid unnecessary copies (#13736)
* Refactor to avoid unnecessary copies

* Fix dangling references
2021-01-11 18:14:15 -03:00
Mathias Gibbens b1e5a11bf3
Several more spelling fixes (#13752)
Signed-off-by: Mathias Gibbens <mathias@calenhad.com>

Co-authored-by: Mathias Gibbens <mathias@calenhad.com>
2021-01-10 18:23:35 +00:00
Michael Steenbeek 1da6ae6b51
Merge pull request #13710 from skdltmxn/refactor/string_view
Refactor/string view
2021-01-10 13:37:01 +01:00
skdltmxn b0a8ebc808
Refactor to use push_back more efficient (#13726) 2021-01-08 20:59:55 +00:00
skdltmxn e1cfa8693f Use c_str() instead of data() 2021-01-07 04:28:19 +09:00
skdltmxn c093a50f3f Refactor to use string_view more properly 2021-01-07 01:52:10 +09:00
duncanspumpkin 60729113d9 Simplify Serialise for FileIndex 2020-12-07 07:52:12 +00:00
Duncan a9ed5d6536
Fix ObjectEntryDescriptor (#13506) 2020-12-06 09:28:06 +00:00
Ted John d58d834925
Merge pull request #13212 from IntelOrca/new-format-string
Eradicate all coded format tokens. All internal strings now contain raw tokens such as `{STRINGID}` and `{RED}`. New iterators have been created to iterate the tokens and the UTF-8 codepoints.

Formatting strings has been re-written and a new template version is available.
2020-12-04 13:56:54 +00:00
Gymnasiast 596aa71093
Create ObjectEntryDescriptor to properly handle mixed DAT and JSON 2020-12-02 17:17:25 +01:00
Ted John 17edaae02b Improve banner formatting fix 2020-11-29 01:19:51 +00:00
Ted John 699103fe86 Fix banner text formatting, import / export 2020-11-28 16:52:19 +00:00
Ted John dfcd8a4bbc Apply code review comments 2020-11-27 18:54:57 +00:00
Ted John 92fcdfbd9b Fix GCC compiler errors 2020-11-27 18:54:57 +00:00
Ted John b6a688e540 Refactor format tokens 2020-11-27 18:54:57 +00:00
Ted John c6152efa4e Fix scrolling text 2020-11-27 18:54:56 +00:00
Ted John 2f7c1aab14 Start eradicating old format codes 2020-11-27 18:54:56 +00:00
Ted John 14377be487 Create new templated format string 2020-11-27 18:54:55 +00:00
Michael Steenbeek 8b27f7cdf8
Implement ToUpper for WinNT 5.1 (#13422) 2020-11-16 08:12:28 -03:00