- Jo que se, moltes coses
This commit is contained in:
35
datos/convert.cpp
Normal file
35
datos/convert.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
FILE *f = fopen("graf.mif", "rb");
|
||||
fseek(f, 0, SEEK_END);
|
||||
int size = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
unsigned char *buffer = (unsigned char*)malloc(size);
|
||||
fread(buffer, size, 1, f);
|
||||
fclose(f);
|
||||
|
||||
unsigned char *p = buffer;
|
||||
int num_img = *p++;
|
||||
p += num_img*8;
|
||||
|
||||
for (int i=0; i<num_img; ++i)
|
||||
{
|
||||
p += 64000;
|
||||
for (int j=0; j<768; ++j)
|
||||
{
|
||||
unsigned char color = *p;
|
||||
*p = color << 2;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
f = fopen("graf.mif", "wb");
|
||||
fwrite(buffer, size, 1, f);
|
||||
fclose(f);
|
||||
|
||||
free(buffer);
|
||||
return 0;
|
||||
}
|
||||
337
datos/graf.mif
337
datos/graf.mif
File diff suppressed because one or more lines are too long
BIN
datos/sprites.dat
Executable file → Normal file
BIN
datos/sprites.dat
Executable file → Normal file
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 2.5 KiB |
Reference in New Issue
Block a user