OutpostUniverse / OP2Utility

C++ library for working with Outpost 2 related files and tasks.
MIT License
4 stars 0 forks source link

Add bitmap file and indexed bitmap reader #212

Closed Brett208 closed 5 years ago

Brett208 commented 5 years ago

I apologize for the significant code change in this branch. This branch does the following:

Testing needs to be improved in the Bitmap Reader. I held off on writing more tests for now because I'd like to create a way to check two in memory BitmapFiles for equaility. Then we can do round-robin checks, where we create an in memory bitmap file, save it to disk, load it, and check to make sure it is equal to the initially created struct.

I'm excited about these changes although I'm sure there is room for improvement.

-Brett

Brett208 commented 5 years ago

I believe since we are forcing the padding to be byte aligned on BmpHeader and ImageHeader, we can use std::memcmp on them when comparing equality.

Next step is to actually read/write a file and compare the results in memory.

DanRStevens commented 5 years ago

I believe you are correct, in that memcpy should work given the assumptions we are already making here. There are no hidden fields or padding space that needs to be excluded from the comparison.