|
|
@@ -4,69 +4,41 @@
|
|
|
#include "Quirks.h"
|
|
|
#include "map/Map.h"
|
|
|
#include "map/StateMap.h"
|
|
|
+#include "piaf/Archive.h"
|
|
|
#include "utility/misc.h"
|
|
|
+#include "sprites.h"
|
|
|
|
|
|
using namespace WalrusRPG;
|
|
|
+using WalrusRPG::PIAF::Archive;
|
|
|
+using WalrusRPG::Graphics::Texture;
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
{
|
|
|
UNUSED(argc);
|
|
|
- UNUSED(argv);
|
|
|
|
|
|
Graphics::init();
|
|
|
Timing::init();
|
|
|
- Quirks::init();
|
|
|
+ Quirks::init(argv[0]);
|
|
|
|
|
|
- uint16_t dungeonTest[] = {
|
|
|
- 21, 21, 1, 1, 1, 1, 21, 22, 21, 22, 21, 22, 21, 21, 1, 22, 21,
|
|
|
- 1, 22, 22, 22, 1, 21, 2, 3, 3, 3, 3, 3, 4, 21, 1, 22, 21,
|
|
|
- 22, 22, 21, 21, 21, 1, 22, 22, 22, 23, 108, 109, 109, 109, 24, 87, 4,
|
|
|
- 21, 21, 22, 5, 6, 6, 7, 1, 1, 22, 21, 21, 23, 66, 67, 108, 109,
|
|
|
- 24, 109, 25, 21, 22, 5, 132, 43, 43, 28, 1, 1, 21, 22, 1, 23, 25,
|
|
|
- 23, 109, 109, 108, 108, 25, 1, 1, 26, 42, 110, 48, 49, 22, 21, 1, 21,
|
|
|
- 21, 23, 87, 88, 109, 24, 109, 109, 25, 1, 1, 26, 43, 131, 6, 7, 21,
|
|
|
- 1, 22, 1, 21, 44, 67, 109, 24, 24, 24, 66, 46, 1, 22, 26, 27, 43,
|
|
|
- 42, 131, 7, 21, 22, 1, 22, 21, 44, 45, 45, 45, 45, 46, 1, 22, 1,
|
|
|
- 26, 27, 27, 43, 27, 28, 22, 21, 22, 21, 1, 21, 1, 22, 22, 21, 1,
|
|
|
- 21, 22, 1, 47, 48, 111, 42, 27, 28, 21, 21, 1, 21, 21, 22, 2, 3,
|
|
|
- 3, 4, 1, 2, 3, 4, 1, 5, 132, 27, 27, 28, 1, 1, 22, 1, 22,
|
|
|
- 21, 23, 24, 66, 46, 1, 23, 24, 25, 1, 26, 42, 42, 110, 49, 21, 22,
|
|
|
- 21, 22, 22, 2, 88, 24, 25, 2, 3, 88, 24, 87, 4, 26, 43, 110, 49,
|
|
|
- 21, 21, 1, 1, 1, 2, 88, 24, 24, 87, 88, 108, 24, 24, 109, 25, 47,
|
|
|
- 48, 49, 1, 22, 22, 21, 1, 21, 23, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
|
- 24, 87, 4, 21, 21, 22, 22, 22, 22, 1, 21, 23, 24, 24, 109, 24, 24,
|
|
|
- 24, 24, 24, 108, 109, 25, 21, 21, 22, 22, 22, 22, 21, 21, 44, 45, 45,
|
|
|
- 67, 24, 24, 24, 66, 45, 45, 45, 46, 1, 22, 1, 22, 22, 22, 21, 22,
|
|
|
- 22, 22, 1, 44, 67, 108, 108, 25, 22, 22, 1, 22, 21, 22, 21, 21, 1,
|
|
|
- 21, 22, 1, 22, 22, 1, 22, 44, 45, 45, 46, 1, 1, 1, 1, 21, 21,
|
|
|
- 21, 21, 21, 21, 22, 21, 21, 21, 1, 21, 1, 22, 22, 22, 1, 21, 22,
|
|
|
- 21, 1, 1, 22, 21, 1, 1, 21, 1, 1, 21, 21, 21, 1, 22, 22, 1,
|
|
|
- 21, 22, 21, 22, 1, 22, 21, 21, 21,
|
|
|
- };
|
|
|
- uint16_t dungeonTest2[] = {
|
|
|
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
- 0, 0, 0, 0, 0, 52, 53, 54, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
- 0, 0, 0, 0, 0, 73, 74, 75, 76, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0,
|
|
|
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
- };
|
|
|
+ Archive arc("data/out.wrf");
|
|
|
+ Texture tex(arc.get("ov.png"));
|
|
|
+ WalrusRPG::PIAF::File f1 = arc.get("l1.bin");
|
|
|
+ WalrusRPG::PIAF::File f2 = arc.get("l2.bin");
|
|
|
|
|
|
- Map map(20, 20, dungeonTest, dungeonTest2);
|
|
|
+ const uint8_t *l1 = f1.get();
|
|
|
+ const uint8_t *l2 = f2.get();
|
|
|
+
|
|
|
+ // TODO better map reading.
|
|
|
+ uint16_t *dungeonTest = new uint16_t[f1.file_size / 2 + 1];
|
|
|
+ uint16_t *dungeonTest2 = new uint16_t[f1.file_size / 2 + 1];
|
|
|
+
|
|
|
+ for (unsigned i = 0; i < f1.file_size / 2; i++)
|
|
|
+ {
|
|
|
+ dungeonTest[i] = read_big_endian_value<uint16_t>(&l1[i * 2]);
|
|
|
+ dungeonTest2[i] = read_big_endian_value<uint16_t>(&l2[i * 2]);
|
|
|
+ }
|
|
|
+
|
|
|
+ Map map(20, 20, dungeonTest, dungeonTest2, tex);
|
|
|
tinystl::vector<Frame> stripe21;
|
|
|
tinystl::vector<Frame> stripe22;
|
|
|
stripe21.push_back({21, 23});
|
|
|
@@ -82,5 +54,9 @@ int main(int argc, char *argv[])
|
|
|
Quirks::deinit();
|
|
|
Timing::deinit();
|
|
|
Graphics::deinit();
|
|
|
+
|
|
|
+ delete[] dungeonTest;
|
|
|
+ delete[] dungeonTest2;
|
|
|
+
|
|
|
return 0;
|
|
|
}
|