#include "demo.h"
#include "screen.h"
-#include "tinyfps.h"
static int init(void);
static void destroy(void);
static void start(long trans_time);
-static void stop(long trans_time);
static void draw(void);
static struct screen scr = {
init,
destroy,
start,
- stop,
+ 0,
draw
};
-static struct point {
+struct point {
int x, y;
};
const float rgbMul[9] = { 1.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 1.0f};
- initFpsFonts();
heightmap = malloc(sizeof(*heightmap) * fb_size);
lightmap = malloc(sizeof(*lightmap) * fb_size);
const float offsetPower = 2.0f;
int dx, dy, xp, yp;
- dx = (int)((heightmap[i] - heightmap[i + 1]) * offsetPower);
- dy = (int)((heightmap[i] - heightmap[i + fb_width]) * offsetPower);
+ dx = i < fb_size - 1 ? (int)((heightmap[i] - heightmap[i + 1]) * offsetPower) : 0;
+ dy = i < fb_size - fb_width ? (int)((heightmap[i] - heightmap[i + fb_width]) * offsetPower) : 0;
xp = x + dx;
if (xp < 0) xp = 0;
startingTime = time_msec;
}
-static void stop(long trans_time)
-{
-}
-
static void eraseArea(struct point *p, int width, int height)
{
int x, y, dx;
renderLights();
renderBump((unsigned short*)vmem_back);
- drawFps((unsigned short*)vmem_back);
-
swap_buffers(0);
}