2010-08-25 06:22:41 -05:00
|
|
|
#ifndef DEFINE_H
|
|
|
|
#define DEFINE_H
|
|
|
|
|
2010-11-10 18:42:42 -06:00
|
|
|
#ifdef WIN32
|
2010-08-28 05:40:49 -05:00
|
|
|
#define PATH_SEP "\\"
|
|
|
|
#else
|
|
|
|
#define PATH_SEP "/"
|
|
|
|
#endif
|
2011-06-04 06:49:40 -05:00
|
|
|
|
2011-07-31 08:20:22 -05:00
|
|
|
//VersionInfoStart
|
2011-12-30 08:59:45 -06:00
|
|
|
#define SAVE_VERSION 71
|
2012-01-26 08:08:05 -06:00
|
|
|
#define MINOR_VERSION 2
|
|
|
|
#define BUILD_NUM 135
|
2011-07-31 08:20:22 -05:00
|
|
|
//VersionInfoEnd
|
|
|
|
|
2011-12-08 11:44:55 -06:00
|
|
|
#define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter
|
2010-08-29 07:10:58 -05:00
|
|
|
|
2011-10-24 12:43:45 -05:00
|
|
|
#define MTOS_EXPAND(str) #str
|
|
|
|
#define MTOS(str) MTOS_EXPAND(str)
|
|
|
|
|
2010-08-25 06:22:41 -05:00
|
|
|
#define SERVER "powdertoy.co.uk"
|
2011-08-25 06:20:00 -05:00
|
|
|
#define SCRIPTSERVER "powdertoy.co.uk"
|
2012-01-26 08:05:56 -06:00
|
|
|
#define STATICSERVER "static.powdertoy.co.uk"
|
2010-08-25 06:22:41 -05:00
|
|
|
|
2011-06-12 16:59:36 -05:00
|
|
|
#define LOCAL_SAVE_DIR "Saves"
|
|
|
|
|
2011-09-19 15:31:10 -05:00
|
|
|
#define APPDATA_SUBDIR "\\HardWIRED"
|
|
|
|
|
2010-08-29 07:10:58 -05:00
|
|
|
#define THUMB_CACHE_SIZE 256
|
|
|
|
|
2011-03-24 15:01:15 -05:00
|
|
|
#ifndef M_PI
|
|
|
|
#define M_PI 3.14159265f
|
|
|
|
#endif
|
2011-04-22 11:06:44 -05:00
|
|
|
#ifndef M_GRAV
|
|
|
|
#define M_GRAV 6.67300e-1
|
|
|
|
#endif
|
2011-03-24 15:01:15 -05:00
|
|
|
|
2010-08-29 07:10:58 -05:00
|
|
|
#define IMGCONNS 3
|
|
|
|
#define TIMEOUT 100
|
|
|
|
#define HTTP_TIMEOUT 10
|
|
|
|
|
2011-04-12 06:19:21 -05:00
|
|
|
#ifdef RENDERER
|
|
|
|
#define MENUSIZE 0
|
|
|
|
#define BARSIZE 0
|
|
|
|
#else
|
2010-08-25 06:22:41 -05:00
|
|
|
#define MENUSIZE 40
|
2010-10-28 18:18:06 -05:00
|
|
|
#define BARSIZE 17
|
2011-04-12 06:19:21 -05:00
|
|
|
#endif
|
2010-08-25 06:22:41 -05:00
|
|
|
#define XRES 612
|
|
|
|
#define YRES 384
|
|
|
|
#define NPART XRES*YRES
|
|
|
|
|
2011-01-04 12:26:28 -06:00
|
|
|
#define XCNTR 306
|
|
|
|
#define YCNTR 192
|
|
|
|
|
2010-12-12 19:13:05 -06:00
|
|
|
#define MAX_DISTANCE sqrt(pow(XRES, 2)+pow(YRES, 2))
|
|
|
|
|
2011-04-26 10:15:23 -05:00
|
|
|
#define GRAV_DIFF
|
|
|
|
|
2010-08-27 07:01:20 -05:00
|
|
|
#define MAXSIGNS 16
|
2010-08-29 07:10:58 -05:00
|
|
|
#define TAG_MAX 256
|
2010-08-27 07:01:20 -05:00
|
|
|
|
2010-08-25 06:22:41 -05:00
|
|
|
#define ZSIZE_D 16
|
|
|
|
#define ZFACTOR_D 8
|
2010-09-01 05:40:29 -05:00
|
|
|
extern unsigned char ZFACTOR;
|
|
|
|
extern unsigned char ZSIZE;
|
2010-08-25 06:22:41 -05:00
|
|
|
|
|
|
|
#define CELL 4
|
|
|
|
#define ISTP (CELL/2)
|
|
|
|
#define CFDS (4.0f/CELL)
|
|
|
|
|
2011-02-04 00:00:03 -06:00
|
|
|
#define AIR_TSTEPP 0.3f
|
|
|
|
#define AIR_TSTEPV 0.4f
|
|
|
|
#define AIR_VADV 0.3f
|
|
|
|
#define AIR_VLOSS 0.999f
|
|
|
|
#define AIR_PLOSS 0.9999f
|
2010-08-25 06:22:41 -05:00
|
|
|
|
2010-08-28 05:40:49 -05:00
|
|
|
#define GRID_X 5
|
|
|
|
#define GRID_Y 4
|
|
|
|
#define GRID_P 3
|
|
|
|
#define GRID_S 6
|
|
|
|
#define GRID_Z 3
|
|
|
|
|
2011-06-12 16:59:36 -05:00
|
|
|
#define CATALOGUE_X 4
|
|
|
|
#define CATALOGUE_Y 3
|
|
|
|
#define CATALOGUE_S 6
|
|
|
|
#define CATALOGUE_Z 3
|
|
|
|
|
2011-04-08 07:57:05 -05:00
|
|
|
#define STAMP_MAX 240
|
2010-08-28 05:40:49 -05:00
|
|
|
|
2012-01-02 07:59:28 -06:00
|
|
|
#define SAVE_OPS
|
|
|
|
|
2011-01-29 05:18:10 -06:00
|
|
|
#define NGOL 25
|
2011-07-09 12:22:25 -05:00
|
|
|
#define NGOLALT 24 //NGOL should be 24, but use this var until I find out why
|
2010-11-09 00:04:59 -06:00
|
|
|
|
2010-11-18 22:27:24 -06:00
|
|
|
#define CIRCLE_BRUSH 0
|
|
|
|
#define SQUARE_BRUSH 1
|
2011-07-12 09:55:25 -05:00
|
|
|
#define TRI_BRUSH 2
|
|
|
|
#define BRUSH_NUM 3
|
|
|
|
|
2010-08-28 05:40:49 -05:00
|
|
|
#ifdef PIX16
|
|
|
|
typedef unsigned short pixel;
|
|
|
|
#else
|
|
|
|
typedef unsigned int pixel;
|
|
|
|
#endif
|
|
|
|
|
2010-10-28 18:18:06 -05:00
|
|
|
#define SURF_RANGE 10
|
|
|
|
#define NORMAL_MIN_EST 3
|
|
|
|
#define NORMAL_INTERP 20
|
|
|
|
#define NORMAL_FRAC 16
|
|
|
|
|
|
|
|
#define REFRACT 0x80000000
|
|
|
|
|
|
|
|
/* heavy flint glass, for awesome refraction/dispersion
|
|
|
|
this way you can make roof prisms easily */
|
|
|
|
#define GLASS_IOR 1.9
|
|
|
|
#define GLASS_DISP 0.07
|
|
|
|
|
2011-02-12 18:05:09 -06:00
|
|
|
#ifdef WIN32
|
|
|
|
#define strcasecmp stricmp
|
|
|
|
#endif
|
2011-06-22 13:22:48 -05:00
|
|
|
#if defined(WIN32) && !defined(__GNUC__)
|
|
|
|
#define fmin min
|
|
|
|
#define fminf min
|
|
|
|
#define fmax max
|
|
|
|
#define fmaxf max
|
|
|
|
#endif
|
2011-02-12 18:05:09 -06:00
|
|
|
|
2011-12-29 20:06:31 -06:00
|
|
|
#if defined(WIN32) && !defined(__GNUC__)
|
|
|
|
#define TPT_INLINE _inline
|
|
|
|
#else
|
|
|
|
#define TPT_INLINE inline
|
|
|
|
#endif
|
|
|
|
|
2011-04-25 14:41:45 -05:00
|
|
|
#define SDEUT
|
2011-07-01 05:32:10 -05:00
|
|
|
//#define REALHEAT
|
2011-04-25 14:41:45 -05:00
|
|
|
|
2011-08-11 14:12:52 -05:00
|
|
|
#define DEBUG_PARTS 0x0001
|
|
|
|
#define DEBUG_PARTCOUNT 0x0002
|
2011-08-14 12:31:48 -05:00
|
|
|
#define DEBUG_DRAWTOOL 0x0004
|
2011-10-16 18:16:43 -05:00
|
|
|
#define DEBUG_PERFORMANCE_CALC 0x0008
|
|
|
|
#define DEBUG_PERFORMANCE_FRAME 0x0010
|
2011-08-11 14:12:52 -05:00
|
|
|
|
2010-08-25 06:22:41 -05:00
|
|
|
typedef unsigned char uint8;
|
|
|
|
|
2010-09-01 05:40:29 -05:00
|
|
|
extern int amd;
|
|
|
|
|
2010-09-06 21:41:51 -05:00
|
|
|
extern int FPSB;
|
|
|
|
|
2010-11-21 00:08:33 -06:00
|
|
|
int NUM_PARTS;
|
2010-11-22 14:36:24 -06:00
|
|
|
int GRAV;
|
|
|
|
int GRAV_R;
|
|
|
|
int GRAV_G;
|
|
|
|
int GRAV_B;
|
|
|
|
int GRAV_R2;
|
|
|
|
int GRAV_G2;
|
|
|
|
int GRAV_B2;
|
2010-11-21 00:08:33 -06:00
|
|
|
|
2010-08-26 08:46:56 -05:00
|
|
|
extern int legacy_enable;
|
2011-02-08 08:30:02 -06:00
|
|
|
extern int sound_enable;
|
2011-01-08 20:23:46 -06:00
|
|
|
extern int kiosk_enable;
|
2011-06-01 14:18:19 -05:00
|
|
|
extern int aheat_enable;
|
2011-05-28 15:24:07 -05:00
|
|
|
extern int decorations_enable;
|
2012-01-02 07:59:28 -06:00
|
|
|
extern int active_menu;
|
2011-07-22 09:08:13 -05:00
|
|
|
extern int hud_enable;
|
2011-10-09 07:55:16 -05:00
|
|
|
extern int pretty_powder;
|
2011-10-21 13:41:12 -05:00
|
|
|
extern int drawgrav_enable;
|
2011-08-16 11:45:44 -05:00
|
|
|
int limitFPS;
|
2011-09-21 17:36:35 -05:00
|
|
|
int water_equal_test;
|
2011-10-22 13:39:24 -05:00
|
|
|
extern int quickoptions_tooltip_fade;
|
2011-07-22 09:08:13 -05:00
|
|
|
|
2011-10-16 18:16:43 -05:00
|
|
|
extern int debug_flags;
|
|
|
|
#define DEBUG_PERF_FRAMECOUNT 256
|
|
|
|
extern int debug_perf_istart;
|
|
|
|
extern int debug_perf_iend;
|
|
|
|
extern long debug_perf_frametime[DEBUG_PERF_FRAMECOUNT];
|
|
|
|
extern long debug_perf_partitime[DEBUG_PERF_FRAMECOUNT];
|
2011-10-25 05:31:21 -05:00
|
|
|
extern long debug_perf_time;
|
2011-07-22 09:08:13 -05:00
|
|
|
|
2011-10-16 18:16:43 -05:00
|
|
|
extern int debug_flags;
|
|
|
|
#define DEBUG_PERF_FRAMECOUNT 256
|
|
|
|
extern int debug_perf_istart;
|
|
|
|
extern int debug_perf_iend;
|
|
|
|
extern long debug_perf_frametime[DEBUG_PERF_FRAMECOUNT];
|
|
|
|
extern long debug_perf_partitime[DEBUG_PERF_FRAMECOUNT];
|
|
|
|
extern long debug_perf_time;
|
|
|
|
|
2011-07-22 09:08:13 -05:00
|
|
|
extern int active_menu;
|
2011-01-08 20:23:46 -06:00
|
|
|
|
2010-08-26 08:46:56 -05:00
|
|
|
extern int sys_pause;
|
|
|
|
extern int framerender;
|
|
|
|
|
|
|
|
extern int mousex, mousey;
|
|
|
|
|
2010-08-27 07:01:20 -05:00
|
|
|
struct sign
|
|
|
|
{
|
2011-01-28 17:54:50 -06:00
|
|
|
int x,y,ju;
|
|
|
|
char text[256];
|
2010-08-27 07:01:20 -05:00
|
|
|
};
|
|
|
|
typedef struct sign sign;
|
|
|
|
|
2010-08-28 05:40:49 -05:00
|
|
|
struct stamp
|
|
|
|
{
|
2011-01-28 17:54:50 -06:00
|
|
|
char name[11];
|
|
|
|
pixel *thumb;
|
|
|
|
int thumb_w, thumb_h, dodelete;
|
2010-08-28 05:40:49 -05:00
|
|
|
};
|
|
|
|
typedef struct stamp stamp;
|
|
|
|
|
2011-04-12 06:19:21 -05:00
|
|
|
int frameidx;
|
2010-11-01 22:56:06 -05:00
|
|
|
int MSIGN;
|
2010-11-04 21:12:51 -05:00
|
|
|
int CGOL;
|
2010-11-07 16:55:25 -06:00
|
|
|
int ISGOL;
|
2010-11-15 10:57:37 -06:00
|
|
|
int ISLOVE;
|
2010-12-02 23:13:00 -06:00
|
|
|
int ISLOLZ;
|
2010-11-22 14:36:24 -06:00
|
|
|
int ISGRAV;
|
2010-12-04 11:24:54 -06:00
|
|
|
int ISWIRE;
|
2010-11-05 00:22:43 -05:00
|
|
|
int GSPEED;
|
2010-11-15 10:57:37 -06:00
|
|
|
int love[XRES/9][YRES/9];
|
2010-12-02 23:13:00 -06:00
|
|
|
int lolz[XRES/9][YRES/9];
|
2011-05-10 14:32:00 -05:00
|
|
|
unsigned char gol[XRES][YRES];
|
|
|
|
unsigned char gol2[XRES][YRES][NGOL+1];
|
2010-11-17 23:01:46 -06:00
|
|
|
int SEC;
|
|
|
|
int SEC2;
|
2011-01-30 00:23:24 -06:00
|
|
|
int console_mode;
|
2010-11-18 15:23:24 -06:00
|
|
|
int REPLACE_MODE;
|
2010-11-18 22:27:24 -06:00
|
|
|
int CURRENT_BRUSH;
|
2010-11-30 13:43:42 -06:00
|
|
|
int GRID_MODE;
|
2010-12-01 14:27:13 -06:00
|
|
|
int VINE_MODE;
|
2010-12-10 13:05:06 -06:00
|
|
|
int DEBUG_MODE;
|
2010-12-11 22:31:08 -06:00
|
|
|
int GENERATION;
|
2010-12-18 22:22:10 -06:00
|
|
|
int ISSPAWN1;
|
|
|
|
int ISSPAWN2;
|
2010-08-27 07:01:20 -05:00
|
|
|
extern sign signs[MAXSIGNS];
|
2010-08-28 05:40:49 -05:00
|
|
|
extern stamp stamps[STAMP_MAX];
|
|
|
|
extern int stamp_count;
|
|
|
|
extern int itc;
|
|
|
|
extern char itc_msg[64];
|
2010-08-27 07:01:20 -05:00
|
|
|
|
2010-08-29 07:10:58 -05:00
|
|
|
extern int do_open;
|
|
|
|
extern int sys_pause;
|
2011-04-23 07:41:08 -05:00
|
|
|
extern int sys_shortcuts;
|
2010-08-29 07:10:58 -05:00
|
|
|
extern int legacy_enable; //Used to disable new features such as heat, will be set by commandline or save.
|
2011-07-14 04:37:34 -05:00
|
|
|
extern int framerender;
|
2011-05-28 15:01:31 -05:00
|
|
|
extern pixel *vid_buf;
|
2010-08-29 07:10:58 -05:00
|
|
|
|
2011-09-24 11:13:28 -05:00
|
|
|
extern unsigned char last_major, last_minor, update_flag, last_build;
|
2010-08-29 07:10:58 -05:00
|
|
|
|
|
|
|
extern char http_proxy_string[256];
|
|
|
|
|
2010-09-01 05:40:29 -05:00
|
|
|
//Functions in main.c
|
|
|
|
void thumb_cache_inval(char *id);
|
|
|
|
void thumb_cache_add(char *id, void *thumb, int size);
|
|
|
|
int thumb_cache_find(char *id, void **thumb, int *size);
|
2011-02-19 09:34:04 -06:00
|
|
|
void clear_sim(void);
|
2010-09-01 05:40:29 -05:00
|
|
|
void del_stamp(int d);
|
|
|
|
void sdl_seticon(void);
|
2011-04-23 07:41:08 -05:00
|
|
|
void play_sound(char *file);
|
2011-05-24 08:54:14 -05:00
|
|
|
int set_scale(int scale, int kiosk);
|
2010-10-28 18:18:06 -05:00
|
|
|
#endif
|