Compare commits

..

2 Commits

Author SHA1 Message Date
1f80d22e72 tools/png_to_nbpp: add support for 1bpp 2023-07-29 03:51:32 +00:00
ab4d133820 main: add ledge jumps 2023-07-29 03:41:51 +00:00
4 changed files with 18 additions and 55 deletions

View File

@ -54,11 +54,11 @@ gen/%.cpp: gen/%.hpp $(GEN_PYTHON_SOURCE)
res/%.2bpp: pokered/%.png
@mkdir -p $(dir $@)
python tools/png_to_nbpp.py 2 $@ $<
python tools/png_to_nbpp.py $< 2 $@
res/gfx/sprites/%.2bpp: pokered/gfx/sprites/%.png
@mkdir -p $(dir $@)
python tools/png_to_nbpp_sprite.py 2 $@ $<
python tools/png_to_nbpp_sprite.py $< 2 $@
%.2bpp.h:
$(BUILD_BINARY_H)

View File

@ -1,35 +0,0 @@
/*
data/tilesets/ledge_tiles.asm
; player direction, tile player standing on, ledge tile, input required
db SPRITE_FACING_DOWN, $2C, $37, D_DOWN
db SPRITE_FACING_DOWN, $39, $36, D_DOWN
db SPRITE_FACING_DOWN, $39, $37, D_DOWN
db SPRITE_FACING_LEFT, $2C, $27, D_LEFT
db SPRITE_FACING_LEFT, $39, $27, D_LEFT
db SPRITE_FACING_RIGHT, $2C, $0D, D_RIGHT
db SPRITE_FACING_RIGHT, $2C, $1D, D_RIGHT
db SPRITE_FACING_RIGHT, $39, $0D, D_RIGHT
*/
#pragma once
#include "actor.hpp"
struct ledge_tile_t {
enum actor_t::direction direction;
uint8_t actor;
uint8_t collision;
};
static const ledge_tile_t ledge_tiles[] = {
{actor_t::down, 0x2c, 0x37},
{actor_t::down, 0x39, 0x36},
{actor_t::down, 0x39, 0x37},
{actor_t::left, 0x2c, 0x27},
{actor_t::left, 0x39, 0x27},
{actor_t::right, 0x2c, 0x0d},
{actor_t::right, 0x2c, 0x1d},
{actor_t::right, 0x39, 0x0d},
};
constexpr uint8_t ledge_tiles_length = (sizeof (ledge_tiles)) / (sizeof (ledge_tile_t));

View File

@ -47,14 +47,13 @@ def debug(buf, bpp):
if (row % 8 == 7):
print()
bpp = int(sys.argv[1])
out_path = sys.argv[2]
assert len(sys.argv) >= 4, sys.argv
in_path = sys.argv[1]
bpp = int(sys.argv[2])
out_path = sys.argv[3]
with open(out_path, 'wb') as f:
for in_path in sys.argv[3:]:
im = Image.open(in_path)
buf = convert(im, bpp)
if 'NBPP_DEBUG' in os.environ:
im = Image.open(in_path)
buf = convert(im, bpp)
if 'NBPP_DEBUG' in os.environ:
debug(buf, bpp)
with open(out_path, 'wb') as f:
f.write(buf)

View File

@ -56,14 +56,13 @@ def debug(buf, bpp):
if (row % cell_height == (cell_height - 1)):
print()
bpp = int(sys.argv[1])
out_path = sys.argv[2]
assert len(sys.argv) >= 4, sys.argv
in_path = sys.argv[1]
bpp = int(sys.argv[2])
out_path = sys.argv[3]
with open(out_path, 'wb') as f:
for in_path in sys.argv[3:]:
im = Image.open(in_path)
buf = convert(im, bpp)
if 'NBPP_DEBUG' in os.environ:
im = Image.open(in_path)
buf = convert(im, bpp)
if 'NBPP_DEBUG' in os.environ:
debug(buf, bpp)
with open(out_path, 'wb') as f:
f.write(buf)