Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 693 → Rev 700

/shark/trunk/ports/snapshot/snapshot.c
64,7 → 64,7
{
void* tmp;
 
if ((wx<=0) || (wy<=0) || (nbuff<=0) || (nbuff>15)){
if ((wx<=0) || (wy<=0) || (nbuff<0) || (nbuff>15)){
return NULL;
}
 
92,13 → 92,9
 
void snapshot_grab(int nbuff)
{
int i;
SYS_FLAGS f;
extern void *video_memory;
 
f = kern_fsave();
for (i = 0; i < sslot[nbuff].wx * sslot[nbuff].wy; i++)
*(int *)(sslot[nbuff].buff + i*2)= (int)grx_getpixel(i % sslot[nbuff].wx,i / sslot[nbuff].wx);
kern_frestore(f);
memcpy(sslot[nbuff].buff,video_memory,sslot[nbuff].wx * sslot[nbuff].wy * sslot[nbuff].bytesperpixel);
 
}
 
140,9 → 136,9
cprintf(out_st);
 
for (i = 0; i < sslot[nbuff].wx * sslot[nbuff].wy; i++) {
col_r = ((*(int *)(sslot[nbuff].buff + i*2) & 0xF800) >> 11) * 4;
col_g = ((*(int *)(sslot[nbuff].buff + i*2) & 0x07E0) >> 5) * 2;
col_b = (*(int *)(sslot[nbuff].buff + i*2) & 0x001F) * 4;
col_r = ((*(int *)(sslot[nbuff].buff + i*2) & 0xF800) >> 11) << 3;
col_g = ((*(int *)(sslot[nbuff].buff + i*2) & 0x07E0) >> 5) << 2;
col_b = (*(int *)(sslot[nbuff].buff + i*2) & 0x001F) << 3;
sprintf(out_st, "%d %d %d ", col_r, col_g, col_b);
DOS_fwrite(out_st, strlen(out_st), 1, outf);
}