Merge branch 'master' of github.com:FacialTurd/The-Powder-Toy

This commit is contained in:
Simon 2010-09-11 11:57:20 +01:00
commit 42ec12d02f
2 changed files with 54 additions and 3 deletions

View File

@ -3,9 +3,9 @@ SOURCES := *.c
CFLAGS := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L CFLAGS := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L
OFLAGS := -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations OFLAGS := -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations
LFLAGS := -lSDL -lm -lbz2 LFLAGS := -lSDL -lm -lbz2
MFLAGS_SSE3 := -march=k8 -DX86 -DX86_SSE3 -msse3 MFLAGS_SSE3 := -march=native -DX86 -DX86_SSE3 -msse3
MFLAGS_SSE2 := -march=k8 -DX86 -DX86_SSE2 -msse2 MFLAGS_SSE2 := -march=native-DX86 -DX86_SSE2 -msse2
MFLAGS_SSE := -march=pentium3 -DX86 -DX86_SSE MFLAGS_SSE := -march=native -DX86 -DX86_SSE
FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -O2 -march=k8 -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lbz2 FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -O2 -march=k8 -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lbz2
COMPILER := gcc COMPILER := gcc
LINUX_TARG := powder-64-sse2 powder-sse powder-sse2 LINUX_TARG := powder-64-sse2 powder-sse powder-sse2

View File

@ -967,6 +967,15 @@ inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
#endif #endif
{ {
#ifdef OpenGL #ifdef OpenGL
if(x<0 || y<0 || x>=XRES || r>=YRES)
return;
if(a!=255)
{
glBegin (GL_QUADS);
glColor4ub(r,g,b,a);
glVertex2i(x, y);
}
vid[y*(XRES+BARSIZE)+x] = PIXRGB(r,g,b);
#else #else
pixel t; pixel t;
if(x<0 || y<0 || x>=XRES || y>=YRES) if(x<0 || y<0 || x>=XRES || y>=YRES)
@ -1167,6 +1176,48 @@ void draw_parts(pixel *vid)
float pt = R_TEMP; float pt = R_TEMP;
for(i = 0; i<NPART; i++) { for(i = 0; i<NPART; i++) {
#ifdef OpenGL #ifdef OpenGL
if(cmode == 6) //If fire mode
{
if(t==PT_MWAX)
{
for(x=-1; x<=1; x++)
{
for(y=-1; y<=1; y++)
{
if ((abs(x) == 0) && (abs(y) == 0))
blendpixel(vid,x+nx,y+ny,224,224,170,255);
else if (abs(y) != 0 && abs(x) != 0)
blendpixel(vid,x+nx,y+ny,224,224,170,20);
else
blendpixel(vid,x+nx,y+ny,224,224,170,40);
}
}
}
else if(t==PT_PLUT)
{
int tempx;
int tempy;
cr = 0x40;
cg = 0x70;
cb = 0x20;
blendpixel(vid, nx, ny, cr, cg, cb, 192);
blendpixel(vid, nx+1, ny, cr, cg, cb, 96);
blendpixel(vid, nx-1, ny, cr, cg, cb, 96);
blendpixel(vid, nx, ny+1, cr, cg, cb, 96);
blendpixel(vid, nx, ny-1, cr, cg, cb, 96);
for(tempx = 2; tempx < 10; tempx++) {
for(tempy = 2; tempy < 10; tempy++) {
blendpixel(vid, nx+tempx, ny-tempy, cr, cg, cb, 5);
blendpixel(vid, nx-tempx, ny+tempy, cr, cg, cb, 5);
blendpixel(vid, nx+tempx, ny+tempy, cr, cg, cb, 5);
blendpixel(vid, nx-tempx, ny-tempy, cr, cg, cb, 5);
}
}
}
}
if(parts[i].type) { if(parts[i].type) {
//Do nothing //Do nothing
t = parts[i].type; t = parts[i].type;