summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-10-25 10:31:21 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-10-25 10:31:21 (GMT)
commit07a1f21df484a252d54c82262ade6d4117425694 (patch)
tree80df86661553807159f7fda3fbf2506d5df3b5fa /includes
parentf01056ee0249ad01ed24824aea39f05083110cd6 (diff)
parentf8d54e66dba5d8448d30f61f84883b4e7e6e1087 (diff)
downloadpowder-07a1f21df484a252d54c82262ade6d4117425694.zip
powder-07a1f21df484a252d54c82262ade6d4117425694.tar.gz
Merge latest with graphicstest
Diffstat (limited to 'includes')
-rw-r--r--includes/defines.h20
-rw-r--r--includes/graphics.h9
-rw-r--r--includes/interface.h22
-rw-r--r--includes/luaconsole.h1
-rw-r--r--includes/powder.h40
5 files changed, 67 insertions, 25 deletions
diff --git a/includes/defines.h b/includes/defines.h
index 62e0c48..e33bc0c 100644
--- a/includes/defines.h
+++ b/includes/defines.h
@@ -8,14 +8,16 @@
#endif
//VersionInfoStart
-#define SAVE_VERSION 64
-#define MINOR_VERSION 0
-//#define BETA
-#define BUILD_NUM 0
+#define SAVE_VERSION 65
+#define MINOR_VERSION 5
+#define BUILD_NUM 100
//VersionInfoEnd
#define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter.
+#define MTOS_EXPAND(str) #str
+#define MTOS(str) MTOS_EXPAND(str)
+
#define SERVER "powdertoy.co.uk"
#define SCRIPTSERVER "powdertoy.co.uk"
@@ -164,8 +166,18 @@ extern int aheat_enable;
extern int decorations_enable;
extern int hud_enable;
extern int pretty_powder;
+extern int drawgrav_enable;
int limitFPS;
int water_equal_test;
+extern int quickoptions_tooltip_fade;
+
+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;
extern int debug_flags;
#define DEBUG_PERF_FRAMECOUNT 256
diff --git a/includes/graphics.h b/includes/graphics.h
index b62279d..57d2358 100644
--- a/includes/graphics.h
+++ b/includes/graphics.h
@@ -43,6 +43,8 @@
#endif
#endif
+extern int emp_decor;
+
extern unsigned cmode;
extern SDL_Surface *sdl_scrn;
extern int sdl_scale;
@@ -57,16 +59,15 @@ extern unsigned char fire_g[YRES/CELL][XRES/CELL];
extern unsigned char fire_b[YRES/CELL][XRES/CELL];
extern unsigned int fire_alpha[CELL*3][CELL*3];
-extern pixel *fire_bg;
extern pixel *pers_bg;
extern char * flm_data;
-extern int flm_data_points;;
+extern int flm_data_points;
extern pixel flm_data_colours[];
extern float flm_data_pos[];
extern char * plasma_data;
-extern int plasma_data_points;;
+extern int plasma_data_points;
extern pixel plasma_data_colours[];
extern float plasma_data_pos[];
@@ -87,6 +88,8 @@ void prepare_graphicscache();
char * generate_gradient(pixel * colours, float * points, int pointcount, int size);
+void draw_other(pixel *vid);
+
void draw_rgba_image(pixel *vid, unsigned char *data, int x, int y, float a);
void *ptif_pack(pixel *src, int w, int h, int *result_size);
diff --git a/includes/interface.h b/includes/interface.h
index 5d59dcf..a8a511e 100644
--- a/includes/interface.h
+++ b/includes/interface.h
@@ -15,6 +15,17 @@ struct menu_section
};
typedef struct menu_section menu_section;
+#define QM_TOGGLE 1
+
+struct quick_option
+{
+ char *icon;
+ const char *name;
+ int type;
+ int *variable;
+};
+typedef struct quick_option quick_option;
+
struct menu_wall
{
pixel colour;
@@ -58,6 +69,13 @@ static menu_section msections[] = //doshow does not do anything currently.
{"\xC8", "Cracker!", 0, 0},
};
+static quick_option quickmenu[] = //doshow does not do anything currently.
+{
+ {"P", "Sand effect", QM_TOGGLE, &pretty_powder},
+ {"G", "Draw gravity grid", QM_TOGGLE, &drawgrav_enable},
+ {NULL}
+};
+
static menu_section colorsections[] = //doshow does not do anything currently.
{
{"\xC4", "Colors", 7, 1},
@@ -201,10 +219,10 @@ extern int zoom_en;
extern int zoom_x, zoom_y;
extern int zoom_wx, zoom_wy;
-extern int drawgrav_enable;
-
void menu_count(void);
+void quickoptions_menu(pixel *vid_buf, int b, int bq, int x, int y);
+
void prop_edit_ui(pixel *vid_buf, int x, int y);
void get_sign_pos(int i, int *x0, int *y0, int *w, int *h);
diff --git a/includes/luaconsole.h b/includes/luaconsole.h
index dc320ad..de33a04 100644
--- a/includes/luaconsole.h
+++ b/includes/luaconsole.h
@@ -77,4 +77,5 @@ int luatpt_setdebug(lua_State* l);
int luatpt_setfpscap(lua_State* l);
int luatpt_getscript(lua_State* l);
int luatpt_setwindowsize(lua_State* l);
+int luatpt_screenshot(lua_State* l);
#endif
diff --git a/includes/powder.h b/includes/powder.h
index a490fe1..66246c8 100644
--- a/includes/powder.h
+++ b/includes/powder.h
@@ -145,6 +145,10 @@
#define PT_CONV 85
#define PT_CAUS 86
+#define PT_LIGH 87
+#define PT_TESC 88
+#define PT_DEST 89
+
#define PT_SPNG 90
#define PT_RIME 91
#define PT_FOG 92
@@ -190,13 +194,9 @@
#define PT_QRTZ 132
#define PT_PQRT 133
-#define PT_SEED 134
-#define PT_MAZE 135
-#define PT_COAG 136
-#define PT_WALL 137
-#define PT_GNAR 138
-#define PT_REPL 139
-#define PT_MYST 140
+#define PT_EMP 134
+#define PT_BREC 135
+
#define PT_BOYL 141
#define OLD_PT_WIND 147
@@ -306,6 +306,9 @@ int graphics_GBMB(GRAPHICS_FUNC_ARGS);
int graphics_COAL(GRAPHICS_FUNC_ARGS);
int graphics_STKM(GRAPHICS_FUNC_ARGS);
int graphics_STKM2(GRAPHICS_FUNC_ARGS);
+int graphics_DEST(GRAPHICS_FUNC_ARGS);
+int graphics_EMP(GRAPHICS_FUNC_ARGS;
+int graphics_LIGH(GRAPHICS_FUNC_ARGS);
#define UPDATE_FUNC_ARGS int i, int x, int y, int surround_space, int nt
// to call another update function with same arguments:
@@ -396,6 +399,9 @@ int update_BIZR(UPDATE_FUNC_ARGS);
int update_PVOD(UPDATE_FUNC_ARGS);
int update_CONV(UPDATE_FUNC_ARGS);
int update_CAUS(UPDATE_FUNC_ARGS);
+int update_DEST(UPDATE_FUNC_ARGS);
+int update_EMP(UPDATE_FUNC_ARGS);
+int update_LIGH(UPDATE_FUNC_ARGS);
int update_MISC(UPDATE_FUNC_ARGS);
int update_legacy_PYRO(UPDATE_FUNC_ARGS);
@@ -548,9 +554,9 @@ static const part_type ptypes[PT_NUM] =
{"PVOD", PIXPACK(0x792020), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_POWERED, R_TEMP+0.0f +273.15f, 251, "Solid. When activated, destroys entering particles", ST_NONE, TYPE_SOLID, &update_PVOD, &graphics_PVOD},
{"CONV", PIXPACK(0x0AAB0A), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Solid. Converts whatever touches it into its ctype.", ST_NONE, TYPE_SOLID, &update_CONV, NULL},
{"CAUS", PIXPACK(0x80FFA0), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 1.50f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+0.0f +273.15f, 70, "Caustic Gas, acts like Acid", ST_GAS, TYPE_GAS, &update_CAUS, NULL},
- /*FREE*/{"34", PIXPACK(0x500050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "34! B34/S34)", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
- /*FREE*/{"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Long Life! B345/S5", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
- /*FREE*/{"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Stains! B3678/S235678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
+ {"LIGH", PIXPACK(0xFFFFC0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "More realistic lighting. Set pen size for setting size of the lighting.", ST_SOLID, TYPE_SOLID, &update_LIGH, &graphics_LIGH},
+ {"TESC", PIXPACK(0x707040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Tesla coil!", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, NULL, NULL},
+ {"DEST", PIXPACK(0xFF3311), -0.05f, 0.00f * CFDS, 0.95f, 0.95f, -0.1f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 1, 101, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 150, "More destructive Bomb.", ST_SOLID, TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_DEST, &graphics_DEST},
{"SPNG", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "A sponge, absorbs water.", ST_SOLID, TYPE_SOLID, &update_SPNG, &graphics_SPNG},
{"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, 100, SC_CRACKER2, 243.15f, 100, "Not quite Ice", ST_SOLID, TYPE_SOLID, &update_RIME, NULL},
{"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, 1, SC_CRACKER2, 243.15f, 100, "Not quite Steam", ST_GAS, TYPE_GAS|PROP_LIFE_DEC, &update_FOG, NULL},
@@ -595,8 +601,8 @@ static const part_type ptypes[PT_NUM] =
{"SING", PIXPACK(0x242424), 0.7f, 0.36f * CFDS, 0.96f, 0.80f, 0.1f, 0.12f, 0.00f, -0.001f * CFDS, 1, 0, 0, 0, 0, 1, 1, 86, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Singularity", ST_SOLID, TYPE_PART|PROP_LIFE_DEC, &update_SING, NULL},
{"QRTZ", PIXPACK(0xAADDDD), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 3, "Quartz, breakable mineral. Conducts but becomes brittle at lower temperatures.", ST_SOLID, TYPE_SOLID|PROP_HOT_GLOW|PROP_LIFE_DEC, &update_QRTZ, &graphics_QRTZ},
{"PQRT", PIXPACK(0x88BBBB), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.27f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 3, "Broken quartz.", ST_SOLID, TYPE_PART| PROP_HOT_GLOW, &update_QRTZ, &graphics_QRTZ},
- /*FREE*/{"SEED", PIXPACK(0xFBEC7D), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "B2/S", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
- /*FREE*/{"MAZE", PIXPACK(0xA8E4A0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "B3/S12345", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
+ {"EMP", PIXPACK(0x66AAFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 3, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 121, "Breaks activated electronics.", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_EMP, &graphics_EMP},
+ {"BREL", PIXPACK(0x707060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.18f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 211, "Broken electronics", ST_SOLID, TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, NULL, NULL},
/*FREE*/{"COAG", PIXPACK(0x9ACD32), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "B378/S235678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
/*FREE*/{"WALL", PIXPACK(0x0047AB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "B45678/S2345", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
/*FREE*/{"GNAR", PIXPACK(0xE5B73B), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "B1/S1", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
@@ -849,7 +855,9 @@ static part_transition ptransitions[PT_NUM] =
#define NGT_LOTE 19
#define NGT_FRG2 20
#define NGT_STAR 21
-#define NGT_FROG 22
+#define NGT_FROG 22int update_DEST(UPDATE_FUNC_ARGS);
+int update_EMP(UPDATE_FUNC_ARGS);
+int update_LIGH(UPDATE_FUNC_ARGS);
#define NGT_BRAN 23
struct gol_menu
@@ -1019,8 +1027,8 @@ extern int wire_placed;
extern int gravwl_timeout;
-extern float player[28];
-extern float player2[28];
+extern float player[29];
+extern float player2[29];
extern int gravityMode;
extern int airMode;
@@ -1076,7 +1084,7 @@ int parts_avg(int ci, int ni, int t);
void create_arc(int sx, int sy, int dx, int dy, int midpoints, int variance, int type, int flags);
-int nearest_part(int ci, int t);
+int nearest_part(int ci, int t, int max_d);
void update_particles_i(pixel *vid, int start, int inc);