mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 19:29:52 +02:00
Few changes to source and makefile
This commit is contained in:
5
Makefile
5
Makefile
@@ -10,12 +10,15 @@ MFLAGS_MT := -march=k8 -DX86 -DX86_SSE3 -DMT -msse3
|
|||||||
MFLAGS_SSE3 := -march=k8 -DX86 -DX86_SSE3 -msse3
|
MFLAGS_SSE3 := -march=k8 -DX86 -DX86_SSE3 -msse3
|
||||||
MFLAGS_SSE2 := -march=k8 -DX86 -DX86_SSE2
|
MFLAGS_SSE2 := -march=k8 -DX86 -DX86_SSE2
|
||||||
MFLAGS_SSE := -march=pentium3 -DX86 -DX86_SSE
|
MFLAGS_SSE := -march=pentium3 -DX86 -DX86_SSE
|
||||||
|
FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -O2 -march=k8 -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lpthread -lbz2
|
||||||
COMPILER := gcc
|
COMPILER := gcc
|
||||||
LINUX_TARG := powder-64-sse2 powder-sse powder-sse2
|
LINUX_TARG := powder-64-sse2 powder-sse powder-sse2
|
||||||
WIN32_TARG := powder-sse.exe powder-sse2.exe
|
WIN32_TARG := powder-sse.exe powder-sse2.exe
|
||||||
|
|
||||||
powder: $(SOURCES) $(HEADERS)
|
powder: $(SOURCES) $(HEADERS)
|
||||||
$(COMPILER) -DINTERNAL -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64
|
$(COMPILER) -DINTERNAL -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64
|
||||||
|
powder-debug: $(SOURCES) $(HEADERS)
|
||||||
|
$(COMPILER) -m64 -o$@ $(FLAGS_DBUG) -DLIN64 $(SOURCES)
|
||||||
|
|
||||||
powder-sse3: $(SOURCES) $(HEADERS)
|
powder-sse3: $(SOURCES) $(HEADERS)
|
||||||
$(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN32
|
$(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN32
|
||||||
@@ -57,7 +60,7 @@ powder-sse.exe: $(SOURCES) $(HEADERS) powder-res.o
|
|||||||
strip $@
|
strip $@
|
||||||
chmod 0644 $@
|
chmod 0644 $@
|
||||||
powder-x: $(SOURCES) $(HEADERS)
|
powder-x: $(SOURCES) $(HEADERS)
|
||||||
gcc -o $@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS) $(SOURCES) -lSDLmain -DMACOSX -DPIX32BGRA -arch x86_64 -framework Cocoa
|
gcc -o $@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS) $(SOURCES) -lSDLmain -DMACOSX -DPIX32BGRA -arch x86_64 -framework Cocoa -ggdb
|
||||||
strip $@
|
strip $@
|
||||||
powder-x-mt: $(SOURCES) $(HEADERS)
|
powder-x-mt: $(SOURCES) $(HEADERS)
|
||||||
gcc -o $@ $(CFLAGS) $(OFLAGS) $(LFLAGS_MT) $(MFLAGS_MT) $(SOURCES) -lSDLmain -DMACOSX -DPIX32BGRA -arch x86_64 -framework Cocoa
|
gcc -o $@ $(CFLAGS) $(OFLAGS) $(LFLAGS_MT) $(MFLAGS_MT) $(SOURCES) -lSDLmain -DMACOSX -DPIX32BGRA -arch x86_64 -framework Cocoa
|
||||||
|
16
powder.c
16
powder.c
@@ -328,7 +328,7 @@ void *update_air_th(void *arg)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned clamp_flt(float f, float min, float max)
|
inline unsigned clamp_flt(float f, float min, float max)
|
||||||
{
|
{
|
||||||
if(f<min)
|
if(f<min)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -337,7 +337,7 @@ unsigned clamp_flt(float f, float min, float max)
|
|||||||
return (int)(255.0f*(f-min)/(max-min));
|
return (int)(255.0f*(f-min)/(max-min));
|
||||||
}
|
}
|
||||||
|
|
||||||
float restrict_flt(float f, float min, float max){
|
inline float restrict_flt(float f, float min, float max){
|
||||||
if(f<min)
|
if(f<min)
|
||||||
return min;
|
return min;
|
||||||
if(f>max)
|
if(f>max)
|
||||||
@@ -871,7 +871,7 @@ void kill_part(int i)
|
|||||||
pfree = i;
|
pfree = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int create_part(int p, int x, int y, int t)
|
inline int create_part(int p, int x, int y, int t)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -1061,7 +1061,7 @@ void delete_part(int x, int y)
|
|||||||
pmap[y][x] = 0; // just in case
|
pmap[y][x] = 0; // just in case
|
||||||
}
|
}
|
||||||
|
|
||||||
void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
|
inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
|
||||||
{
|
{
|
||||||
pixel t;
|
pixel t;
|
||||||
if(x<0 || y<0 || x>=XRES || y>=YRES)
|
if(x<0 || y<0 || x>=XRES || y>=YRES)
|
||||||
@@ -1205,7 +1205,7 @@ void set_emap(int x, int y)
|
|||||||
set_emap(x, y+1);
|
set_emap(x, y+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int parts_avg(int ci, int ni){
|
inline int parts_avg(int ci, int ni){
|
||||||
int pmr = pmap[(int)((parts[ci].y + parts[ni].y)/2)][(int)((parts[ci].x + parts[ni].x)/2)];
|
int pmr = pmap[(int)((parts[ci].y + parts[ni].y)/2)][(int)((parts[ci].x + parts[ni].x)/2)];
|
||||||
if((pmr>>8) < NPART && (pmr>>8) >= 0){
|
if((pmr>>8) < NPART && (pmr>>8) >= 0){
|
||||||
return parts[pmr>>8].type;
|
return parts[pmr>>8].type;
|
||||||
@@ -3457,7 +3457,7 @@ void *build_thumb(int *size, int bzip2)
|
|||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
|
inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
|
||||||
int render_thumb(void *thumb, int size, int bzip2, pixel *vid_buf, int px, int py, int scl)
|
int render_thumb(void *thumb, int size, int bzip2, pixel *vid_buf, int px, int py, int scl)
|
||||||
{
|
{
|
||||||
unsigned char *d,*c=thumb;
|
unsigned char *d,*c=thumb;
|
||||||
@@ -4339,7 +4339,7 @@ void del_stamp(int d)
|
|||||||
|
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
|
|
||||||
void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
|
inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
|
||||||
{
|
{
|
||||||
pixel t;
|
pixel t;
|
||||||
if(x<0 || y<0 || x>=XRES+BARSIZE || y>=YRES+MENUSIZE)
|
if(x<0 || y<0 || x>=XRES+BARSIZE || y>=YRES+MENUSIZE)
|
||||||
@@ -4353,7 +4353,7 @@ void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
|
|||||||
vid[y*(XRES+BARSIZE)+x] = PIXRGB(r,g,b);
|
vid[y*(XRES+BARSIZE)+x] = PIXRGB(r,g,b);
|
||||||
}
|
}
|
||||||
|
|
||||||
int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a)
|
inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a)
|
||||||
{
|
{
|
||||||
int i, j, w, bn = 0, ba = 0;
|
int i, j, w, bn = 0, ba = 0;
|
||||||
char *rp = font_data + font_ptrs[c];
|
char *rp = font_data + font_ptrs[c];
|
||||||
|
Reference in New Issue
Block a user