Replace engine file loading/saving with llfio (#691)

  • Konuyu Başlatan Konuyu Başlatan twostars
  • Başlangıç tarihi Başlangıç tarihi
  • Öne çıkan
T

twostars

Replace engine file loading/saving with llfio (#691)

* Add llfio (low level file I/IO) - for performant cross-platform file I/O support.

* Add basic FileReader & FileWriter leveraging llfio

Regular consumers will simply use the base File class and not need to be exposed to any of it.
Anything opening files (which is usually limited) will end up pulling in llfio through the reader or writer header.

I think it's better for the compiler to suffer in this case than the application via unnecessary heap allocations.

* Server: Replace main std::ifstream use with FileReader

* Pass over classes using Load(HANDLE) to mark observed virtual methods with override (to catch any signature issues at compile-time).

This ensures they must match the base class' implementation and won't create a 2nd (unused) implementation.

* Cleanup pass over std::vector<char> reads

These should just read to strings directly.

* JpegFile: Use C file I/O API.

Since it already uses the C file I/O API (and it's coupled to it because of libjpeg), we just ensure the rest also does.
That way we don't have to touch dependencies for this project, and it still performs better than it did via WinAPI (at least on MSVC).

* Replace engine file reading with FileReader (llfio)

ItemEditor is swapped to the C file i/o API to avoid dealing with other dependencies (it uses that for everything else anyway).

* Replace engine file saving with FileWriter (llfio)

* Add unit tests for FileReader & FileWriter

Remove most of the assertions (unfortunately) as they'll clash with the unit tests.

* CN3TableBase: Move as much out of the header as we can

Add CN3TableBaseImpl as a parent class to implement most of the shared logic that doesn't need to be templated.

MakeOffsetTable() could realistically be moved up a level, but this way the compiler can optimise it for the exact struct alignment.
This is typically only going to be one of 2 things, depending on whether or not it has 64-bit fields in them (in 32-bit builds, anyway),
but still.

* Move <filesystem> into PCH

This is pulled in by <FileIO/File.h> typically which is intentionally small but <filesystem> probably adds a lot of unnecessary bloat.
Should ensure build times remain consistent.

* Strip unused CN3TableBaseImpl::WriteData()

It's technically *almost* usable by the TBL editor, but not really.
Better to just keep them separate.

It isn't used at all.

Github Commit Görüntüle...
See Commints...

..
 

Similar threads

T
Cevaplar
0
Görüntüleme
22
twostars
T
T
Cevaplar
0
Görüntüleme
15
twostars
T
T
Cevaplar
0
Görüntüleme
12
twostars
T
T
Cevaplar
0
Görüntüleme
39
twostars
T
T
Cevaplar
0
Görüntüleme
24
twostars
T
Geri
Üst