summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAkira Akashi <rubenru09@aol.com>2021-05-19 23:07:59 +0100
committerGitHub <noreply@github.com>2021-05-19 23:07:59 +0100
commit98f11489806b6dba4c6080c5429b2368d3092541 (patch)
treec349b2aaa00b6913e3481aa5fdc52e71ce16a1b9 /tools
parent3a94a45070b5cdc5f4dc92a5f392afbfcfa00bea (diff)
parent73d208810e888514be6cb13bd34db9c8bc47032c (diff)
Merge pull request #380 from red031000/master
some box sprites + nitrogfx NCER mapping type
Diffstat (limited to 'tools')
-rw-r--r--tools/nitrogfx/gfx.c3
-rw-r--r--tools/nitrogfx/json.c3
-rw-r--r--tools/nitrogfx/options.h1
3 files changed, 5 insertions, 2 deletions
diff --git a/tools/nitrogfx/gfx.c b/tools/nitrogfx/gfx.c
index 305fbeb2..f5ff30e7 100644
--- a/tools/nitrogfx/gfx.c
+++ b/tools/nitrogfx/gfx.c
@@ -774,8 +774,9 @@ void WriteNtrCell(char *path, struct JsonToCellOptions *options)
KBECHeader[4] = (size + 0x20) & 0xFF; //size
KBECHeader[5] = (size + 0x20) >> 8; //unlikely to be more than 16 bits, but there are 32 allocated, change if necessary
- fwrite(KBECHeader, 1, 0x20, fp);
+ KBECHeader[16] = (options->mappingType & 0xFF); //not possible to be more than 8 bits, though 32 are allocated
+ fwrite(KBECHeader, 1, 0x20, fp);
unsigned char *KBECContents = malloc(size);
diff --git a/tools/nitrogfx/json.c b/tools/nitrogfx/json.c
index aad325be..b825c363 100644
--- a/tools/nitrogfx/json.c
+++ b/tools/nitrogfx/json.c
@@ -51,16 +51,17 @@ struct JsonToCellOptions *ParseNCERJson(char *path)
cJSON *imageHeight = cJSON_GetObjectItemCaseSensitive(json, "imageHeight");
cJSON *imageWidth = cJSON_GetObjectItemCaseSensitive(json, "imageWidth");
cJSON *cellCount = cJSON_GetObjectItemCaseSensitive(json, "cellCount");
+ cJSON *mappingType = cJSON_GetObjectItemCaseSensitive(json, "mappingType");
options->labelEnabled = GetBool(labelBool);
options->extended = GetBool(extended);
options->imageHeight = GetInt(imageHeight);
options->imageWidth = GetInt(imageWidth);
options->cellCount = GetInt(cellCount);
+ options->mappingType = GetInt(mappingType);
options->cells = malloc(sizeof(struct Cell *) * options->cellCount);
-
if (options->labelEnabled)
{
cJSON *labelCount = cJSON_GetObjectItemCaseSensitive(json, "labelCount");
diff --git a/tools/nitrogfx/options.h b/tools/nitrogfx/options.h
index 780c83e6..66e9895d 100644
--- a/tools/nitrogfx/options.h
+++ b/tools/nitrogfx/options.h
@@ -74,6 +74,7 @@ struct Cell {
struct JsonToCellOptions {
bool labelEnabled;
bool extended;
+ int mappingType;
int imageHeight;
int imageWidth;
int cellCount;