From 4df7ada3578b391fb9ad38f74288403639d65c2d Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Fri, 8 Feb 2019 14:54:48 -0800 Subject: [PATCH] working on world data interpreter some more --- WorldData.c | 13 +++++++++++++ WorldData.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/WorldData.c b/WorldData.c index 0995266..2eef2c8 100644 --- a/WorldData.c +++ b/WorldData.c @@ -168,6 +168,19 @@ int buildObstruction(char* props) return 0; } +int buildFGImage(char* props) +{ + int rm, x, y, w, h, f, d, a; + char filename[256]; + if (sscanf(props, "room %u, x %d, y %d, w %u, h %u, sprite %[^,], frames %u, dual %u, alpha %u", + &rm, &x, &y, &w, &h, filename, &f, &d, &a) !=9) + { + return 1; + } + addFGObj(mapBuffer[rm], x, y, w, h, filename, f, d, a); + return 0; +} + int buildWarp(char* props) { int r, x, y, w, h, dC, dR, dX, dY; diff --git a/WorldData.h b/WorldData.h index bf074f6..e947388 100644 --- a/WorldData.h +++ b/WorldData.h @@ -13,6 +13,8 @@ int buildPerson(char* props); int buildObstruction(char* props); +int buildFGImage(char* props); + int countMapThings(char x, enum dataChunks chunk); void unloadData(enum dataChunks chunk);