comparison peluce/sprites.c @ 65:c6ecac58120a

Clean up some warnings.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 06 Aug 2011 10:41:57 +0300
parents acb5694e93d9
children
comparison
equal deleted inserted replaced
64:c272f66c5eb8 65:c6ecac58120a
1 #include <stdio.h>
2 #include <stdlib.h>
3
4 #include "pwpdemo.h" 1 #include "pwpdemo.h"
5
6 typedef struct
7 {
8 int width,height;
9 u8*pict;
10 u8*mask;
11 }sprite;
12 2
13 #include "sprites.h" 3 #include "sprites.h"
14 4
15 /* 5 /*
16 void rotozoom(int x0,int y0, 6 void rotozoom(int x0,int y0,
67 */ 57 */
68 58
69 void zoomsprite(int x0,int y0,sprite*sp,int xzoom,int yzoom) 59 void zoomsprite(int x0,int y0,sprite*sp,int xzoom,int yzoom)
70 { 60 {
71 int xdim,ydim, 61 int xdim,ydim,
72 xo0=0,yo0=0,x,y,ptr; 62 xo0=0,yo0=0,x,y;
73 63
74 if(xzoom<=32 && yzoom<=32)return; 64 if(xzoom<=32 && yzoom<=32)return;
75 65
76 xdim=(sp->width<<8)/xzoom; 66 xdim=(sp->width<<8)/xzoom;
77 ydim=(sp->height<<8)/yzoom; 67 ydim=(sp->height<<8)/yzoom;
109 99
110 for(y=0;y<ydim;y++) 100 for(y=0;y<ydim;y++)
111 { 101 {
112 int linebase=(yo0>>8)*sp->width; 102 int linebase=(yo0>>8)*sp->width;
113 int xo=xo0; 103 int xo=xo0;
114 104 u8*dd=d;
115 {u8*dd=d;
116 for(x=xdim;x;x--) 105 for(x=xdim;x;x--)
117 { 106 {
118 int a=*dd,z=linebase+(xo>>8); 107 int a=*dd,z=linebase+(xo>>8);
119 *dd=(a&sp->mask[z])|sp->pict[z]; 108 *dd=(a&sp->mask[z])|sp->pict[z];
120 xo+=xzoom; 109 xo+=xzoom;
121 dd++; 110 dd++;
122 }} 111 }
123 yo0+=yzoom; 112 yo0+=yzoom;
124 d+=pwplib.videobuf.width; 113 d+=pwplib.videobuf.width;
125 }} 114 }}
126 } 115 }
127 116
135 ); 124 );
136 } 125 }
137 126
138 void metsae(int t,int mode) 127 void metsae(int t,int mode)
139 { 128 {
140 int i,x; 129 int i;
141 130 sprite*mo[]={&kuusi};
142 const sprite*mo[]={&kuusi};
143 const int mosiz[]={128}; 131 const int mosiz[]={128};
144 const int mostep[]={64}; 132 const int mostep[]={64};
145 133
146 for(i=0;i<512;i+=mostep[mode]) 134 for(i=0;i<512;i+=mostep[mode])
147 { 135 {
184 zoomsprite_gen(0+ttt,48,(tminus&16)?pum[kode][0]:pum[kode][1],zoom); 172 zoomsprite_gen(0+ttt,48,(tminus&16)?pum[kode][0]:pum[kode][1],zoom);
185 } 173 }
186 174
187 void pelubounce(int t,int bouncemode) 175 void pelubounce(int t,int bouncemode)
188 { 176 {
177 /*
189 const unsigned char bfunc[32]={ 178 const unsigned char bfunc[32]={
190 32,32,32,36,38,40,42,44,50,60,61,62,62,63,63,63, 179 32,32,32,36,38,40,42,44,50,60,61,62,62,63,63,63,
191 63,63,63,62,61,60,50,40,32,33,34,35,34,33,32,32 180 63,63,63,62,61,60,50,40,32,33,34,35,34,33,32,32
192 }; 181 };
193 const sprite*poo[3]={&peluface0,&peluface1,&peluface2}; 182 */
183 sprite*poo[3]={&peluface0,&peluface1,&peluface2};
194 184
195 zoomsprite_gen(0,0,bouncemode?&sieni:poo[(t>>6)%3],40+((t-2560)&63)); 185 zoomsprite_gen(0,0,bouncemode?&sieni:poo[(t>>6)%3],40+((t-2560)&63));
196 } 186 }
197 187
198 void blaah(int t) 188 void blaah(int t)