mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-09 18:06:33 +02:00
fix font editor being unable to display chars > \x7F, c++ & warning fixes
This commit is contained in:
@@ -1,21 +1,21 @@
|
|||||||
|
|
||||||
editor: editor.c
|
editor: editor.c
|
||||||
gcc -oeditor -DSCALE=1 -DFONTEDITOR editor.c -lSDL -lm -O3 -ffast-math -march=k8
|
gcc -oeditor -DSCALE=1 -DFONTEDITOR editor.c -lSDL -lm -O3 -ffast-math -march=k8 -Wno-unused-result
|
||||||
|
|
||||||
editor.exe: editor.c
|
editor.exe: editor.c
|
||||||
i686-w64-mingw32-gcc -oeditor.exe -DSCALE=1 -DFONTEDITOR editor.c -lmingw32 -lm -lSDLmain -lSDL -O3 -ffast-math -march=k8 -mwindows
|
i686-w64-mingw32-gcc -oeditor.exe -DSCALE=1 -DFONTEDITOR editor.c -lmingw32 -lm -lSDLmain -lSDL -O3 -ffast-math -march=k8 -mwindows -Wno-unused-result
|
||||||
|
|
||||||
packer: packer.c
|
packer: packer.c
|
||||||
gcc -opacker -DFONTEDITOR packer.c -lm -O3 -ffast-math -march=k8
|
gcc -opacker -DFONTEDITOR packer.c -lm -O3 -ffast-math -march=k8 -Wno-unused-result
|
||||||
|
|
||||||
packer.exe: packer.c
|
packer.exe: packer.c
|
||||||
i686-w64-mingw32-gcc -opacker.exe -DFONTEDITOR packer.c -lm -O3 -ffast-math -march=k8
|
i686-w64-mingw32-gcc -opacker.exe -DFONTEDITOR packer.c -lm -O3 -ffast-math -march=k8 -Wno-unused-result
|
||||||
|
|
||||||
unpacker: unpacker.c
|
unpacker: unpacker.c
|
||||||
gcc -ounpacker -DFONTEDITOR unpacker.c -lm -O3 -ffast-math -march=k8
|
gcc -ounpacker -DFONTEDITOR unpacker.c -lm -O3 -ffast-math -march=k8 -Wno-unused-result
|
||||||
|
|
||||||
unpacker.exe: unpacker.c
|
unpacker.exe: unpacker.c
|
||||||
i686-w64-mingw32-gcc -ounpacker.exe -DFONTEDITOR unpacker.c -lm -O3 -ffast-math -march=k8
|
i686-w64-mingw32-gcc -ounpacker.exe -DFONTEDITOR unpacker.c -lm -O3 -ffast-math -march=k8 -Wno-unused-result
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f editor packer unpacker editor.exe packer.exe unpacker.exe
|
rm -f editor packer unpacker editor.exe packer.exe unpacker.exe
|
||||||
|
@@ -35,7 +35,7 @@ void blendpixel(unsigned *vid, int x, int y, int r, int g, int b, int a)
|
|||||||
vid[y*XRES+x] = (r<<16)|(g<<8)|b;
|
vid[y*XRES+x] = (r<<16)|(g<<8)|b;
|
||||||
}
|
}
|
||||||
|
|
||||||
int drawchar(unsigned *vid, int x, int y, int c, int r, int g, int b)
|
int drawchar(unsigned *vid, int x, int y, unsigned char c, int r, int g, int b)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
if (color[c])
|
if (color[c])
|
||||||
@@ -50,7 +50,7 @@ int drawchar(unsigned *vid, int x, int y, int c, int r, int g, int b)
|
|||||||
return x + width[c];
|
return x + width[c];
|
||||||
}
|
}
|
||||||
|
|
||||||
int drawtext(unsigned *vid, int x, int y, char *s, int r, int g, int b)
|
int drawtext(unsigned *vid, int x, int y, const char *s, int r, int g, int b)
|
||||||
{
|
{
|
||||||
for (; *s; s++)
|
for (; *s; s++)
|
||||||
x = drawchar(vid, x, y, *s, r, g, b);
|
x = drawchar(vid, x, y, *s, r, g, b);
|
||||||
@@ -205,11 +205,11 @@ int sdl_poll()
|
|||||||
* MAIN PROGRAM *
|
* MAIN PROGRAM *
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
|
|
||||||
char *tag = "(c) 2008 Stanislaw Skowronek";
|
const char *tag = "(c) 2008 Stanislaw Skowronek";
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
unsigned *vid_buf = calloc(XRES*YRES, sizeof(unsigned));
|
unsigned *vid_buf = (unsigned*)calloc(XRES*YRES, sizeof(unsigned));
|
||||||
int x, y, b = 0, lb, c = 0xA0, i, j, dc = 0;
|
int x, y, b = 0, lb, c = 0xA0, i, j, dc = 0;
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
char hex[18] = "";
|
char hex[18] = "";
|
||||||
|
Reference in New Issue
Block a user