X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fbump.c;h=a6f7aadcb929e8f5cb82f8a5ba693b6544a5ae0d;hb=21c4bd88e7ddd930ac83c54cbe7399af0e188b67;hp=228e1414d92f8cdc815f042d6baa3bd5e81c5c24;hpb=ea62e857029bdebd88b35beea372c144382400b9;p=dosdemo diff --git a/src/bump.c b/src/bump.c index 228e141..a6f7aad 100644 --- a/src/bump.c +++ b/src/bump.c @@ -7,12 +7,10 @@ #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 = { @@ -20,11 +18,11 @@ static struct screen scr = { init, destroy, start, - stop, + 0, draw }; -static struct point { +struct point { int x, y; }; @@ -61,7 +59,6 @@ static int init(void) 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); @@ -91,8 +88,8 @@ static int init(void) 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; @@ -143,10 +140,6 @@ static void start(long trans_time) startingTime = time_msec; } -static void stop(long trans_time) -{ -} - static void eraseArea(struct point *p, int width, int height) { int x, y, dx; @@ -270,7 +263,5 @@ static void draw(void) renderLights(); renderBump((unsigned short*)vmem_back); - drawFps((unsigned short*)vmem_back); - swap_buffers(0); }