# HG changeset patch # User Matti Hamalainen # Date 1312616517 -10800 # Node ID c6ecac58120adeba65e3ad4e4d8696cd7936c9d6 # Parent c272f66c5eb8798729feb4d41fe9f076a58f1bf2 Clean up some warnings. diff -r c272f66c5eb8 -r c6ecac58120a peluce/Makefile --- a/peluce/Makefile Sat Aug 06 10:41:08 2011 +0300 +++ b/peluce/Makefile Sat Aug 06 10:41:57 2011 +0300 @@ -14,6 +14,6 @@ sprites.o: sprites.c sprites.h $(CC) $(CFLAGS) -c -o $@ $< -peluce$(BINEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) +peluce$(BINEXT): $(OBJS) demo.h + $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) diff -r c272f66c5eb8 -r c6ecac58120a peluce/font.c --- a/peluce/font.c Sat Aug 06 10:41:08 2011 +0300 +++ b/peluce/font.c Sat Aug 06 10:41:57 2011 +0300 @@ -1,13 +1,6 @@ #include "pwpdemo.h" #include "font.h" -typedef struct -{ - int width,height; - u8*pict; - u8*mask; -}sprite; - u8*fontbuf_mask, *fontbuf_pict; sprite fontbuf; @@ -59,6 +52,7 @@ void textoff(int t) { + (void) t; texter.zoomfrom=texter.zoomto=2048; texter.zoomstep=0; } diff -r c272f66c5eb8 -r c6ecac58120a peluce/main.c --- a/peluce/main.c Sat Aug 06 10:41:08 2011 +0300 +++ b/peluce/main.c Sat Aug 06 10:41:57 2011 +0300 @@ -1,12 +1,4 @@ -#include -#include -#include -#include - -#include "../pwplib/pwplib.h" - -#define MAX(a,b) ((a)<(b)?(b):(a)) -#define MIN(a,b) ((a)>(b)?(b):(a)) +#include "pwpdemo.h" struct { @@ -102,10 +94,10 @@ pwplib_prep_attr(); demovar.flagz=8|16; - - {demovar.dsgtime=0; - demovar.endfxt=1<<30; - demovar.metsaemode=0; + demovar.dsgtime=0; + demovar.endfxt=1<<30; + demovar.metsaemode=0; + while(!quit) { int t=pwplib_timer(); @@ -449,7 +441,6 @@ pwplib_dump_rast(); if(!quit)pwplib_loopflush(); } - } pwplib_end(); } diff -r c272f66c5eb8 -r c6ecac58120a peluce/pwpdemo.h --- a/peluce/pwpdemo.h Sat Aug 06 10:41:08 2011 +0300 +++ b/peluce/pwpdemo.h Sat Aug 06 10:41:57 2011 +0300 @@ -1,3 +1,6 @@ +#ifndef PWPDEMO_H +#define PWPDEMO_H + #include #include #include @@ -10,3 +13,18 @@ #define MAX(a,b) ((a)>(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b)) + + +void initfontbuf(); +void setfontbuf(char*txt,int blend); + + +typedef struct { + int width,height; + u8*pict; + u8*mask; +} sprite; + +void zoomsprite_gen(int x0,int y0,sprite*sp,int zoom); + +#endif /* PWPDEMO_H */ diff -r c272f66c5eb8 -r c6ecac58120a peluce/sprites.c --- a/peluce/sprites.c Sat Aug 06 10:41:08 2011 +0300 +++ b/peluce/sprites.c Sat Aug 06 10:41:57 2011 +0300 @@ -1,15 +1,5 @@ -#include -#include - #include "pwpdemo.h" -typedef struct -{ - int width,height; - u8*pict; - u8*mask; -}sprite; - #include "sprites.h" /* @@ -69,7 +59,7 @@ void zoomsprite(int x0,int y0,sprite*sp,int xzoom,int yzoom) { int xdim,ydim, - xo0=0,yo0=0,x,y,ptr; + xo0=0,yo0=0,x,y; if(xzoom<=32 && yzoom<=32)return; @@ -111,15 +101,14 @@ { int linebase=(yo0>>8)*sp->width; int xo=xo0; - - {u8*dd=d; + u8*dd=d; for(x=xdim;x;x--) { int a=*dd,z=linebase+(xo>>8); *dd=(a&sp->mask[z])|sp->pict[z]; xo+=xzoom; dd++; - }} + } yo0+=yzoom; d+=pwplib.videobuf.width; }} @@ -137,9 +126,8 @@ void metsae(int t,int mode) { - int i,x; - - const sprite*mo[]={&kuusi}; + int i; + sprite*mo[]={&kuusi}; const int mosiz[]={128}; const int mostep[]={64}; @@ -186,11 +174,13 @@ void pelubounce(int t,int bouncemode) { +/* const unsigned char bfunc[32]={ 32,32,32,36,38,40,42,44,50,60,61,62,62,63,63,63, 63,63,63,62,61,60,50,40,32,33,34,35,34,33,32,32 }; - const sprite*poo[3]={&peluface0,&peluface1,&peluface2}; +*/ + sprite*poo[3]={&peluface0,&peluface1,&peluface2}; zoomsprite_gen(0,0,bouncemode?&sieni:poo[(t>>6)%3],40+((t-2560)&63)); }