2021-05-12 17:38:11 +00:00
|
|
|
#include "gen/texgen.h"
|
|
|
|
#include "world/world.h"
|
2021-07-18 18:30:27 +00:00
|
|
|
#include "zpl.h"
|
2022-09-29 12:02:22 +00:00
|
|
|
#include "utils/raylib_helpers.h"
|
2021-11-04 12:34:15 +00:00
|
|
|
|
|
|
|
Texture2D texgen_build_anim(asset_id id, int64_t counter) {
|
|
|
|
(void)counter;
|
2021-08-25 21:36:20 +00:00
|
|
|
switch (id) {
|
2022-09-27 11:58:35 +00:00
|
|
|
case ASSET_WATER: {
|
|
|
|
Image img = LoadImageEco("water");
|
|
|
|
ImageColorBrightness(&img, zpl_abs((counter % 64 - 32)*2));
|
|
|
|
return Image2TexEco(img);
|
|
|
|
}break;
|
2022-09-28 18:40:59 +00:00
|
|
|
|
2021-11-04 12:34:15 +00:00
|
|
|
default: return GenColorEco(PINK); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Texture2D texgen_build_sprite(asset_id id) {
|
|
|
|
switch (id) {
|
2022-08-09 14:46:23 +00:00
|
|
|
case ASSET_BLANK: return GenColorEco(WHITE); break;
|
2021-11-04 12:34:15 +00:00
|
|
|
case ASSET_BUILDMODE_HIGHLIGHT: return GenColorEco(WHITE); break;
|
2022-09-28 18:40:59 +00:00
|
|
|
|
2021-11-04 12:34:15 +00:00
|
|
|
// NOTE(zaklaus): items
|
|
|
|
case ASSET_DEMO_ICEMAKER: return LoadTexEco("demo_icemaker");
|
2022-09-28 18:40:59 +00:00
|
|
|
|
2021-11-02 11:49:03 +00:00
|
|
|
// NOTE(zaklaus): blocks
|
2021-11-04 12:34:15 +00:00
|
|
|
case ASSET_FENCE: return LoadTexEco("fence");
|
|
|
|
case ASSET_GROUND: return LoadTexEco("grass");
|
|
|
|
case ASSET_DIRT: return LoadTexEco("dirt");
|
|
|
|
case ASSET_WALL: return LoadTexEco("asphalt");
|
2021-11-02 11:49:03 +00:00
|
|
|
case ASSET_HILL_SNOW:
|
2021-11-04 12:34:15 +00:00
|
|
|
case ASSET_HILL: return LoadTexEco("rock");
|
|
|
|
case ASSET_LAVA: return LoadTexEco("lava");
|
|
|
|
case ASSET_WOOD: return LoadTexEco("wood");
|
|
|
|
case ASSET_TREE: return LoadTexEco("tree");
|
2022-09-27 11:58:35 +00:00
|
|
|
// case ASSET_WATER: return LoadTexEco("water");
|
2022-09-14 06:45:01 +00:00
|
|
|
|
2021-11-02 17:58:55 +00:00
|
|
|
case ASSET_BELT:
|
2021-11-04 12:34:15 +00:00
|
|
|
case ASSET_BELT_RIGHT: return LoadTexEco("belt_right");
|
|
|
|
case ASSET_BELT_LEFT: return LoadTexEco("belt_left");
|
|
|
|
case ASSET_BELT_UP: return LoadTexEco("belt_up");
|
|
|
|
case ASSET_BELT_DOWN: return LoadTexEco("belt_down");
|
2022-09-28 18:40:59 +00:00
|
|
|
|
2022-08-09 15:32:58 +00:00
|
|
|
// NOTE(zaklaus): devices
|
|
|
|
case ASSET_CHEST: return LoadTexEco("chest");
|
2022-09-28 18:40:59 +00:00
|
|
|
|
2021-11-04 12:34:15 +00:00
|
|
|
default: return GenColorEco(PINK); break;
|
2021-08-25 21:36:20 +00:00
|
|
|
}
|
2021-05-12 17:38:11 +00:00
|
|
|
}
|