Revert "does not compile at the moment, cause unknown, also. always use // for one line comments"

This reverts commit 32b1a2c3ab.
This commit is contained in:
Simon 2010-09-03 00:06:18 +01:00
parent 32b1a2c3ab
commit 274383105a
7 changed files with 46 additions and 32 deletions

View File

@ -1,5 +1,5 @@
SOURCES := *.c
HEADERS := *.h
HEADERS := font.h hmap.h http.h md5.h icon.h update.h version.h
CFLAGS := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L
OFLAGS := -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations
@ -11,7 +11,7 @@ MFLAGS_SSE3 := -march=k8 -DX86 -DX86_SSE3 -msse3
MFLAGS_SSE2 := -march=k8 -DX86 -DX86_SSE2 -msse2
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 := clang
COMPILER := gcc
LINUX_TARG := powder-64-sse2 powder-sse powder-sse2
WIN32_TARG := powder-sse.exe powder-sse2.exe

View File

@ -756,11 +756,11 @@ void draw_menu(pixel *vid_buf, int i, int hover)
}
}
/*#ifdef WIN32
#ifdef WIN32
_inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
#else*/
#else
inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
//#endif
#endif
{
pixel t;
if(x<0 || y<0 || x>=XRES+BARSIZE || y>=YRES+MENUSIZE)
@ -799,7 +799,7 @@ inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a)
return x + w;
}
int drawtext(pixel *vid, int x, int y, const char *s, int r, int g, int b, int a)
int drawtext(pixel *vid, int x, int y, char *s, int r, int g, int b, int a)
{
#ifdef OpenGL
#else

View File

@ -75,7 +75,7 @@ _inline 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);
#endif
int drawtext(pixel *vid, int x, int y, const char *s, int r, int g, int b, int a);
int drawtext(pixel *vid, int x, int y, char *s, int r, int g, int b, int a);
void drawrect(pixel *vid, int x, int y, int w, int h, int r, int g, int b, int a);

View File

@ -11,7 +11,7 @@
#include "powder.h"
#include "interface.h"
#include "misc.h"
#include "graphics.h"
SDLMod sdl_mod;
int sdl_key, sdl_wheel, sdl_caps=0, sdl_ascii, sdl_zoom_trig=0;

10
main.c
View File

@ -49,7 +49,7 @@
#include "hmap.h"
#include "air.h"
static const char *it_msg =
char *it_msg =
"\brThe Powder Toy\n"
"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\n"
"\n"
@ -129,7 +129,7 @@ int core_count()
return numCPU;
}
int mousex = 0, mousey = 0; //They contain mouse position
int mousex, mousey = 0; //They contain mouse position
void sdl_seticon(void)
{
@ -140,12 +140,10 @@ void sdl_seticon(void)
#ifdef MACOSX
//SDL_Surface *icon = SDL_CreateRGBSurfaceFrom(app_icon_w32, 32, 32, 32, 128, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
//SDL_WM_SetIcon(icon, NULL/*app_icon_mask*/);
/* Does currently not work #else
#else
SDL_Surface *icon = SDL_CreateRGBSurfaceFrom(app_icon, 16, 16, 32, 128, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
SDL_WM_SetIcon(icon, NULLapp_icon_mask)//app_icon mask;
*/
SDL_WM_SetIcon(icon, NULL/*app_icon_mask*/);
#endif
#endif
}

View File

@ -4,6 +4,22 @@
#include "air.h"
#include "misc.h"
int isplayer = 0;
float player[20]; //[0] is a command cell, [3]-[18] are legs positions, [19] is index
particle *parts;
particle *cb_parts;
unsigned char bmap[YRES/CELL][XRES/CELL];
unsigned char emap[YRES/CELL][XRES/CELL];
unsigned char cb_bmap[YRES/CELL][XRES/CELL];
unsigned char cb_emap[YRES/CELL][XRES/CELL];
int pfree;
unsigned pmap[YRES][XRES];
unsigned cb_pmap[YRES][XRES];
int try_move(int i, int x, int y, int nx, int ny)
{

View File

@ -174,7 +174,7 @@ struct part_state
};
typedef struct part_state part_state;
static const part_type ptypes[PT_NUM] =
static part_type ptypes[PT_NUM] =
{
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description
{"", PIXPACK(0x000000), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_SPECIAL, R_TEMP+0.0f, 251, "Erases particles."},
@ -246,7 +246,7 @@ static const part_type ptypes[PT_NUM] =
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description
};
static const part_state pstates[PT_NUM] =
static part_state pstates[PT_NUM] =
{
// Name Solid Frzp Liquid Mpnt Gas Bpoint
/* NONE */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
@ -316,7 +316,7 @@ static const part_state pstates[PT_NUM] =
/* DYST */ {ST_SOLID, PT_NONE, 0.0f, PT_DUST, 200.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* THRM */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
};
static const unsigned char can_move[PT_NUM][PT_NUM] =
static unsigned char can_move[PT_NUM][PT_NUM] =
{
/* A B */
/* A 0 1 | B ligher than A */
@ -398,21 +398,21 @@ static const unsigned char can_move[PT_NUM][PT_NUM] =
/* e t r l e l a p r e s x m i e k w d t t t d d v t w t w d l t t n x n n u l l m d N d s n a r m d e E y y M H E s l l R T*/
};
int isplayer;
float player[20];
extern int isplayer;
extern float player[20];
particle *parts;
particle *cb_parts;
extern particle *parts;
extern particle *cb_parts;
unsigned char bmap[YRES/CELL][XRES/CELL];
unsigned char emap[YRES/CELL][XRES/CELL];
extern unsigned char bmap[YRES/CELL][XRES/CELL];
extern unsigned char emap[YRES/CELL][XRES/CELL];
unsigned char cb_bmap[YRES/CELL][XRES/CELL];
unsigned char cb_emap[YRES/CELL][XRES/CELL];
extern unsigned char cb_bmap[YRES/CELL][XRES/CELL];
extern unsigned char cb_emap[YRES/CELL][XRES/CELL];
int pfree;
extern int pfree;
unsigned pmap[YRES][XRES];
extern unsigned pmap[YRES][XRES];
unsigned cb_pmap[YRES][XRES];
int try_move(int i, int x, int y, int nx, int ny);