forked from kdx/jtmm2-old
32 lines
647 B
C
32 lines
647 B
C
#include <gint/display.h>
|
|
|
|
#include "level.h"
|
|
#include "camera.h"
|
|
|
|
void level_step(const Level *level)
|
|
{
|
|
}
|
|
|
|
void level_draw(const Level *level, Camera *camera)
|
|
{
|
|
layer_draw(level, camera, 0);
|
|
}
|
|
|
|
void layer_draw(const Level *level, Camera *camera, uint layer_id)
|
|
{
|
|
const uint8_t *layer = level->layers[layer_id];
|
|
for (uint y = 0; y < level->height; ++y)
|
|
{
|
|
for (uint x = 0; x < level->width; ++x)
|
|
{
|
|
const uint8_t cell = layer[x + y * level->width];
|
|
#ifdef FX9860G
|
|
dpixel(x, y, (cell == 1) ? C_LIGHT : C_BLACK);
|
|
#endif /* FX9860G */
|
|
#ifdef FXCG50
|
|
dpixel(x, y, (cell == 1) ? C_RED : C_BLACK);
|
|
#endif /* FXCG50 */
|
|
}
|
|
}
|
|
}
|