Mercurial > hg > forks > pwpunix
changeset 65:c6ecac58120a
Clean up some warnings.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 06 Aug 2011 10:41:57 +0300 |
parents | c272f66c5eb8 |
children | 1bd4e39c600b |
files | peluce/Makefile peluce/font.c peluce/main.c peluce/pwpdemo.h peluce/sprites.c |
diffstat | 5 files changed, 34 insertions(+), 41 deletions(-) [+] |
line wrap: on
line diff
--- 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)
--- 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; }
--- 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 <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -#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(); }
--- 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 <stdio.h> #include <stdlib.h> #include <string.h> @@ -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 */
--- 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 <stdio.h> -#include <stdlib.h> - #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)); }