Few changes to source and makefile
This commit is contained in:
parent
1a724d6f7f
commit
077fbb56ae
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_SSE2 := -march=k8 -DX86 -DX86_SSE2
|
||||
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
|
||||
LINUX_TARG := powder-64-sse2 powder-sse powder-sse2
|
||||
WIN32_TARG := powder-sse.exe powder-sse2.exe
|
||||
|
||||
powder: $(SOURCES) $(HEADERS)
|
||||
$(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)
|
||||
$(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN32
|
||||
@ -57,7 +60,7 @@ powder-sse.exe: $(SOURCES) $(HEADERS) powder-res.o
|
||||
strip $@
|
||||
chmod 0644 $@
|
||||
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 $@
|
||||
powder-x-mt: $(SOURCES) $(HEADERS)
|
||||
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;
|
||||
}
|
||||
|
||||
unsigned clamp_flt(float f, float min, float max)
|
||||
inline unsigned clamp_flt(float f, float min, float max)
|
||||
{
|
||||
if(f<min)
|
||||
return 0;
|
||||
@ -337,7 +337,7 @@ unsigned clamp_flt(float f, float min, float max)
|
||||
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)
|
||||
return min;
|
||||
if(f>max)
|
||||
@ -871,7 +871,7 @@ void kill_part(int 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;
|
||||
|
||||
@ -1061,7 +1061,7 @@ void delete_part(int x, int y)
|
||||
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;
|
||||
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);
|
||||
}
|
||||
}
|
||||
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)];
|
||||
if((pmr>>8) < NPART && (pmr>>8) >= 0){
|
||||
return parts[pmr>>8].type;
|
||||
@ -3457,7 +3457,7 @@ void *build_thumb(int *size, int bzip2)
|
||||
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)
|
||||
{
|
||||
unsigned char *d,*c=thumb;
|
||||
@ -4339,7 +4339,7 @@ void del_stamp(int d)
|
||||
|
||||
#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;
|
||||
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);
|
||||
}
|
||||
|
||||
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;
|
||||
char *rp = font_data + font_ptrs[c];
|
||||
|
Loading…
Reference in New Issue
Block a user