summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-11-08 15:37:18 -0800
committerVito Caputo <vcaputo@pengaru.com>2022-11-08 15:37:18 -0800
commitdc42abd5a4c634d40a51aad608c93f2030032903 (patch)
tree3621be0a5c29e817eecadae87db6be8abf7e9322
parentab090d967fbb206b058cb6ffa91fcd0d1c7e28a9 (diff)
*-node: pivot to ansr_tex_new() and .ans assets
This switches all existing art assets over to runtime-loaded-and-rendered .ans assets. gfx/*.h embedded assets will be removed in a subsequent commit
-rw-r--r--src/adult-masked-node.c4
-rw-r--r--src/adult-node.c4
-rw-r--r--src/baby-hatted-node.c4
-rw-r--r--src/baby-node.c4
-rw-r--r--src/digit-node.c49
-rw-r--r--src/hungrycat-node.c12
-rw-r--r--src/mask-node.c4
-rw-r--r--src/tv-node.c4
-rw-r--r--src/virus-node.c4
9 files changed, 50 insertions, 39 deletions
diff --git a/src/adult-masked-node.c b/src/adult-masked-node.c
index eef0523..98646fc 100644
--- a/src/adult-masked-node.c
+++ b/src/adult-masked-node.c
@@ -16,8 +16,8 @@
#include <stage.h>
+#include "ansr-tex.h"
#include "adult-masked-node.h"
-#include "gfx/gfx-adult-masked.h"
#include "tex.h"
#include "tex-node.h"
@@ -26,7 +26,7 @@ static tex_t *adult_masked_tex;
stage_t * adult_masked_node_new(stage_conf_t *conf, m4f_t *projection_x, m4f_t *model_x)
{
if (!adult_masked_tex)
- adult_masked_tex = tex_new(gfx_adult_masked.width, gfx_adult_masked.height, gfx_adult_masked.pixel_data);
+ adult_masked_tex = ansr_tex_new("assets/adult-masked.ans", "assets/adult-masked.mask.ans");
return tex_node_new_tex(conf, adult_masked_tex, projection_x, model_x);
}
diff --git a/src/adult-node.c b/src/adult-node.c
index d3cdaf7..be9dfb1 100644
--- a/src/adult-node.c
+++ b/src/adult-node.c
@@ -16,8 +16,8 @@
#include <stage.h>
+#include "ansr-tex.h"
#include "adult-node.h"
-#include "gfx/gfx-adult.h"
#include "tex.h"
#include "tex-node.h"
@@ -26,7 +26,7 @@ static tex_t *adult_tex;
stage_t * adult_node_new(stage_conf_t *conf, m4f_t *projection_x, m4f_t *model_x)
{
if (!adult_tex)
- adult_tex = tex_new(gfx_adult.width, gfx_adult.height, gfx_adult.pixel_data);
+ adult_tex = ansr_tex_new("assets/adult.ans", "assets/adult.mask.ans");
return tex_node_new_tex(conf, adult_tex, projection_x, model_x);
}
diff --git a/src/baby-hatted-node.c b/src/baby-hatted-node.c
index 3f509bd..ba963f8 100644
--- a/src/baby-hatted-node.c
+++ b/src/baby-hatted-node.c
@@ -16,8 +16,8 @@
#include <stage.h>
+#include "ansr-tex.h"
#include "baby-hatted-node.h"
-#include "gfx/gfx-baby-hatted.h"
#include "tex.h"
#include "tex-node.h"
@@ -26,7 +26,7 @@ static tex_t *baby_hatted_tex;
stage_t * baby_hatted_node_new(stage_conf_t *conf, m4f_t *projection_x, m4f_t *model_x)
{
if (!baby_hatted_tex)
- baby_hatted_tex = tex_new(gfx_baby_hatted.width, gfx_baby_hatted.height, gfx_baby_hatted.pixel_data);
+ baby_hatted_tex = ansr_tex_new("assets/baby-hatted.ans", "assets/baby-hatted.mask.ans");
return tex_node_new_tex(conf, baby_hatted_tex, projection_x, model_x);
}
diff --git a/src/baby-node.c b/src/baby-node.c
index c7befca..88b7937 100644
--- a/src/baby-node.c
+++ b/src/baby-node.c
@@ -16,8 +16,8 @@
#include <stage.h>
+#include "ansr-tex.h"
#include "baby-node.h"
-#include "gfx/gfx-baby.h"
#include "tex.h"
#include "tex-node.h"
@@ -26,7 +26,7 @@ static tex_t *baby_tex;
stage_t * baby_node_new(stage_conf_t *conf, m4f_t *projection_x, m4f_t *model_x)
{
if (!baby_tex)
- baby_tex = tex_new(gfx_baby.width, gfx_baby.height, gfx_baby.pixel_data);
+ baby_tex = ansr_tex_new("assets/baby.ans", "assets/baby.mask.ans");
return tex_node_new_tex(conf, baby_tex, projection_x, model_x);
}
diff --git a/src/digit-node.c b/src/digit-node.c
index 8d970e2..99ad351 100644
--- a/src/digit-node.c
+++ b/src/digit-node.c
@@ -17,31 +17,34 @@
#include <assert.h>
#include <stage.h>
+#include "ansr-tex.h"
#include "tex.h"
#include "tex-node.h"
-#include "gfx/gfx-zero.h"
-#include "gfx/gfx-one.h"
-#include "gfx/gfx-two.h"
-#include "gfx/gfx-three.h"
-#include "gfx/gfx-four.h"
-#include "gfx/gfx-five.h"
-#include "gfx/gfx-six.h"
-#include "gfx/gfx-seven.h"
-#include "gfx/gfx-eight.h"
-#include "gfx/gfx-nine.h"
-
-static const unsigned char *digits_pixels[10] = {
- gfx_zero.pixel_data,
- gfx_one.pixel_data,
- gfx_two.pixel_data,
- gfx_three.pixel_data,
- gfx_four.pixel_data,
- gfx_five.pixel_data,
- gfx_six.pixel_data,
- gfx_seven.pixel_data,
- gfx_eight.pixel_data,
- gfx_nine.pixel_data,
+static const char *digits_assets[10] = {
+ "assets/zero.ans",
+ "assets/one.ans",
+ "assets/two.ans",
+ "assets/three.ans",
+ "assets/four.ans",
+ "assets/five.ans",
+ "assets/six.ans",
+ "assets/seven.ans",
+ "assets/eight.ans",
+ "assets/nine.ans",
+};
+
+static const char *digits_masks_assets[10] = {
+ "assets/zero.mask.ans",
+ "assets/one.mask.ans",
+ "assets/two.mask.ans",
+ "assets/three.mask.ans",
+ "assets/four.mask.ans",
+ "assets/five.mask.ans",
+ "assets/six.mask.ans",
+ "assets/seven.mask.ans",
+ "assets/eight.mask.ans",
+ "assets/nine.mask.ans",
};
static tex_t *digits_tex[10];
@@ -54,7 +57,7 @@ stage_t * digit_node_new(stage_conf_t *conf, unsigned digit, m4f_t *projection_x
assert(digit < 10);
if (!digits_tex[digit])
- digits_tex[digit] = tex_new(DIGIT_WIDTH, DIGIT_HEIGHT, digits_pixels[digit]);
+ digits_tex[digit] = ansr_tex_new(digits_assets[digit], digits_masks_assets[digit]);
return tex_node_new_tex(conf, digits_tex[digit], projection_x, model_x);
}
diff --git a/src/hungrycat-node.c b/src/hungrycat-node.c
index b880eda..0c311eb 100644
--- a/src/hungrycat-node.c
+++ b/src/hungrycat-node.c
@@ -16,12 +16,20 @@
#include <stage.h>
-#include "gfx/gfx-hungrycat.h"
+#include "ansr-tex.h"
#include "hungrycat-node.h"
+#include "tex.h"
#include "tex-node.h"
stage_t * hungrycat_node_new(stage_conf_t *conf, m4f_t *projection_x, m4f_t *model_x)
{
- return tex_node_new_mem(conf, gfx_hungrycat.width, gfx_hungrycat.height, gfx_hungrycat.pixel_data, projection_x, model_x);
+ tex_t *tex;
+ stage_t *s;
+
+ tex = ansr_tex_new("assets/hungrycat.ans", NULL);
+ s = tex_node_new_tex(conf, tex, projection_x, model_x);
+ tex_free(tex);
+
+ return s;
}
diff --git a/src/mask-node.c b/src/mask-node.c
index b5d75d5..b929460 100644
--- a/src/mask-node.c
+++ b/src/mask-node.c
@@ -16,8 +16,8 @@
#include <stage.h>
+#include "ansr-tex.h"
#include "mask-node.h"
-#include "gfx/gfx-mask.h"
#include "tex.h"
#include "tex-node.h"
@@ -26,7 +26,7 @@ static tex_t *mask_tex;
stage_t * mask_node_new(stage_conf_t *conf, m4f_t *projection_x, m4f_t *model_x)
{
if (!mask_tex)
- mask_tex = tex_new(gfx_mask.width, gfx_mask.height, gfx_mask.pixel_data);
+ mask_tex = ansr_tex_new("assets/mask.ans", "assets/mask.mask.ans");
return tex_node_new_tex(conf, mask_tex, projection_x, model_x);
}
diff --git a/src/tv-node.c b/src/tv-node.c
index 0ca999f..6eb12a2 100644
--- a/src/tv-node.c
+++ b/src/tv-node.c
@@ -16,8 +16,8 @@
#include <stage.h>
+#include "ansr-tex.h"
#include "tv-node.h"
-#include "gfx/gfx-tv.h"
#include "tex.h"
#include "tex-node.h"
@@ -26,7 +26,7 @@ static tex_t *tv_tex;
stage_t * tv_node_new(stage_conf_t *conf, m4f_t *projection_x, m4f_t *model_x)
{
if (!tv_tex)
- tv_tex = tex_new(gfx_tv.width, gfx_tv.height, gfx_tv.pixel_data);
+ tv_tex = ansr_tex_new("assets/tv.ans", "assets/tv.mask.ans");
return tex_node_new_tex(conf, tv_tex, projection_x, model_x);
}
diff --git a/src/virus-node.c b/src/virus-node.c
index 5d22718..7b3bf60 100644
--- a/src/virus-node.c
+++ b/src/virus-node.c
@@ -16,8 +16,8 @@
#include <stage.h>
+#include "ansr-tex.h"
#include "virus-node.h"
-#include "gfx/gfx-virus.h"
#include "tex.h"
#include "tex-node.h"
@@ -26,7 +26,7 @@ static tex_t *virus_tex;
stage_t * virus_node_new(stage_conf_t *conf, m4f_t *projection_x, m4f_t *model_x)
{
if (!virus_tex)
- virus_tex = tex_new(gfx_virus.width, gfx_virus.height, gfx_virus.pixel_data);
+ virus_tex = ansr_tex_new("assets/virus.ans", "assets/virus.mask.ans");
return tex_node_new_tex(conf, virus_tex, projection_x, model_x);
}
© All Rights Reserved