diff --git a/Makefile b/Makefile index 8a25f401d..9e1f41ee4 100755 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ LFLAGS := -lSDL -lm -lbz2 MFLAGS_SSE3 := -march=native -DX86 -DX86_SSE3 -msse3 MFLAGS_SSE2 := -march=native-DX86 -DX86_SSE2 -msse2 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 -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lbz2 COMPILER := gcc LINUX_TARG := powder-64-sse2 powder-sse powder-sse2 WIN32_TARG := powder-sse.exe powder-sse2.exe @@ -14,7 +14,7 @@ WIN32_TARG := powder-sse.exe powder-sse2.exe powder: $(SOURCES) $(COMPILER) -DINTERNAL -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 powder-debug: $(SOURCES) - $(COMPILER) -m64 -o$@ $(FLAGS_DBUG) -DLIN64 $(SOURCES) + $(COMPILER) -m64 -o$@ $(FLAGS_DBUG) -DLIN64 $(SOURCES) -Iincludes/ -DLIN64 powder-sse3: $(SOURCES) $(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN32 @@ -30,7 +30,7 @@ powder-64-sse3-opengl: $(SOURCES) $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 -lGL -lGLU -DOpenGL strip $@ powder-64-sse3: $(SOURCES) - $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 + $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 -j3 strip $@ mv $@ build powder-64-sse2: $(SOURCES) diff --git a/includes/defines.h b/includes/defines.h index a324e9f54..0f80ab69a 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -23,7 +23,7 @@ #define HTTP_TIMEOUT 10 #define MENUSIZE 40 -#define BARSIZE 14 +#define BARSIZE 17 #define XRES 612 #define YRES 384 #define NPART XRES*YRES @@ -62,6 +62,18 @@ typedef unsigned short pixel; typedef unsigned int pixel; #endif +#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 + typedef unsigned char uint8; extern int amd; @@ -115,4 +127,4 @@ void *build_save(int *size, int x0, int y0, int w, int h); int parse_save(void *save, int size, int replace, int x0, int y0); void del_stamp(int d); void sdl_seticon(void); -#endif \ No newline at end of file +#endif diff --git a/includes/graphics.h b/includes/graphics.h index 6a1507e94..ec0d597f0 100644 --- a/includes/graphics.h +++ b/includes/graphics.h @@ -77,6 +77,8 @@ extern inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int drawtext(pixel *vid, int x, int y, const char *s, int r, int g, int b, int a); +int drawtextwrap(pixel *vid, int x, int y, int w, const 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); void fillrect(pixel *vid, int x, int y, int w, int h, int r, int g, int b, int a); @@ -91,12 +93,14 @@ int drawtextmax(pixel *vid, int x, int y, int w, char *s, int r, int g, int b, i int textnwidth(char *s, int n); +int textnheight(char *s, int n, int w); + int textwidthx(char *s, int w); #ifdef WIN32 _inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a); #else -inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a); +void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a); #endif void draw_icon(pixel *vid_buf, int x, int y, char ch, int flag); diff --git a/includes/interface.h b/includes/interface.h index 7f130649a..0f4dd3fd6 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -67,12 +67,32 @@ static menu_section msections[] = struct ui_edit { - int x, y, w, nx; + int x, y, w, nx, h; char str[256],*def; - int focus, cursor, hide; + int focus, cursor, hide, multiline; }; typedef struct ui_edit ui_edit; +struct save_info +{ + char *title; + char *name; + char *author; + char *date; + char *description; + int publish; + int voteup; + int votedown; + int vote; + int myvote; + int myfav; + char *tags; + int comment_count; + char *comments[6]; + char *commentauthors[6]; +}; +typedef struct save_info save_info; + struct ui_checkbox { int x, y; @@ -112,6 +132,7 @@ extern void *search_thumbs[GRID_X*GRID_Y]; extern int search_thsizes[GRID_X*GRID_Y]; extern int search_own; +extern int search_fav; extern int search_date; extern int search_page; extern char search_expr[256]; @@ -169,15 +190,27 @@ char *download_ui(pixel *vid_buf, char *uri, int *len); int search_ui(pixel *vid_buf); +int open_ui(pixel *vid_buf, char *save_id, char *save_date); + +int info_parse(char *info_data, save_info *info); + int search_results(char *str, int votes); int execute_tagop(pixel *vid_buf, char *op, char *tag); void execute_save(pixel *vid_buf); -void execute_delete(pixel *vid_buf, char *id); +int execute_delete(pixel *vid_buf, char *id); + +int execute_report(pixel *vid_buf, char *id); + +void execute_submit(pixel *vid_buf, char *id, char *message); + +void execute_fav(pixel *vid_buf, char *id); int execute_vote(pixel *vid_buf, char *id, char *action); +void open_link(char *uri); + #endif diff --git a/includes/powder.h b/includes/powder.h index 3b5e2f0d6..fbf79fc05 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -114,7 +114,9 @@ #define PT_BCOL 73 #define PT_PCLN 74 #define PT_HSWC 75 -#define PT_NUM 76 +#define PT_IRON 76 +#define PT_MORT 77 +#define PT_NUM 78 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -127,14 +129,18 @@ #define ST_LIQUID 2 #define ST_GAS 3 /* - We should start to implement these. + TODO: We should start to implement these. */ -static const unsigned short TYPE_PART = 0x01; //1 -static const unsigned short TYPE_LIQUID = 0x02; //2 -static const unsigned short TYPE_SOLID = 0x04; //4 -static const unsigned short TYPE_GAS = 0x08; //8 -static const unsigned short PROP_CONDUCTS = 0x10; //16 -static const unsigned short PROP_DEADLY = 0x12; //18 Is deadly for stickman. +#define TYPE_PART 0x0001 //1 Powders +#define TYPE_LIQUID 0x0002 //2 Liquids +#define TYPE_SOLID 0x0004 //4 Solids +#define TYPE_GAS 0x0008 //8 Gasses (Includes plasma) +#define TYPE_ENERGY 0x0018 //16 Energy (Thunder, Light, Neutrons etc.) +#define PROP_CONDUCTS 0x0020 //32 Conducts electricity (Currently Unused) +#define PROP_BLACK 0x0040 //64 Absorbs Photons +#define PROP_NEUTPENETRATE 0x0080 //128 Penetrated by neutrons +#define PROP_NEUTABSORB 0x0100 //256 Absorbs neutrons, reflect is default +#define PROP_DEADLY 0x0200 //512 Is deadly for stickman. #define FLAG_STAGNANT 1 struct particle @@ -167,6 +173,7 @@ struct part_type int meltable; int hardness; int menu; + int weight; int menusection; float heat; unsigned char hconduct; @@ -189,102 +196,111 @@ struct part_state }; typedef struct part_state part_state; //Should probably be const. +/* Weight Help + * 1 = Gas || + * 2 = Light || Liquids 0-49 + * 98 = Heavy || Powder 50-99 + * 100 = Solid || + * -1 is Neutrons and Photons + */ 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 - {"", 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 +273.15f, 251, "Erases particles."}, - {"DUST", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable."}, - {"WATR", PIXPACK(0x2030D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, SC_LIQUID, R_TEMP+-2.0f+273.15f, 29, "Liquid. Conducts electricity. Freezes. Extinguishes fires."}, - {"OIL", PIXPACK(0x404010), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 20, 0, 0, 5, 1, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Flammable."}, - {"FIRE", PIXPACK(0xFF1000), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.001f * CFDS, 1, 0, 0, 0, 1, 1, SC_EXPLOSIVE, R_TEMP+400.0f+273.15f, 88, "Ignites flammable materials. Heats air."}, - {"STNE", PIXPACK(0xA0A0A0), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Heavy particles. Meltable."}, - {"LAVA", PIXPACK(0xE05010), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.0003f * CFDS, 2, 0, 0, 0, 2, 1, SC_LIQUID, R_TEMP+1500.0f+273.15f, 60, "Heavy liquid. Ignites flammable materials. Solidifies when cold."}, - {"GUN", PIXPACK(0xC0C0D0), 0.7f, 0.02f * CFDS, 0.94f, 0.80f, -0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 600, 1, 0, 10, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 97, "Light dust. Explosive."}, - {"NITR", PIXPACK(0x20E010), 0.5f, 0.02f * CFDS, 0.92f, 0.97f, 0.0f, 0.2f, 0.00f, 0.000f * CFDS, 2, 1000, 2, 0, 3, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 50, "Liquid. Pressure sensitive explosive."}, - {"CLNE", PIXPACK(0xFFD010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Solid. Duplicates any particles it touches."}, - {"GAS", PIXPACK(0xE0FF20), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 600, 0, 0, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Gas. Diffuses. Flammable. Liquifies under pressure."}, - {"C-4", PIXPACK(0xD080E0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 1000, 2, 50, 1, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Solid. Pressure sensitive explosive."}, - {"GOO", PIXPACK(0x804000), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 75, "Solid. Deforms and disappears under pressure."}, - {"ICE", PIXPACK(0xA0C0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 0, 0, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+-50.0f+273.15f, 46, "Solid. Freezes water. Crushes under pressure. Cools down air."}, - {"METL", PIXPACK(0x404060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Conducts electricity. Meltable."}, - {"SPRK", PIXPACK(0xFFFF80), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electricity. Conducted by metal and water."}, - {"SNOW", PIXPACK(0xC0E0FF), 0.7f, 0.01f * CFDS, 0.96f, 0.90f, -0.1f, 0.05f, 0.01f, -0.00005f* CFDS,1, 0, 0, 0, 20, 1, SC_POWDERS, R_TEMP+-30.0f+273.15f, 46, "Light particles."}, - {"WOOD", PIXPACK(0xC0A040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 15, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Solid. Flammable. Can be pressurised into COAL"}, - {"NEUT", PIXPACK(0x20E0FF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Neutrons. Interact with matter in odd ways."}, - {"PLUT", PIXPACK(0x407020), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 251, "Heavy particles. Fissile. Generates neutrons under pressure."}, - {"PLNT", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Plant, drinks water and grows."}, - {"ACID", PIXPACK(0xed55ff), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 40, 0, 0, 1, 1, SC_LIQUID, R_TEMP+0.0f +273.15f, 34, "Dissolves almost everything."}, - {"VOID", PIXPACK(0x790B0B), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Hole, will drain away any particles."}, - {"WTRV", PIXPACK(0xA0A0FF), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, -0.1f, 0.75f, 0.0003f * CFDS, 0, 0, 0, 0, 4, 1, SC_GAS, R_TEMP+100.0f+273.15f, 48, "Steam, heats up air, produced from hot water."}, - {"CNCT", PIXPACK(0xC0C0C0), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 25, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 100, "Concrete, stronger than stone."}, - {"DSTW", PIXPACK(0x1020C0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, SC_LIQUID, R_TEMP+-2.0f+273.15f, 23, "Distilled water, does not conduct electricity."}, - {"SALT", PIXPACK(0xFFFFFF), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 110, "Salt, dissolves in water."}, - {"SLTW", PIXPACK(0x4050F0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, SC_LIQUID, R_TEMP+0.0f +273.15f, 75, "Saltwater, conducts electricity, difficult to freeze."}, - {"DMND", PIXPACK(0xCCFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+0.0f +273.15f, 186, "Diamond. Indestructable."}, //ief015 - Added diamond. Because concrete blocks are kinda pointless. - {"BMTL", PIXPACK(0x505070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Breakable metal."}, - {"BRMT", PIXPACK(0x705060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 211, "Broken metal."}, - {"PHOT", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, SC_ELEC, R_TEMP+900.0f+273.15f, 251, "Photons. Travel in straight lines."}, - {"URAN", PIXPACK(0x707020), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, SC_NUCLEAR, R_TEMP+30.0f+273.15f, 251, "Heavy particles. Generates heat under pressure."}, - {"WAX", PIXPACK(0xF0F0BB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 44, "Wax. Melts at moderately high temperatures."}, - {"MWAX", PIXPACK(0xE0E0AA), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000001f* CFDS,2, 5, 0, 0, 2, 1, SC_LIQUID, R_TEMP+28.0f+273.15f, 44, "Liquid Wax."}, - {"PSCN", PIXPACK(0x805050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "P-Type Silicon, Will transfer current to any conductor."}, - {"NSCN", PIXPACK(0x505080), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "N-Type Silicon, Will only transfer current to P-Type Silicon."}, - {"LN2", PIXPACK(0x80A0DF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 0, 1, SC_LIQUID, 70.15f, 70, "Liquid Nitrogen. Very cold."}, - {"INSL", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 7, 0, 0, 10, 1, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Insulator, does not conduct heat or electricity."}, - {"BHOL", PIXPACK(0x202020), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, -0.01f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+70.0f+273.15f, 255, "Black hole, sucks in other particles and heats up."}, - {"WHOL", PIXPACK(0xEFEFEF), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.010f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP-16.0f+273.15f, 255, "White hole, pushes other particles away."}, - {"RBDM", PIXPACK(0xCCCCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 1000, 1, 50, 1, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 240, "Rubidium, explosive, especially on contact with water, low melting point"}, - {"LRBD", PIXPACK(0xAAAAAA), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000001f* CFDS,2, 1000, 1, 0, 2, 1, SC_EXPLOSIVE, R_TEMP+45.0f+273.15f, 170, "Liquid Rubidium."}, - {"NTCT", PIXPACK(0x505040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when hot (More than 100C)"}, - {"SAND", PIXPACK(0xFFD090), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Sand, Heavy particles. Meltable."}, - {"GLAS", PIXPACK(0x404040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 150, "Solid. Meltable. Shatters under pressure"}, - {"PTCT", PIXPACK(0x405050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when cold (Less than 120C)"}, - {"BGLA", PIXPACK(0x606060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Glass, Heavy particles. Meltable. Bagels."}, - {"THDR", PIXPACK(0xFFFFA0), 0.0f, 0.00f * CFDS, 1.0f, 0.30f, -0.99f, 0.6f, 0.62f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, SC_ELEC, 9000.0f +273.15f, 251, "Lightning! Very hot, inflicts damage upon most materials, transfers current to metals."}, - {"PLSM", PIXPACK(0xBB99FF), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.30f, 0.001f * CFDS, 0, 0, 0, 0, 0, 1, SC_GAS, 9000.0f +273.15f, 115, "Plasma, extremely hot."}, - {"ETRD", PIXPACK(0x404040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)"}, - {"NICE", PIXPACK(0xC0E0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0005f* CFDS, 0, 0, 0, 0, 20, 1, SC_SOLIDS, 35.0f, 46, "Nitrogen Ice."}, - {"NBLE", PIXPACK(0xEB4917), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 106, "Noble Gas. Diffuses. Conductive. Ionizes into plasma when intruduced to electricity"}, - {"BTRY", PIXPACK(0x858505), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Generates Electricity."}, - {"LCRY", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Liquid Crystal. Changes colour when charged. (PSCN Charges, NSCN Discharges)"}, - {"STKM", PIXPACK(0x000000), 0.5f, 0.00f * CFDS, 0.2f, 1.0f, 0.0f, 0.0f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Stickman. Don't kill him!"}, - {"SWCH", PIXPACK(0x103B11), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Only conducts when switched on. (PSCN switches on, NSCN switches off)"}, - {"SMKE", PIXPACK(0x222222), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.001f * CFDS, 1, 0, 0, 0, 1, 1, SC_GAS, R_TEMP+320.0f+273.15f, 88, "Smoke"}, - {"DESL", PIXPACK(0x440000), 1.0f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.0f, 0.0f * CFDS, 2, 2, 0, 0, 5, 1, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Vaporises under low pressure, explodes under high pressure and temperatures"}, - {"COAL", PIXPACK(0x222222), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly."}, - {"LO2", PIXPACK(0x80A0EF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 5000, 0, 0, 0, 1, SC_LIQUID, 80.0f, 70, "Liquid Oxygen. Very cold. Reacts with fire"}, - {"O2", PIXPACK(0x80A0FF), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 3.0f, 0.000f * CFDS, 0, 1000, 0, 0, 0, 1, SC_GAS, R_TEMP+0.0f +273.15f, 70, "Gas. Ignites easily."}, - {"INWR", PIXPACK(0x544141), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Insulated Wire. Doesn't conduct to metal or semiconductors."}, - {"YEST", PIXPACK(0xEEE0C0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 15, 0, 0, 30, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Yeast, grows when warm (~37C)."}, - {"DYST", PIXPACK(0xBBB0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 20, 0, 0, 30, 0, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Deat Yeast."}, - {"THRM", PIXPACK(0xA08090), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 211, "Thermite. Burns at extremly high temperature."}, - {"GLOW", PIXPACK(0x445544), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 2, 1, SC_LIQUID, R_TEMP+20.0f+273.15f, 44, "Glow, Glows under pressure"}, - {"BRCK", PIXPACK(0x808080), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Brick, breakable building material."}, - {"CFLM", PIXPACK(0x8080FF), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.0005f * CFDS, 1, 0, 0, 0, 1, 1, SC_SPECIAL, 0.0f, 88, "Sub-zero flame."}, - {"FIRW", PIXPACK(0xFFA040), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, -0.99f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 70, "Fireworks!"}, - {"FUSE", PIXPACK(0x0A5706), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly. Ignites at somewhat high temperatures and electricity."}, - {"FSEP", PIXPACK(0x63AD5F), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Fuse Powder. See FUSE."}, - {"AMTR", PIXPACK(0x808080), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.00f, 0.10f, 1.00f, 0.0000f * CFDS, 0, 0, 0, 0, 0, 1, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Anti-Matter, Destroys a majority of particles"}, - {"BCOL", PIXPACK(0x333333), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Coal. Heavy particles. See COAL"}, - {"PCLN", PIXPACK(0x3B3B10), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. When actived, duplicates any particles it touches."}, - {"HSWC", PIXPACK(0x3B1010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated"}, - //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description + //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weight 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, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Erases particles.", 0}, + {"DUST", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", TYPE_PART}, + {"WATR", PIXPACK(0x2030D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Liquid. Conducts electricity. Freezes. Extinguishes fires.", TYPE_LIQUID|PROP_CONDUCTS|PROP_NEUTPENETRATE}, + {"OIL", PIXPACK(0x404010), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 20, 0, 0, 5, 1, 20, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Flammable.", TYPE_LIQUID}, + {"FIRE", PIXPACK(0xFF1000), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.001f * CFDS, 1, 0, 0, 0, 1, 1, 2, SC_EXPLOSIVE, R_TEMP+400.0f+273.15f, 88, "Ignites flammable materials. Heats air.", TYPE_GAS}, + {"STNE", PIXPACK(0xA0A0A0), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Heavy particles. Meltable.", TYPE_PART}, + {"LAVA", PIXPACK(0xE05010), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.0003f * CFDS, 2, 0, 0, 0, 2, 1, 45, SC_LIQUID, R_TEMP+1500.0f+273.15f, 60, "Heavy liquid. Ignites flammable materials. Solidifies when cold.", TYPE_LIQUID}, + {"GUN", PIXPACK(0xC0C0D0), 0.7f, 0.02f * CFDS, 0.94f, 0.80f, -0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 600, 1, 0, 10, 1, 85, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 97, "Light dust. Explosive.", TYPE_PART}, + {"NITR", PIXPACK(0x20E010), 0.5f, 0.02f * CFDS, 0.92f, 0.97f, 0.0f, 0.2f, 0.00f, 0.000f * CFDS, 2, 1000, 2, 0, 3, 1, 23, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 50, "Liquid. Pressure sensitive explosive.", TYPE_LIQUID}, + {"CLNE", PIXPACK(0xFFD010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Solid. Duplicates any particles it touches.", TYPE_SOLID}, + {"GAS", PIXPACK(0xE0FF20), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 600, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Gas. Diffuses. Flammable. Liquifies under pressure.", TYPE_GAS}, + {"C-4", PIXPACK(0xD080E0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 1000, 2, 50, 1, 1, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Solid. Pressure sensitive explosive.", TYPE_SOLID}, + {"GOO", PIXPACK(0x804000), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 75, "Solid. Deforms and disappears under pressure.", TYPE_SOLID}, + {"ICE", PIXPACK(0xA0C0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 0, 0, 0, 0, 20, 1, 100, SC_SOLIDS, R_TEMP-50.0f+273.15f, 46, "Solid. Freezes water. Crushes under pressure. Cools down air.", TYPE_SOLID}, + {"METL", PIXPACK(0x404060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Conducts electricity. Meltable.", TYPE_SOLID|PROP_CONDUCTS}, + {"SPRK", PIXPACK(0xFFFF80), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electricity. Conducted by metal and water.", TYPE_SOLID}, + {"SNOW", PIXPACK(0xC0E0FF), 0.7f, 0.01f * CFDS, 0.96f, 0.90f, -0.1f, 0.05f, 0.01f, -0.00005f* CFDS,1, 0, 0, 0, 20, 1, 50, SC_POWDERS, R_TEMP-30.0f+273.15f, 46, "Light particles.", TYPE_PART}, + {"WOOD", PIXPACK(0xC0A040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 15, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Solid. Flammable.", TYPE_SOLID}, + {"NEUT", PIXPACK(0x20E0FF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 1, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Neutrons. Interact with matter in odd ways.", TYPE_ENERGY}, + {"PLUT", PIXPACK(0x407020), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 90, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 251, "Heavy particles. Fissile. Generates neutrons under pressure.", TYPE_PART|PROP_NEUTPENETRATE}, + {"PLNT", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Plant, drinks water and grows.", TYPE_SOLID}, + {"ACID", PIXPACK(0xED55FF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 40, 0, 0, 1, 1, 10, SC_LIQUID, R_TEMP+0.0f +273.15f, 34, "Dissolves almost everything.", TYPE_LIQUID}, + {"VOID", PIXPACK(0x790B0B), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Hole, will drain away any particles.", TYPE_SOLID}, + {"WTRV", PIXPACK(0xA0A0FF), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, -0.1f, 0.75f, 0.0003f * CFDS, 0, 0, 0, 0, 4, 1, 1, SC_GAS, R_TEMP+100.0f+273.15f, 48, "Steam, heats up air, produced from hot water.", TYPE_GAS}, + {"CNCT", PIXPACK(0xC0C0C0), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 25, 1, 55, SC_POWDERS, R_TEMP+0.0f +273.15f, 100, "Concrete, stronger than stone.", TYPE_PART}, + {"DSTW", PIXPACK(0x1020C0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 23, "Distilled water, does not conduct electricity.", TYPE_LIQUID|PROP_NEUTPENETRATE}, + {"SALT", PIXPACK(0xFFFFFF), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, 75, SC_POWDERS, R_TEMP+0.0f +273.15f, 110, "Salt, dissolves in water.", TYPE_PART}, + {"SLTW", PIXPACK(0x4050F0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 35, SC_LIQUID, R_TEMP+0.0f +273.15f, 75, "Saltwater, conducts electricity, difficult to freeze.", TYPE_LIQUID|PROP_CONDUCTS|PROP_NEUTPENETRATE}, + {"DMND", PIXPACK(0xCCFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 186, "Diamond. Indestructable.", TYPE_SOLID}, //ief015 - Added diamond. Because concrete blocks are kinda pointless. + {"BMTL", PIXPACK(0x505070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Breakable metal.", TYPE_SOLID|PROP_CONDUCTS}, + {"BRMT", PIXPACK(0x705060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 211, "Broken metal.", TYPE_PART|PROP_CONDUCTS}, + {"PHOT", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, -1, SC_ELEC, R_TEMP+900.0f+273.15f, 251, "Photons. Travel in straight lines.", TYPE_ENERGY}, + {"URAN", PIXPACK(0x707020), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 90, SC_NUCLEAR, R_TEMP+30.0f+273.15f, 251, "Heavy particles. Generates heat under pressure.", TYPE_PART}, + {"WAX", PIXPACK(0xF0F0BB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 44, "Wax. Melts at moderately high temperatures.", TYPE_SOLID}, + {"MWAX", PIXPACK(0xE0E0AA), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000001f* CFDS,2, 5, 0, 0, 2, 1, 25, SC_LIQUID, R_TEMP+28.0f+273.15f, 44, "Liquid Wax.", TYPE_LIQUID}, + {"PSCN", PIXPACK(0x805050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "P-Type Silicon, Will transfer current to any conductor.", TYPE_SOLID}, + {"NSCN", PIXPACK(0x505080), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "N-Type Silicon, Will only transfer current to P-Type Silicon.", TYPE_SOLID}, + {"LN2", PIXPACK(0x80A0DF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 0, 1, 30, SC_LIQUID, 70.15f, 70, "Liquid Nitrogen. Very cold.", TYPE_LIQUID}, + {"INSL", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Insulator, does not conduct heat or electricity.", TYPE_SOLID}, + {"BHOL", PIXPACK(0x202020), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, -0.01f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP+70.0f+273.15f, 255, "Black hole, sucks in other particles and heats up.", TYPE_SOLID}, + {"WHOL", PIXPACK(0xEFEFEF), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.010f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP-16.0f+273.15f, 255, "White hole, pushes other particles away.", TYPE_SOLID}, + {"RBDM", PIXPACK(0xCCCCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 1000, 1, 50, 1, 1, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 240, "Rubidium, explosive, especially on contact with water, low melting point", TYPE_SOLID|PROP_CONDUCTS}, + {"LRBD", PIXPACK(0xAAAAAA), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000001f* CFDS,2, 1000, 1, 0, 2, 1, 45, SC_EXPLOSIVE, R_TEMP+45.0f+273.15f, 170, "Liquid Rubidium.", TYPE_LIQUID|PROP_CONDUCTS}, + {"NTCT", PIXPACK(0x505040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when hot (More than 100C)", TYPE_SOLID}, + {"SAND", PIXPACK(0xFFD090), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Sand, Heavy particles. Meltable.", TYPE_PART}, + {"GLAS", PIXPACK(0x404040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 150, "Solid. Meltable. Shatters under pressure", TYPE_SOLID}, + {"PTCT", PIXPACK(0x405050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when cold (Less than 120C)", TYPE_SOLID}, + {"BGLA", PIXPACK(0x606060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Glass, Heavy particles. Meltable. Bagels.", TYPE_PART}, + {"THDR", PIXPACK(0xFFFFA0), 0.0f, 0.00f * CFDS, 1.0f, 0.30f, -0.99f, 0.6f, 0.62f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, SC_ELEC, 9000.0f +273.15f, 251, "Lightning! Very hot, inflicts damage upon most materials, transfers current to metals.", TYPE_ENERGY}, + {"PLSM", PIXPACK(0xBB99FF), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.30f, 0.001f * CFDS, 0, 0, 0, 0, 0, 1, 1, SC_GAS, 9000.0f +273.15f, 115, "Plasma, extremely hot.", TYPE_GAS}, + {"ETRD", PIXPACK(0x404040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)", TYPE_SOLID}, + {"NICE", PIXPACK(0xC0E0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0005f* CFDS, 0, 0, 0, 0, 20, 1, 100, SC_SOLIDS, 35.0f, 46, "Nitrogen Ice.", TYPE_SOLID}, + {"NBLE", PIXPACK(0xEB4917), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 106, "Noble Gas. Diffuses. Conductive. Ionizes into plasma when intruduced to electricity", TYPE_GAS}, + {"BTRY", PIXPACK(0x858505), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Generates Electricity.", TYPE_SOLID}, + {"LCRY", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Liquid Crystal. Changes colour when charged. (PSCN Charges, NSCN Discharges)", TYPE_SOLID}, + {"STKM", PIXPACK(0x000000), 0.5f, 0.00f * CFDS, 0.2f, 1.0f, 0.0f, 0.0f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, 50, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Stickman. Don't kill him!", 0}, + {"SWCH", PIXPACK(0x103B11), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Only conducts when switched on. (PSCN switches on, NSCN switches off)", TYPE_SOLID}, + {"SMKE", PIXPACK(0x222222), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.001f * CFDS, 1, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+320.0f+273.15f, 88, "Smoke", TYPE_GAS}, + {"DESL", PIXPACK(0x440000), 1.0f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.0f, 0.0f * CFDS, 2, 2, 0, 0, 5, 1, 15, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Explodes under high pressure and temperatures", TYPE_LIQUID}, + {"COAL", PIXPACK(0x222222), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 20, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly.", TYPE_SOLID}, + {"LO2", PIXPACK(0x80A0EF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 5000, 0, 0, 0, 1, 30, SC_LIQUID, 80.0f, 70, "Liquid Oxygen. Very cold. Reacts with fire", TYPE_LIQUID}, + {"O2", PIXPACK(0x80A0FF), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 3.0f, 0.000f * CFDS, 0, 1000, 0, 0, 0, 1, 1, SC_GAS, R_TEMP+0.0f +273.15f, 70, "Gas. Ignites easily.", TYPE_GAS}, + {"INWR", PIXPACK(0x544141), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Insulated Wire. Doesn't conduct to metal or semiconductors.", TYPE_SOLID}, + {"YEST", PIXPACK(0xEEE0C0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 15, 0, 0, 30, 1, 80, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Yeast, grows when warm (~37C).", TYPE_PART}, + {"DYST", PIXPACK(0xBBB0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 20, 0, 0, 30, 0, 80, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Dead Yeast.", TYPE_PART}, + {"THRM", PIXPACK(0xA08090), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, 90, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 211, "Thermite. Burns at extremly high temperature.", TYPE_PART}, + {"GLOW", PIXPACK(0x445544), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 2, 1, 40, SC_LIQUID, R_TEMP+20.0f+273.15f, 44, "Glow, Glows under pressure", TYPE_LIQUID}, + {"BRCK", PIXPACK(0x808080), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Brick, breakable building material.", TYPE_SOLID}, + {"CFLM", PIXPACK(0x8080FF), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.0005f * CFDS, 1, 0, 0, 0, 1, 1, 2, SC_SPECIAL, 0.0f, 88, "Sub-zero flame.", TYPE_GAS}, + {"FIRW", PIXPACK(0xFFA040), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, -0.99f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 55, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 70, "Fireworks!", TYPE_PART}, + {"FUSE", PIXPACK(0x0A5706), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 20, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly. Ignites at somewhat high temperatures and electricity.", TYPE_SOLID}, + {"FSEP", PIXPACK(0x63AD5F), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 70, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Fuse Powder. See FUSE.", TYPE_PART}, + {"AMTR", PIXPACK(0x808080), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.00f, 0.10f, 1.00f, 0.0000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Anti-Matter, Destroys a majority of particles", TYPE_PART}, //Maybe TYPE_ENERGY? + {"BCOL", PIXPACK(0x333333), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Coal. Heavy particles. See COAL", TYPE_PART}, + {"PCLN", PIXPACK(0x3B3B10), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. When actived, duplicates any particles it touches.", TYPE_SOLID}, + {"HSWC", PIXPACK(0x3B1010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", TYPE_SOLID}, + {"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID}, + {"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 0, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART}, + //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; static part_state pstates[PT_NUM] = { - // Name Solid Frzp Liquid Mpnt Gas Bpoint + // 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}, /* DUST */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* WATR */ {ST_LIQUID, PT_ICEI, 273.15f, PT_NONE, 0.0f, PT_WTRV, 373.0f, PT_NONE, 0.0f}, /* OIL */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_GAS, 333.0f, PT_NONE, 0.0f}, - /* FIRE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_PLSM, 2773.0f}, + /* FIRE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_PLSM, 2773.0f}, /* STNE */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 983.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* LAVA */ {ST_LIQUID, PT_STNE, 973.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* GUN */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 673.0f}, /* NITR */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 673.0f}, /* CLNE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* GAS */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 50.0f, PT_FIRE, 573.0f}, + /* GAS */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 50.0f, PT_FIRE, 573.0f}, /* C-4 */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 673.0f}, /* GOO */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* ICE */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 274.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, @@ -292,12 +308,12 @@ static part_state pstates[PT_NUM] = /* SPRK */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SNOW */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* WOOD */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 873.0f}, - /* NEUT */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* NEUT */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* PLUT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* PLNT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 573.0f}, /* ACID */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* VOID */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* WTRV */ {ST_GAS, PT_ICEI, 273.0f, PT_DSTW, 371.0f, PT_NONE, 373.0f, PT_NONE, 0.0f}, + /* WTRV */ {ST_GAS, PT_ICEI, 273.0f, PT_DSTW, 371.0f, PT_NONE, 373.0f, PT_NONE, 0.0f}, /* CNCT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1123.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* DSTW */ {ST_LIQUID, PT_ICEI, 273.15f, PT_NONE, 0.0f, PT_WTRV, 373.0f, PT_NONE, 0.0f}, /* SALT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1173.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, @@ -305,13 +321,13 @@ static part_state pstates[PT_NUM] = /* DMND */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* BMTL */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* BRMT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* PHOT */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* PHOT */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* URAN */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 2373.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* WAX */ {ST_SOLID, PT_NONE, 0.0f, PT_MWAX, 319.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* MWAX */ {ST_LIQUID, PT_WAX, 318.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 673.0f}, /* PSCN */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* NSCN */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* LNTG */ {ST_SOLID, PT_NICE, 63.0f, PT_NONE, 0.0f, PT_NONE, 77.0f, PT_NONE, 0.0f}, + /* LNTG */ {ST_SOLID, PT_NICE, 63.0f, PT_NONE, 0.0f, PT_NONE, 77.0f, PT_NONE, 0.0f}, /* FOAM */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* BHOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* WHOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, @@ -325,123 +341,32 @@ static part_state pstates[PT_NUM] = /* THDR */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* PLSM */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* ETRD */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* NICE */ {ST_SOLID, PT_NONE, 0.0f, PT_LNTG, 63.1f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* NBLE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* NICE */ {ST_SOLID, PT_NONE, 0.0f, PT_LNTG, 63.1f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* NBLE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* BTRY */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_PLSM, 2273.0f}, /* LCRY */ {ST_SOLID, PT_NONE, 0.0f, PT_BGLA, 1273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* STKM */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 620.0f}, /* SWCH */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SMKE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 625.0f}, - /* DESL */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 335.0f}, - /* COAL */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* LO2 */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_O2, 90.1f, PT_NONE, 0.0f}, - /* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LO2, 90.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* DESL */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 335.0f}, + /* COAL */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* LO2 */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_O2, 90.1f, PT_NONE, 0.0f}, + /* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LO2, 90.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* INWR */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* YEST */ {ST_SOLID, PT_NONE, 0.0f, PT_DYST, 373.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* DYST */ {ST_SOLID, PT_NONE, 0.0f, PT_DUST, 473.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}, /* GLOW */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* BRCK */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1223.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* HFLM */ {ST_GAS, PT_NONE, 0.0f, PT_NONE,0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* FIRW */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE,0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* FUSE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* FSEP */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* AMtr */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* BCOL */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* PCLN */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* HSWC */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, -}; - -static unsigned char can_move[PT_NUM][PT_NUM] = -{ - /* Water | Oil */ - /* Water 0 | 1 | Water displaces oil */ - /* Oil 0 | 0 | Oil doesn't displace water */ - - /* N D W O F S L G N C G P D I M S S W N P P A V W C D S S D B B P U W M P N L I B W R L H S G C B T P E N N B L S S S D C L O I Y D T G B H F F F A B P H */ - /* o u a i i t a u i l a l f c e p n o e l l c o t n s a l m m r h r a W S S N N H H b R S a l s G h l t i B t C T W M e o O 2 N E Y H L R F I U S M C C S */ - /* n s t l r n v n t n s e r e t r o o u u n i i r c t l t n t m o a x a c c 2 S o o d b C n a c l d s r c L r r K C K s a X W S S R O C L R S E T O L W */ - /* e t r l e e a p r e s x m i l 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 l l R T T M W K M W E P R L N C */ - /* NONE */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* None */ - /* DUST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0}, /* Dust */ - /* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0}, /* Watr */ - /* OILL */ {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* Oill */ - /* FIRE */ {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* Fire */ - /* STNE */ {0,1,1,1,0,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,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,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,0,0}, /* FSEP */ - /* AMTR */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* AMTR */ - /* BCOL */ {0,1,1,1,1,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,1,0,1,1,0,1,1,0,1,0,1,0,0,1,0,0,0,0}, /* BCOL */ - /* PCLN */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* PCLN */ - /* HSWC */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* HSWC */ - /* N D W O F S L G N C G P D I M S S W N P P A V W C D S S D B B P U W M P N L I B W R L H S G C B T P E N N B L S S S D C L O I Y D T G B H F F F A B P H */ - /* o u a i i t a u i l a l f c e p n o e l l c o t n s a l m m r h r a W S S N N H H b R S a l s G h l t i B t C T W M e o O 2 N E Y H L R F I U S M C C S */ - /* n s t l r n v n t n s e r e t r o o u u n i i r c t l t n t m o a x a c c 2 S o o d b C n a c l d s r c L r r K C K s a X W S S R O C L R S E T O L W */ - /* e t r l e e a p r e s x m i l 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 l l R T T M W K M W E P R L N C */ + /* HFLM */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* FIRW */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* FUSE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* FSEP */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* AMtr */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* BCOL */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* PCLN */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* HSWC */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* IRON */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; extern int isplayer; @@ -494,7 +419,7 @@ void set_emap(int x, int y); #ifdef WIN32 _inline int parts_avg(int ci, int ni); #else -inline int parts_avg(int ci, int ni); +int parts_avg(int ci, int ni); #endif int nearest_part(int ci, int t); diff --git a/src/graphics.c b/src/graphics.c index 2c9a68649..d6604a3e5 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -745,15 +745,15 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) void draw_menu(pixel *vid_buf, int i, int hover) { - drawrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); + drawrect(vid_buf, (XRES+BARSIZE)-16, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); if(hover==i) { - fillrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); - drawtext(vid_buf, XRES+1, (i*16)+YRES+MENUSIZE-14-(SC_TOTAL*16), msections[i].icon, 0, 0, 0, 255); + fillrect(vid_buf, (XRES+BARSIZE)-16, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); + drawtext(vid_buf, (XRES+BARSIZE)-13, (i*16)+YRES+MENUSIZE-14-(SC_TOTAL*16), msections[i].icon, 0, 0, 0, 255); } else { - drawtext(vid_buf, XRES+1, (i*16)+YRES+MENUSIZE-14-(SC_TOTAL*16), msections[i].icon, 255, 255, 255, 255); + drawtext(vid_buf, (XRES+BARSIZE)-13, (i*16)+YRES+MENUSIZE-14-(SC_TOTAL*16), msections[i].icon, 255, 255, 255, 255); } } @@ -844,6 +844,62 @@ int drawtext(pixel *vid, int x, int y, const char *s, int r, int g, int b, int a #endif return x; } +int drawtextwrap(pixel *vid, int x, int y, int w, const char *s, int r, int g, int b, int a) +{ +#ifdef OpenGL +#else + int sx = x; + int rh = 12; + int rw = 0; + int cw = x; + for(; *s; s++) + { + if(*s == '\n') + { + x = sx; + rw = 0; + y += FONT_H+2; + } + else if(*s == '\b') + { + switch(s[1]) + { + case 'w': + r = g = b = 255; + break; + case 'g': + r = g = b = 192; + break; + case 'o': + r = 255; + g = 216; + b = 32; + break; + case 'r': + r = 255; + g = b = 0; + break; + case 'b': + r = g = 0; + b = 255; + break; + } + s++; + } + else + { + if(x-cw>=w) { + x = sx; + rw = 0; + y+=FONT_H+2; + rh+=FONT_H+2; + } + x = drawchar(vid, x, y, *(unsigned char *)s, r, g, b, a); + } + } +#endif + return rh; +} void drawrect(pixel *vid, int x, int y, int w, int h, int r, int g, int b, int a) { @@ -946,6 +1002,19 @@ int textnwidth(char *s, int n) } return x-1; } +int textnheight(char *s, int n, int w) +{ + int x = 0; + //TODO: Implement Textnheight for wrapped text + for(; *s; s++) + { + if(!n) + break; + x += font_data[font_ptrs[(int)(*(unsigned char *)s)]]; + n--; + } + return x-1; +} int textwidthx(char *s, int w) { @@ -1420,20 +1489,20 @@ void draw_parts(pixel *vid) cg = 0; cb = 0; cr = 0; - for(x=0; x<12; x++) { - cr += (parts[i].ctype >> (x+18)) & 1; - cb += (parts[i].ctype >> x) & 1; - } - for(x=0; x<14; x++) - cg += (parts[i].ctype >> (x+9)) & 1; - x = 624/(cr+cg+cb+1); - cr *= x; - cg *= x; - cb *= x; + for(x=0; x<12; x++) { + cr += (parts[i].ctype >> (x+18)) & 1; + cb += (parts[i].ctype >> x) & 1; + } + for(x=0; x<14; x++) + cg += (parts[i].ctype >> (x+9)) & 1; + x = 624/(cr+cg+cb+1); + cr *= x; + cg *= x; + cb *= x; vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(cr>255?255:cr,cg>255?255:cg,cb>255?255:cb); - cr >>= 4; - cg >>= 4; - cb >>= 4; + cr >>= 4; + cg >>= 4; + cb >>= 4; x = nx/CELL; y = ny/CELL; cg += fire_g[y][x]; @@ -1448,9 +1517,22 @@ void draw_parts(pixel *vid) } else { - cr = 0xFF; - cg = 0xFF; - cb = 0xFF; + cg = 0; + cb = 0; + cr = 0; + for(x=0; x<12; x++) { + cr += (parts[i].ctype >> (x+18)) & 1; + cb += (parts[i].ctype >> x) & 1; + } + for(x=0; x<14; x++) + cg += (parts[i].ctype >> (x+9)) & 1; + x = 624/(cr+cg+cb+1); + cr *= x; + cg *= x; + cb *= x; + cr = cr>255?255:cr; + cg = cg>255?255:cg; + cb = cb>255?255:cb; 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); @@ -1883,45 +1965,48 @@ void draw_parts(pixel *vid) } else if(t==PT_FIRE && parts[i].life) { - float ttemp = (float)parts[i].life; - int caddress = restrict_flt(restrict_flt(ttemp, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); - uint8 R = flm_data[caddress]; - uint8 G = flm_data[caddress+1]; - uint8 B = flm_data[caddress+2]; - if(cmode == 3||cmode==4 || cmode==6) - { - cr = R/8; - cg = G/8; - cb = B/8; - x = nx/CELL; - y = ny/CELL; - cg += fire_g[y][x]; - if(cg > 255) cg = 255; - fire_g[y][x] = cg; - cb += fire_b[y][x]; - if(cb > 255) cb = 255; - fire_b[y][x] = cb; - cr += fire_r[y][x]; - if(cr > 255) cr = 255; - fire_r[y][x] = cr; - } - else - { - cr = R; - cg = G; - cb = B; - 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); - blendpixel(vid, nx+1, ny-1, cr, cg, cb, 32); - blendpixel(vid, nx-1, ny+1, cr, cg, cb, 32); - blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); - blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); - } - // Older Code - /*if(cmode == 3||cmode==4 || cmode==6) + float ttemp = (float)((int)(parts[i].life/2)); + int caddress = restrict_flt(restrict_flt(ttemp, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); + uint8 R = flm_data[caddress]; + uint8 G = flm_data[caddress+1]; + uint8 B = flm_data[caddress+2]; + if(cmode == 3||cmode==4 || cmode==6) + { + cr = R/8; + cg = G/8; + cb = B/8; + x = nx/CELL; + y = ny/CELL; + cg += fire_g[y][x]; + if(cg > 255) cg = 255; + fire_g[y][x] = cg; + cb += fire_b[y][x]; + if(cb > 255) cb = 255; + fire_b[y][x] = cb; + cr += fire_r[y][x]; + if(cr > 255) cr = 255; + fire_r[y][x] = cr; + } + else + { + cr = parts[i].life * 8; + cg = parts[i].life * 2; + cb = parts[i].life; + if(cr>255) cr = 255; + if(cg>192) cg = 212; + if(cb>128) cb = 192; + blendpixel(vid, nx, ny, cr, cg, cb, 255); + 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); + blendpixel(vid, nx+1, ny-1, cr, cg, cb, 32); + blendpixel(vid, nx-1, ny+1, cr, cg, cb, 32); + blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); + blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); + } + // Older Code + /*if(cmode == 3||cmode==4 || cmode==6) { cr = parts[i].life / 4; cg = parts[i].life / 16; @@ -2065,23 +2150,42 @@ void draw_parts(pixel *vid) } if(cmode == 4&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_HFLM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH&&t!=PT_SMKE&&t!=PT_WTRV&&!(t==PT_FIRW&&parts[i].tmp==3)) { - uint8 R = PIXR(ptypes[t].pcolors); - uint8 G = PIXG(ptypes[t].pcolors); - uint8 B = PIXB(ptypes[t].pcolors); + if(t==PT_PHOT) { + cg = 0; + cb = 0; + cr = 0; + for(x=0; x<12; x++) { + cr += (parts[i].ctype >> (x+18)) & 1; + cb += (parts[i].ctype >> x) & 1; + } + for(x=0; x<14; x++) + cg += (parts[i].ctype >> (x+9)) & 1; + x = 624/(cr+cg+cb+1); + cr *= x; + cg *= x; + cb *= x; + cr = cr>255?255:cr; + cg = cg>255?255:cg; + cb = cb>255?255:cb; + } else { + cr = PIXR(ptypes[t].pcolors); + cg = PIXG(ptypes[t].pcolors); + cb = PIXB(ptypes[t].pcolors); + } //if(vid[(ny-1)*YRES+(nx-1)]!=0){ // blendpixel(vid, nx, ny-1, R, G, B, 46); //} - blendpixel(vid, nx+1, ny, R, G, B, 223); - blendpixel(vid, nx-1, ny, R, G, B, 223); - blendpixel(vid, nx, ny+1, R, G, B, 223); - blendpixel(vid, nx, ny-1, R, G, B, 223); + blendpixel(vid, nx+1, ny, cr, cg, cb, 223); + blendpixel(vid, nx-1, ny, cr, cg, cb, 223); + blendpixel(vid, nx, ny+1, cr, cg, cb, 223); + blendpixel(vid, nx, ny-1, cr, cg, cb, 223); - blendpixel(vid, nx+1, ny-1, R, G, B, 112); - blendpixel(vid, nx-1, ny-1, R, G, B, 112); - blendpixel(vid, nx+1, ny+1, R, G, B, 112); - blendpixel(vid, nx-1, ny+1, R, G, B, 112); + blendpixel(vid, nx+1, ny-1, cr, cg, cb, 112); + blendpixel(vid, nx-1, ny-1, cr, cg, cb, 112); + blendpixel(vid, nx+1, ny+1, cr, cg, cb, 112); + blendpixel(vid, nx-1, ny+1, cr, cg, cb, 112); } } #endif diff --git a/src/interface.c b/src/interface.c index bdec1114f..4ab7bf4ac 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1,3 +1,6 @@ +#ifdef MACOSX +#include +#endif #include #include #include @@ -46,6 +49,7 @@ void *search_thumbs[GRID_X*GRID_Y]; int search_thsizes[GRID_X*GRID_Y]; int search_own = 0; +int search_fav = 0; int search_date = 0; int search_page = 0; char search_expr[256] = ""; @@ -207,7 +211,7 @@ void add_sign_ui(pixel *vid_buf, int mx, int my) strcpy(signs[i].text, ed.str); signs[i].ju = ju; } - +//TODO: Finish text wrapping in text edits void ui_edit_draw(pixel *vid_buf, ui_edit *ed) { int cx, i; @@ -225,8 +229,13 @@ void ui_edit_draw(pixel *vid_buf, ui_edit *ed) if(ed->str[0]) { - drawtext(vid_buf, ed->x, ed->y, str, 255, 255, 255, 255); - drawtext(vid_buf, ed->x+ed->w-11, ed->y-1, "\xAA", 128, 128, 128, 255); + if(ed->multiline){ + drawtextwrap(vid_buf, ed->x, ed->y, ed->w-14, str, 255, 255, 255, 255); + drawtext(vid_buf, ed->x+ed->w-11, ed->y-1, "\xAA", 128, 128, 128, 255); + } else { + drawtext(vid_buf, ed->x, ed->y, str, 255, 255, 255, 255); + drawtext(vid_buf, ed->x+ed->w-11, ed->y-1, "\xAA", 128, 128, 128, 255); + } } else if(!ed->focus) drawtext(vid_buf, ed->x, ed->y, ed->def, 128, 128, 128, 255); @@ -258,19 +267,35 @@ void ui_edit_process(int mx, int my, int mb, ui_edit *ed) else str = ed->str; - if(mx>=ed->x+ed->w-11 && mxx+ed->w && my>=ed->y-5 && myy+11) - { - ed->focus = 1; - ed->cursor = 0; - ed->str[0] = 0; - } - else if(mx>=ed->x-ed->nx && mxx+ed->w && my>=ed->y-5 && myy+11) - { - ed->focus = 1; - ed->cursor = textwidthx(str, mx-ed->x); - } - else - ed->focus = 0; + if(ed->multiline){ + if(mx>=ed->x+ed->w-11 && mxx+ed->w && my>=ed->y-5 && myy+11) + { + ed->focus = 1; + ed->cursor = 0; + ed->str[0] = 0; + } + else if(mx>=ed->x-ed->nx && mxx+ed->w && my>=ed->y-5 && myy+ed->h) + { + ed->focus = 1; + ed->cursor = textwidthx(str, mx-ed->x); + } + else + ed->focus = 0; + } else { + if(mx>=ed->x+ed->w-11 && mxx+ed->w && my>=ed->y-5 && myy+11) + { + ed->focus = 1; + ed->cursor = 0; + ed->str[0] = 0; + } + else if(mx>=ed->x-ed->nx && mxx+ed->w && my>=ed->y-5 && myy+11) + { + ed->focus = 1; + ed->cursor = textwidthx(str, mx-ed->x); + } + else + ed->focus = 0; + } } if(ed->focus && sdl_key) { @@ -335,19 +360,19 @@ void ui_edit_process(int mx, int my, int mb, ui_edit *ed) } ts[0]=ed->hide?0x8D:ch; ts[1]=0; - if(textwidth(str)+textwidth(ts) > ed->w-14) + if((textwidth(str)+textwidth(ts) > ed->w-14 && !ed->multiline) || (float)(((textwidth(str)+textwidth(ts))/(ed->w-14)*12) > ed->h && ed->multiline)) break; memmove(ed->str+ed->cursor+1, ed->str+ed->cursor, l+1-ed->cursor); ed->str[ed->cursor] = ch; ed->cursor++; } #else - if(sdl_ascii>=' ' && sdl_ascii<127) + if(sdl_ascii>=' ' && sdl_ascii<127 && l<255) { ch = sdl_ascii; ts[0]=ed->hide?0x8D:ch; ts[1]=0; - if(textwidth(str)+textwidth(ts) > ed->w-14) + if((textwidth(str)+textwidth(ts) > ed->w-14 && !ed->multiline) || (float)(((textwidth(str)+textwidth(ts))/(ed->w-14)*12) > ed->h && ed->multiline)) break; memmove(ed->str+ed->cursor+1, ed->str+ed->cursor, l+1-ed->cursor); ed->str[ed->cursor] = ch; @@ -1121,6 +1146,7 @@ int save_name_ui(pixel *vid_buf) ed.focus = 1; ed.hide = 0; ed.cursor = strlen(svf_name); + ed.multiline = 0; strcpy(ed.str, svf_name); cb.x = x0+10; @@ -1759,7 +1785,7 @@ corrupt: int search_ui(pixel *vid_buf) { - int uih=0,nyu,nyd,b=1,bq,mx=0,my=0,mxq=0,myq=0,mmt=0,gi,gj,gx,gy,pos,i,mp,dp,dap,own,last_own=search_own,page_count=0,last_page=0,last_date=0,j,w,h,st=0,lv; + int uih=0,nyu,nyd,b=1,bq,mx=0,my=0,mxq=0,myq=0,mmt=0,gi,gj,gx,gy,pos,i,mp,dp,dap,own,last_own=search_own,last_fav=search_fav,page_count=0,last_page=0,last_date=0,j,w,h,st=0,lv; int is_p1=0, exp_res=GRID_X*GRID_Y, tp, view_own=0; int thumb_drawn[GRID_X*GRID_Y]; pixel *v_buf = (pixel *)malloc(((YRES+MENUSIZE)*(XRES+BARSIZE))*PIXELSIZE); @@ -1817,6 +1843,7 @@ int search_ui(pixel *vid_buf) ed.focus = 1; ed.hide = 0; ed.cursor = strlen(search_expr); + ed.multiline = 0; strcpy(ed.str, search_expr); sdl_wheel = 0; @@ -1851,39 +1878,50 @@ int search_ui(pixel *vid_buf) if(!svf_login) { search_own = 0; - drawrect(vid_buf, XRES-64, 8, 56, 16, 96, 96, 96, 255); - drawtext(vid_buf, XRES-61, 11, "\x94", 96, 80, 16, 255); - drawtext(vid_buf, XRES-61, 11, "\x93", 128, 128, 128, 255); - drawtext(vid_buf, XRES-46, 13, "My Own", 128, 128, 128, 255); + drawrect(vid_buf, XRES-64+16, 8, 56, 16, 96, 96, 96, 255); + drawtext(vid_buf, XRES-61+16, 11, "\x94", 96, 80, 16, 255); + drawtext(vid_buf, XRES-61+16, 11, "\x93", 128, 128, 128, 255); + drawtext(vid_buf, XRES-46+16, 13, "My Own", 128, 128, 128, 255); } else if(search_own) { - fillrect(vid_buf, XRES-65, 7, 58, 18, 255, 255, 255, 255); - drawtext(vid_buf, XRES-61, 11, "\x94", 192, 160, 64, 255); - drawtext(vid_buf, XRES-61, 11, "\x93", 32, 32, 32, 255); - drawtext(vid_buf, XRES-46, 13, "My Own", 0, 0, 0, 255); + fillrect(vid_buf, XRES-65+16, 7, 58, 18, 255, 255, 255, 255); + drawtext(vid_buf, XRES-61+16, 11, "\x94", 192, 160, 64, 255); + drawtext(vid_buf, XRES-61+16, 11, "\x93", 32, 32, 32, 255); + drawtext(vid_buf, XRES-46+16, 13, "My Own", 0, 0, 0, 255); } else { - drawrect(vid_buf, XRES-64, 8, 56, 16, 192, 192, 192, 255); - drawtext(vid_buf, XRES-61, 11, "\x94", 192, 160, 32, 255); - drawtext(vid_buf, XRES-61, 11, "\x93", 255, 255, 255, 255); - drawtext(vid_buf, XRES-46, 13, "My Own", 255, 255, 255, 255); + drawrect(vid_buf, XRES-64+16, 8, 56, 16, 192, 192, 192, 255); + drawtext(vid_buf, XRES-61+16, 11, "\x94", 192, 160, 32, 255); + drawtext(vid_buf, XRES-61+16, 11, "\x93", 255, 255, 255, 255); + drawtext(vid_buf, XRES-46+16, 13, "My Own", 255, 255, 255, 255); + } + + if(search_fav) + { + fillrect(vid_buf, XRES-134, 7, 18, 18, 255, 255, 255, 255); + drawtext(vid_buf, XRES-130, 11, "\xCC", 192, 160, 64, 255); + } + else + { + drawrect(vid_buf, XRES-134, 8, 16, 16, 192, 192, 192, 255); + drawtext(vid_buf, XRES-130, 11, "\xCC", 192, 160, 32, 255); } if(search_date) { - fillrect(vid_buf, XRES-130, 7, 62, 18, 255, 255, 255, 255); - drawtext(vid_buf, XRES-126, 11, "\xA6", 32, 32, 32, 255); - drawtext(vid_buf, XRES-111, 13, "By date", 0, 0, 0, 255); + fillrect(vid_buf, XRES-130+16, 7, 62, 18, 255, 255, 255, 255); + drawtext(vid_buf, XRES-126+16, 11, "\xA6", 32, 32, 32, 255); + drawtext(vid_buf, XRES-111+16, 13, "By date", 0, 0, 0, 255); } else { - drawrect(vid_buf, XRES-129, 8, 60, 16, 192, 192, 192, 255); - drawtext(vid_buf, XRES-126, 11, "\xA9", 144, 48, 32, 255); - drawtext(vid_buf, XRES-126, 11, "\xA8", 32, 144, 32, 255); - drawtext(vid_buf, XRES-126, 11, "\xA7", 255, 255, 255, 255); - drawtext(vid_buf, XRES-111, 13, "By votes", 255, 255, 255, 255); + drawrect(vid_buf, XRES-129+16, 8, 60, 16, 192, 192, 192, 255); + drawtext(vid_buf, XRES-126+16, 11, "\xA9", 144, 48, 32, 255); + drawtext(vid_buf, XRES-126+16, 11, "\xA8", 32, 144, 32, 255); + drawtext(vid_buf, XRES-126+16, 11, "\xA7", 255, 255, 255, 255); + drawtext(vid_buf, XRES-111+16, 13, "By votes", 255, 255, 255, 255); } if(search_page) @@ -2133,16 +2171,21 @@ int search_ui(pixel *vid_buf) if(sdl_key==SDLK_ESCAPE) goto finish; - if(b && !bq && mx>=XRES-64 && mx<=XRES-8 && my>=8 && my<=24 && svf_login) + if(b && !bq && mx>=XRES-64+16 && mx<=XRES-8+16 && my>=8 && my<=24 && svf_login) { search_own = !search_own; lasttime = TIMEOUT; } - if(b && !bq && mx>=XRES-129 && mx<=XRES-65 && my>=8 && my<=24) + if(b && !bq && mx>=XRES-129+16 && mx<=XRES-65+16 && my>=8 && my<=24) { search_date = !search_date; lasttime = TIMEOUT; } + if(b && !bq && mx>=XRES-134 && mx<=XRES-134+16 && my>=8 && my<=24) + { + search_fav = !search_fav; + lasttime = TIMEOUT; + } if(b && !bq && dp!=-1) if(confirm_ui(vid_buf, "Do you want to delete?", search_names[dp], "Delete")) @@ -2180,6 +2223,10 @@ int search_ui(pixel *vid_buf) if((b && !bq && mp!=-1 && !st && !uih) || do_open==1) { + if(open_ui(vid_buf, search_ids[mp], search_dates[mp]?search_dates[mp]:NULL)==1) { + goto finish; + } + /* fillrect(vid_buf, 0, 0, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 255); info_box(vid_buf, "Loading..."); @@ -2300,17 +2347,17 @@ int search_ui(pixel *vid_buf) if(data) free(data); - goto finish; + goto finish;*/ } if(!last) { search = 1; } - else if(!active && (strcmp(last, ed.str) || last_own!=search_own || last_date!=search_date || last_page!=search_page)) + else if(!active && (strcmp(last, ed.str) || last_own!=search_own || last_date!=search_date || last_page!=search_page || last_fav!=search_fav)) { search = 1; - if(strcmp(last, ed.str) || last_own!=search_own || last_date!=search_date) + if(strcmp(last, ed.str) || last_own!=search_own || last_fav!=search_fav || last_date!=search_date) { search_page = 0; page_count = 0; @@ -2328,8 +2375,10 @@ int search_ui(pixel *vid_buf) last_own = search_own; last_date = search_date; last_page = search_page; + last_fav = search_fav; active = 1; - uri = malloc(strlen(last)*3+80+strlen(SERVER)+strlen(svf_user)); + // TODO: Create a better fix for this bug + uri = malloc(strlen(last)*3+180+strlen(SERVER)+strlen(svf_user)+20); //Increase "padding" from 80 to 180 to fix the search memory corruption bug if(search_own || svf_admin || svf_mod) tmp = "&ShowVotes=true"; else @@ -2358,6 +2407,10 @@ int search_ui(pixel *vid_buf) strcaturl(uri, " user:"); strcaturl(uri, svf_user); } + if(search_fav) + { + strcaturl(uri, " cat:favs"); + } if(search_date) strcaturl(uri, " sort:date"); @@ -2495,6 +2548,449 @@ finish: return 0; } +int open_ui(pixel *vid_buf, char *save_id, char *save_date) +{ + int b=1,bq,mx,my,ca=0,thumb_w,thumb_h,active=0,active_2=0,cc=0,ccy=0,cix=0,hasdrawninfo=0,hasdrawnthumb=0,authoritah=0,myown=0,queue_open=0,data_size=0,retval=0,bc=255,openable=1; + char *uri, *uri_2, *o_uri; + void *data, *info_data; + save_info *info = malloc(sizeof(save_info)); + void *http = NULL, *http_2 = NULL; + int lasttime = TIMEOUT; + int status, status_2, info_ready = 0, data_ready = 0; + time_t http_last_use = HTTP_TIMEOUT, http_last_use_2 = HTTP_TIMEOUT; + pixel *save_pic;// = malloc((XRES/2)*(YRES/2)); + ui_edit ed; + + pixel *old_vid=(pixel *)calloc((XRES+BARSIZE)*(YRES+MENUSIZE), PIXELSIZE); + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + + fillrect(vid_buf, 50, 50, XRES+BARSIZE-100, YRES+MENUSIZE-100, 0, 0, 0, 255); + drawrect(vid_buf, 50, 50, XRES+BARSIZE-100, YRES+MENUSIZE-100, 255, 255, 255, 255); + drawrect(vid_buf, 50, 50, (XRES/2)+1, (YRES/2)+1, 255, 255, 255, 155); + drawrect(vid_buf, 50+(XRES/2)+1, 50, XRES+BARSIZE-100-((XRES/2)+1), YRES+MENUSIZE-100, 155, 155, 155, 255); + drawtext(vid_buf, 50+(XRES/4)-textwidth("Loading...")/2, 50+(YRES/4), "Loading...", 255, 255, 255, 128); + + ed.x = 57+(XRES/2)+1; + ed.y = YRES+MENUSIZE-118; + ed.w = XRES+BARSIZE-114-((XRES/2)+1); + ed.h = 48; + ed.nx = 1; + ed.def = "Add comment"; + ed.focus = 1; + ed.hide = 0; + ed.multiline = 1; + ed.cursor = 0; + strcpy(ed.str, ""); + + memcpy(old_vid, vid_buf, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); + + while(!sdl_poll()) + { + b = SDL_GetMouseState(&mx, &my); + if(!b) + break; + } + + //Begin Async loading of data + if(save_date) { + // We're loading an historical save + uri = malloc(strlen(save_id)*3+strlen(save_date)*3+strlen(SERVER)+71); + strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); + strcaturl(uri, save_id); + strappend(uri, "&Date="); + strcaturl(uri, save_date); + + uri_2 = malloc(strlen(save_id)*3+strlen(save_date)*3+strlen(SERVER)+71); + strcpy(uri_2, "http://" SERVER "/Info.api?ID="); + strcaturl(uri_2, save_id); + strappend(uri_2, "&Date="); + strcaturl(uri_2, save_date); + } else { + //We're loading a normal save + uri = malloc(strlen(save_id)*3+strlen(SERVER)+64); + strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); + strcaturl(uri, save_id); + + uri_2 = malloc(strlen(save_id)*3+strlen(SERVER)+64); + strcpy(uri_2, "http://" SERVER "/Info.api?ID="); + strcaturl(uri_2, save_id); + } + http = http_async_req_start(http, uri, NULL, 0, 1); + http_2 = http_async_req_start(http_2, uri_2, NULL, 0, 1); + if(svf_login) + { + http_auth_headers(http, svf_user, svf_pass); + http_auth_headers(http_2, svf_user, svf_pass); + } + http_last_use = time(NULL); + http_last_use_2 = time(NULL); + free(uri); + free(uri_2); + active = 1; + active_2 = 1; + while(!sdl_poll()) + { + bq = b; + b = SDL_GetMouseState(&mx, &my); + mx /= sdl_scale; + my /= sdl_scale; + + if(active && http_async_req_status(http)) + { + int imgh, imgw, nimgh, nimgw; + http_last_use = time(NULL); + data = http_async_req_stop(http, &status, &data_size); + if(status == 200) + { + pixel *full_save = prerender_save(data, data_size, &imgw, &imgh); + save_pic = rescale_img(full_save, imgw, imgh, &thumb_w, &thumb_h, 2); + data_ready = 1; + free(full_save); + } + active = 0; + free(http); + http = NULL; + } + if(active_2 && http_async_req_status(http_2)) + { + http_last_use_2 = time(NULL); + info_data = http_async_req_stop(http_2, &status_2, NULL); + if(status_2 == 200) + { + info_ready = info_parse(info_data, info); + if(info_ready==-1) { + error_ui(vid_buf, 0, "Not found"); + break; + } + } + free(info_data); + active_2 = 0; + free(http_2); + http_2 = NULL; + } + + if(data_ready && !hasdrawnthumb) { + draw_image(vid_buf, save_pic, 51, 51, thumb_w, thumb_h, 255); + hasdrawnthumb = 1; + memcpy(old_vid, vid_buf, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); + } + if(info_ready && !hasdrawninfo) { + //drawtext(vid_buf, 2, 2, info->name, 255, 255, 255, 255); + cix = drawtext(vid_buf, 60, (YRES/2)+60, info->name, 255, 255, 255, 255); + cix = drawtext(vid_buf, 60, (YRES/2)+72, "Author:", 255, 255, 255, 155); + cix = drawtext(vid_buf, cix+4, (YRES/2)+72, info->author, 255, 255, 255, 255); + cix = drawtext(vid_buf, cix+4, (YRES/2)+72, "Date:", 255, 255, 255, 155); + cix = drawtext(vid_buf, cix+4, (YRES/2)+72, info->date, 255, 255, 255, 255); + drawtextwrap(vid_buf, 62, (YRES/2)+86, (XRES/2)-24, info->description, 255, 255, 255, 200); + + ccy = 0; + for(cc=0; cccomment_count; cc++) { + drawtext(vid_buf, 60+(XRES/2)+1, ccy+60, info->commentauthors[cc], 255, 255, 255, 255); + ccy += 12; + ccy += drawtextwrap(vid_buf, 60+(XRES/2)+1, ccy+60, XRES+BARSIZE-100-((XRES/2)+1)-20, info->comments[cc], 255, 255, 255, 185); + ccy += 10; + draw_line(vid_buf, 50+(XRES/2)+2, ccy+52, XRES+BARSIZE-50, ccy+52, 100, 100, 100, XRES+BARSIZE); + } + hasdrawninfo = 1; + myown = svf_login && !strcmp(info->author, svf_user); + authoritah = svf_login && (!strcmp(info->author, svf_user) || svf_admin || svf_mod); + memcpy(old_vid, vid_buf, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); + } + if(info_ready && svf_login){ + + fillrect(vid_buf, 50+(XRES/2)+1, YRES+MENUSIZE-125, XRES+BARSIZE-100-((XRES/2)+1), 75, 0, 0, 0, 255); + drawrect(vid_buf, 50+(XRES/2)+1, YRES+MENUSIZE-125, XRES+BARSIZE-100-((XRES/2)+1), 75, 200, 200, 200, 255); + + drawrect(vid_buf, 54+(XRES/2)+1, YRES+MENUSIZE-121, XRES+BARSIZE-108-((XRES/2)+1), 48, 255, 255, 255, 200); + + ui_edit_draw(vid_buf, &ed); + + drawrect(vid_buf, XRES+BARSIZE-100, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 255); + drawtext(vid_buf, XRES+BARSIZE-90, YRES+MENUSIZE-63, "Submit", 255, 255, 255, 255); + } + + if(queue_open) { + if(info_ready && data_ready) { + // Do Open! + status = parse_save(data, data_size, 1, 0, 0); + if(!status) { + //if(svf_last) + //free(svf_last); + svf_last = data; + svf_lsize = data_size; + + svf_open = 1; + svf_own = svf_login && !strcmp(info->author, svf_user); + svf_publish = info->publish && svf_login && !strcmp(info->author, svf_user); + + strcpy(svf_id, save_id); + strcpy(svf_name, info->name); + if(info->tags) + { + strncpy(svf_tags, info->tags, 255); + svf_tags[255] = 0; + } else { + svf_tags[0] = 0; + } + svf_myvote = info->myvote; + retval = 1; + break; + } else { + queue_open = 0; + + svf_open = 0; + svf_publish = 0; + svf_own = 0; + svf_myvote = 0; + svf_id[0] = 0; + svf_name[0] = 0; + svf_tags[0] = 0; + if(svf_last) + free(svf_last); + svf_last = NULL; + error_ui(vid_buf, 0, "An Error Occurred"); + } + } else { + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 190); + drawtext(vid_buf, XRES+BARSIZE/2, XRES+MENUSIZE, "Loading...", 0, 0, 0, 200); + } + } + + //Open Button + bc = openable?255:150; + drawrect(vid_buf, 50, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, bc); + drawtext(vid_buf, 73, YRES+MENUSIZE-63, "Open", 255, 255, 255, bc); + drawtext(vid_buf, 58, YRES+MENUSIZE-64, "\x81", 255, 255, 255, bc); + //Fav Button + bc = svf_login?255:150; + drawrect(vid_buf, 100, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, bc); + drawtext(vid_buf, 122, YRES+MENUSIZE-63, "Fav.", 255, 255, 255, bc); + drawtext(vid_buf, 107, YRES+MENUSIZE-64, "\xCC", 255, 255, 255, bc); + //Report Button + bc = (svf_login && info_ready)?255:150; + drawrect(vid_buf, 150, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, bc); + drawtext(vid_buf, 168, YRES+MENUSIZE-63, "Report", 255, 255, 255, bc); + drawtext(vid_buf, 158, YRES+MENUSIZE-63, "!", 255, 255, 255, bc); + //Delete Button + bc = authoritah?255:150; + drawrect(vid_buf, 200, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, bc); + drawtext(vid_buf, 218, YRES+MENUSIZE-63, "Delete", 255, 255, 255, bc); + drawtext(vid_buf, 206, YRES+MENUSIZE-64, "\xAA", 255, 255, 255, bc); + //Open in browser button + bc = 255; + drawrect(vid_buf, 250, YRES+MENUSIZE-68, 107, 18, 255, 255, 255, bc); + drawtext(vid_buf, 273, YRES+MENUSIZE-63, "Open in Browser", 255, 255, 255, bc); + drawtext(vid_buf, 258, YRES+MENUSIZE-64, "\x81", 255, 255, 255, bc); + + //Open Button + if(sdl_key==SDLK_RETURN && openable) { + queue_open = 1; + } + if(mx > 50 && mx < 50+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && openable) { + fillrect(vid_buf, 50, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); + if(b && !bq) { + //Button Clicked + queue_open = 1; + } + } + //Fav Button + if(mx > 100 && mx < 100+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && svf_login) { + fillrect(vid_buf, 100, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); + if(b && !bq) { + //Button Clicked + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + info_box(vid_buf, "Adding to favourites..."); + execute_fav(vid_buf, save_id); + } + } + //Report Button + if(mx > 150 && mx < 150+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && svf_login && info_ready) { + fillrect(vid_buf, 150, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); + if(b && !bq) { + //Button Clicked + if(confirm_ui(vid_buf, "Are you sure?", "Are you sure you wish to report this save?", "Report")){ + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + info_box(vid_buf, "Reporting..."); + if(execute_report(vid_buf, save_id)){ + info_ui(vid_buf, "Success", "This save has been reported"); + retval = 0; + break; + } + } + } + } + //Delete Button + if(mx > 200 && mx < 200+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && (authoritah || myown)) { + fillrect(vid_buf, 200, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); + if(b && !bq) { + //Button Clicked + if(myown || !info->publish){ + if(confirm_ui(vid_buf, "Are you sure you wish to delete this?", "You will not be able recover it.", "Delete")){ + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + info_box(vid_buf, "Deleting..."); + if(execute_delete(vid_buf, save_id)){ + retval = 0; + break; + } + } + } else { + if(confirm_ui(vid_buf, "Are you sure?", "This save will be removed from the search index.", "Remove")){ + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + info_box(vid_buf, "Removing..."); + if(execute_delete(vid_buf, save_id)){ + retval = 0; + break; + } + } + } + } + } + //Open in browser button + if(mx > 250 && mx < 250+107 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50) { + fillrect(vid_buf, 250, YRES+MENUSIZE-68, 107, 18, 255, 255, 255, 40); + if(b && !bq) { + //Button Clicked + //TODO: Open link + o_uri = malloc(7+strlen(SERVER)+41+strlen(save_id)*3); + strcpy(o_uri, "http://" SERVER "/Browse/View.html?ID="); + strcaturl(o_uri, save_id); + open_link(o_uri); + free(o_uri); + } + } + //Submit Button + if(mx > XRES+BARSIZE-100 && mx < XRES+BARSIZE-100+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && svf_login && info_ready) { + fillrect(vid_buf, XRES+BARSIZE-100, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); + if(b && !bq) { + //Button Clicked + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + info_box(vid_buf, "Submitting Comment..."); + execute_submit(vid_buf, save_id, ed.str); + } + } + + sdl_blit(0, 0, (XRES+BARSIZE), YRES+MENUSIZE, vid_buf, (XRES+BARSIZE)); + memcpy(vid_buf, old_vid, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); + if(info_ready && svf_login){ + ui_edit_process(mx, my, b, &ed); + } + + if(sdl_key==SDLK_ESCAPE) + break; + + if(lasttimetitle = mystrdup(info_data+6); + j++; + } + else if(!strncmp(info_data, "NAME ", 5)) + { + info->name = mystrdup(info_data+5); + j++; + } + else if(!strncmp(info_data, "AUTHOR ", 7)) + { + info->author = mystrdup(info_data+7); + j++; + } + else if(!strncmp(info_data, "DATE ", 5)) + { + info->date = mystrdup(info_data+5); + j++; + } + else if(!strncmp(info_data, "DESCRIPTION ", 12)) + { + info->description = mystrdup(info_data+12); + j++; + } + else if(!strncmp(info_data, "VOTEUP ", 7)) + { + info->voteup = atoi(info_data+7); + j++; + } + else if(!strncmp(info_data, "VOTEDOWN ", 9)) + { + info->votedown = atoi(info_data+9); + j++; + } + else if(!strncmp(info_data, "VOTE ", 5)) + { + info->vote = atoi(info_data+5); + j++; + } + else if(!strncmp(info_data, "MYVOTE ", 7)) + { + info->myvote = atoi(info_data+7); + j++; + } + else if(!strncmp(info_data, "MYFAV ", 6)) + { + info->myfav = atoi(info_data+6); + j++; + } + else if(!strncmp(info_data, "PUBLISH ", 8)) + { + info->publish = atoi(info_data+8); + j++; + } + else if(!strncmp(info_data, "TAGS ", 5)) + { + info->tags = mystrdup(info_data+5); + j++; + } + else if(!strncmp(info_data, "COMMENT ", 8)) + { + if(info->comment_count>=6) { + info_data = p; + continue; + } else { + q = strchr(info_data+8, ' '); + *(q++) = 0; + info->commentauthors[info->comment_count] = mystrdup(info_data+8); + info->comments[info->comment_count] = mystrdup(q); + info->comment_count++; + } + j++; + } + info_data = p; + } + if(j>=8) { + return 1; + } else { + return -1; + } +} + int search_results(char *str, int votes) { int i,j; @@ -2890,7 +3386,7 @@ void execute_save(pixel *vid_buf) free(result); } -void execute_delete(pixel *vid_buf, char *id) +int execute_delete(pixel *vid_buf, char *id) { int status; char *result; @@ -2906,6 +3402,111 @@ void execute_delete(pixel *vid_buf, char *id) svf_user, svf_pass, &status, NULL); + if(status!=200) + { + error_ui(vid_buf, status, http_ret_text(status)); + if(result) + free(result); + return 0; + } + if(result && strncmp(result, "OK", 2)) + { + error_ui(vid_buf, 0, result); + free(result); + return 0; + } + + if(result) + free(result); + return 1; +} + +void execute_submit(pixel *vid_buf, char *id, char *message) +{ + int status; + char *result; + + char *names[] = {"ID", "Message", NULL}; + char *parts[2]; + + parts[0] = id; + parts[1] = message; + + result = http_multipart_post( + "http://" SERVER "/Comment.api", + names, parts, NULL, + svf_user, svf_pass, + &status, NULL); + + if(status!=200) + { + error_ui(vid_buf, status, http_ret_text(status)); + if(result) + free(result); + return; + } + if(result && strncmp(result, "OK", 2)) + { + error_ui(vid_buf, 0, result); + free(result); + return; + } + + if(result) + free(result); +} + +int execute_report(pixel *vid_buf, char *id) +{ + int status; + char *result; + + char *names[] = {"ID", NULL}; + char *parts[1]; + + parts[0] = id; + + result = http_multipart_post( + "http://" SERVER "/Report.api", + names, parts, NULL, + svf_user, svf_pass, + &status, NULL); + + if(status!=200) + { + error_ui(vid_buf, status, http_ret_text(status)); + if(result) + free(result); + return 0; + } + if(result && strncmp(result, "OK", 2)) + { + error_ui(vid_buf, 0, result); + free(result); + return 0; + } + + if(result) + free(result); + return 1; +} + +void execute_fav(pixel *vid_buf, char *id) +{ + int status; + char *result; + + char *names[] = {"ID", NULL}; + char *parts[1]; + + parts[0] = id; + + result = http_multipart_post( + "http://" SERVER "/Favourite.api", + names, parts, NULL, + svf_user, svf_pass, + &status, NULL); + if(status!=200) { error_ui(vid_buf, status, http_ret_text(status)); @@ -2959,3 +3560,16 @@ int execute_vote(pixel *vid_buf, char *id, char *action) free(result); return 1; } +void open_link(char *uri){ +#ifdef WIN32 + ShellExecute(0, "OPEN", uri, NULL, NULL, 0) +#elif MACOSX + //LSOpenCFURLRef(CFURLCreateWithString(NULL, CFStringCreateWithCString(NULL, uri, 0) ,NULL), NULL); //TODO: Get this crap working +#elif LIN32 + execvp("xdg-open", uri); +#elif LIN64 + execvp("xdg-open", uri); +#else + printf("Cannot open browser\n"); +#endif +} diff --git a/src/main.c b/src/main.c old mode 100755 new mode 100644 index d88b9726b..5ef9ce304 --- a/src/main.c +++ b/src/main.c @@ -270,8 +270,11 @@ void *build_save(int *size, int x0, int y0, int w, int h) { x = (int)(parts[i].x+0.5f); y = (int)(parts[i].y+0.5f); - if(x>=x0 && x=y0 && y=x0 && x=y0 && y= size) goto corrupt; j=d[p++]; - if(j >= PT_NUM) - goto corrupt; + if(j >= PT_NUM) { + //TODO: Possibly some server side translation + j = PT_DUST;//goto corrupt; + } if(j)// && !(isplayer == 1 && j==PT_STKM)) { if(pmap[y][x]) { k = pmap[y][x]>>8; parts[k].type = j; + if(j == PT_PHOT) + parts[k].ctype = 0x3fffffff; parts[k].x = (float)x; parts[k].y = (float)y; m[(x-x0)+(y-y0)*w] = k+1; @@ -519,6 +526,8 @@ int parse_save(void *save, int size, int replace, int x0, int y0) else if(i < nf) { parts[fp[i]].type = j; + if(j == PT_PHOT) + parts[fp[i]].ctype = 0x3fffffff; parts[fp[i]].x = (float)x; parts[fp[i]].y = (float)y; m[(x-x0)+(y-y0)*w] = fp[i]+1; @@ -629,7 +638,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0) { i = m[j]; ty = d[pty+j]; - if(i && (ty==PT_CLNE || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34))) + if(i && (ty==PT_CLNE || (ty==PT_PCLN && ver>=43) || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34))) { if(p >= size) goto corrupt; diff --git a/src/powder.c b/src/powder.c index f578e2859..fc645a5e5 100644 --- a/src/powder.c +++ b/src/powder.c @@ -26,10 +26,10 @@ static int pn_junction_sprk(int x, int y, int pt) { unsigned r = pmap[y][x]; if((r & 0xFF) != pt) - return 0; + return 0; r >>= 8; if(parts[r].type != pt) - return 0; + return 0; parts[r].ctype = pt; parts[r].type = PT_SPRK; @@ -42,14 +42,19 @@ static void photoelectric_effect(int nx, int ny) unsigned r = pmap[ny][nx]; if((r&0xFF) == PT_PSCN) { - if((pmap[ny][nx-1] & 0xFF) == PT_NSCN || - (pmap[ny][nx+1] & 0xFF) == PT_NSCN || - (pmap[ny-1][nx] & 0xFF) == PT_NSCN || - (pmap[ny+1][nx] & 0xFF) == PT_NSCN) - pn_junction_sprk(nx, ny, PT_PSCN); + if((pmap[ny][nx-1] & 0xFF) == PT_NSCN || + (pmap[ny][nx+1] & 0xFF) == PT_NSCN || + (pmap[ny-1][nx] & 0xFF) == PT_NSCN || + (pmap[ny+1][nx] & 0xFF) == PT_NSCN) + pn_junction_sprk(nx, ny, PT_PSCN); } } - +/* + RETURN-value explenation +1 = Swap +0 = No move/Bounce +2 = Both particles occupy the same space. + */ static int eval_move(int pt, int nx, int ny, unsigned *rr) { unsigned r; @@ -64,15 +69,13 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr) *rr = r; if((r&0xFF)==PT_VOID || (r&0xFF)==PT_BHOL) - return 1; - - if(pt==PT_NEUT && (r&0xFF)==PT_GLAS) - return 2; + return 1; if(pt==PT_PHOT&&( (r&0xFF)==PT_GLAS || (r&0xFF)==PT_PHOT || (r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN || - (r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || + (r&0xFF)==PT_GLOW || (r&0xFF)==PT_WATR || + (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || ((r&0xFF)==PT_LCRY&&parts[r>>8].life > 5))) return 2; @@ -92,15 +95,25 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr) if(ptypes[pt].falldown!=1 && bmap[ny/CELL][nx/CELL]==10) return 0; - if (r && ((r&0xFF) >= PT_NUM || !can_move[pt][(r&0xFF)])) + if(ptypes[pt].properties&TYPE_ENERGY && (r && ((r&0xFF) >= PT_NUM || (ptypes[(r&0xFF)].properties&TYPE_ENERGY)))) + return 2; + + if(pt==PT_NEUT && (r && ((r&0xFF) >= PT_NUM || (ptypes[(r&0xFF)].properties&PROP_NEUTPENETRATE)))) + return 1; + if((r&0xFF)==PT_NEUT && ptypes[pt].properties&PROP_NEUTPENETRATE) + return 0; + + if (r && ((r&0xFF) >= PT_NUM || (ptypes[pt].weight <= ptypes[(r&0xFF)].weight))) return 0; - if(pt == PT_PHOT) + if(pt == PT_PHOT) return 2; + return 1; } static void create_cherenkov_photon(int pp); +static void create_gain_photon(int pp); int try_move(int i, int x, int y, int nx, int ny) { @@ -110,21 +123,39 @@ int try_move(int i, int x, int y, int nx, int ny) return 1; e = eval_move(parts[i].type, nx, ny, &r); - if(!e) { - if(!legacy_enable && parts[i].type==PT_PHOT) { + + /* half-silvered mirror */ + if(!e && parts[i].type==PT_PHOT && + (((r&0xFF)==PT_BMTL && rand()>8].temp = parts[i].temp; + if((r & 0xFF) < PT_NUM) - parts[i].temp = parts[r>>8].temp = - restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP); + parts[i].temp = parts[r>>8].temp = restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP); } return 0; } - if(e == 2) { - if(parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) { - if(rand() < RAND_MAX/10) - create_cherenkov_photon(i); - } + + if(e == 2) + { + if(parts[i].type == PT_PHOT && (r&0xFF)==PT_GLOW && !parts[r>>8].life) + if(rand() < RAND_MAX/30) + { + parts[r>>8].life = 120; + create_gain_photon(i); + } + + if(parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) { + if(rand() < RAND_MAX/10) + create_cherenkov_photon(i); + } return 1; } @@ -154,29 +185,24 @@ int try_move(int i, int x, int y, int nx, int ny) if(r && (r>>8)> 8; + if(r && e>8)>= 8; - parts[r].x += x-nx; - parts[r].y += y-ny; - } - return 1; } -#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 static unsigned direction_to_map(float dx, float dy) { @@ -306,7 +332,7 @@ int get_normal_interp(int pt, float x0, float y0, float dx, float dy, float *nx, return 0; if(pt == PT_PHOT) - photoelectric_effect(x, y); + photoelectric_effect(x, y); return get_normal(pt, x, y, dx, dy, nx, ny); } @@ -314,19 +340,21 @@ int get_normal_interp(int pt, float x0, float y0, float dx, float dy, float *nx, void kill_part(int i) { int x, y; + + if(parts[i].type != PT_PHOT) { + x = (int)(parts[i].x+0.5f); + y = (int)(parts[i].y+0.5f); + + if(x>=0 && y>=0 && x=0 && y>=0 && x>8].type = PT_SPRK; @@ -476,11 +505,15 @@ inline int create_part(int p, int x, int y, int t) parts[i].vx = r*cosf(a); parts[i].vy = r*sinf(a); } + if(t==PT_MORT) + { + parts[i].vx = 2; + } if(t==PT_PHOT) { - float a = (rand()%8) * 0.78540f; + float a = (rand()%8) * 0.78540f; parts[i].life = 680; - parts[i].ctype = 0x3FFFFFFF; + parts[i].ctype = 0x3FFFFFFF; parts[i].vx = 3.0f*cosf(a); parts[i].vy = 3.0f*sinf(a); } @@ -529,6 +562,51 @@ inline int create_part(int p, int x, int y, int t) return i; } +static void create_gain_photon(int pp) +{ + float xx, yy; + int i, lr, temp_bin, nx, ny; + + if(pfree == -1) + return; + i = pfree; + + lr = rand() % 2; + + if(lr) { + xx = parts[pp].x - 0.3*parts[pp].vy; + yy = parts[pp].y + 0.3*parts[pp].vx; + } else { + xx = parts[pp].x + 0.3*parts[pp].vy; + yy = parts[pp].y - 0.3*parts[pp].vx; + } + + nx = (int)(xx + 0.5f); + ny = (int)(yy + 0.5f); + + if(nx<0 || ny<0 || nx>=XRES || ny>=YRES) + return; + + if((pmap[ny][nx] & 0xFF) != PT_GLOW) + return; + + pfree = parts[i].life; + + parts[i].type = PT_PHOT; + parts[i].life = 680; + parts[i].x = xx; + parts[i].y = yy; + parts[i].vx = parts[pp].vx; + parts[i].vy = parts[pp].vy; + parts[i].temp = parts[pmap[ny][nx] >> 8].temp; + parts[i].tmp = 0; + + temp_bin = (int)((parts[i].temp-273.0f)*0.25f); + if(temp_bin < 0) temp_bin = 0; + if(temp_bin > 25) temp_bin = 25; + parts[i].ctype = 0x1F << temp_bin; +} + static void create_cherenkov_photon(int pp) { int i, lr, nx, ny; @@ -541,10 +619,10 @@ static void create_cherenkov_photon(int pp) nx = (int)(parts[pp].x + 0.5f); ny = (int)(parts[pp].y + 0.5f); if((pmap[ny][nx] & 0xFF) != PT_GLAS) - return; + return; if(hypotf(parts[pp].vx, parts[pp].vy) < 1.44f) - return; + return; pfree = parts[i].life; @@ -559,11 +637,11 @@ static void create_cherenkov_photon(int pp) parts[i].tmp = 0; if(lr) { - parts[i].vx = parts[pp].vx - 2.5f*parts[pp].vy; - parts[i].vy = parts[pp].vy + 2.5f*parts[pp].vx; + parts[i].vx = parts[pp].vx - 2.5f*parts[pp].vy; + parts[i].vy = parts[pp].vy + 2.5f*parts[pp].vx; } else { - parts[i].vx = parts[pp].vx + 2.5f*parts[pp].vy; - parts[i].vy = parts[pp].vy - 2.5f*parts[pp].vx; + parts[i].vx = parts[pp].vx + 2.5f*parts[pp].vy; + parts[i].vy = parts[pp].vy - 2.5f*parts[pp].vx; } /* photons have speed of light. no discussion. */ @@ -572,7 +650,7 @@ static void create_cherenkov_photon(int pp) parts[i].vy *= r; } -#if defined(WIN32) && !defined(__MINGW32__) +#ifdef WIN32 _inline void delete_part(int x, int y) #else inline void delete_part(int x, int y) @@ -590,7 +668,7 @@ inline void delete_part(int x, int y) pmap[y][x] = 0; // just in case } -#if defined(WIN32) && !defined(__MINGW32__) +#ifdef WIN32 _inline int is_wire(int x, int y) #else inline int is_wire(int x, int y) @@ -599,7 +677,7 @@ inline int is_wire(int x, int y) return bmap[y][x]==6 || bmap[y][x]==7 || bmap[y][x]==3 || bmap[y][x]==8 || bmap[y][x]==11 || bmap[y][x]==12; } -#if defined(WIN32) && !defined(__MINGW32__) +#ifdef WIN32 _inline int is_wire_off(int x, int y) #else inline int is_wire_off(int x, int y) @@ -613,18 +691,18 @@ int get_wavelength_bin(int *wm) int i, w0=30, wM=0; if(!*wm) - return -1; + return -1; for(i=0; i<30; i++) - if(*wm & (1< wM) - wM = i; - } + if(*wm & (1< wM) + wM = i; + } if(wM-w0 < 5) - return (wM+w0)/2; + return (wM+w0)/2; i = rand() % (wM-w0-3); i += w0; @@ -690,7 +768,7 @@ void set_emap(int x, int y) } } -#if defined(WIN32) && !defined(__MINGW32__) +#ifdef WIN32 _inline int parts_avg(int ci, int ni) #else inline int parts_avg(int ci, int ni) @@ -734,9 +812,6 @@ int nearest_part(int ci, int t) void update_particles_i(pixel *vid, int start, int inc) { int i, j, x, y, t, nx, ny, r, a, s, lt, rt, fe, nt, lpv, nearp, pavg; - uint16_t tempu1, tempu2; - int16_t temps1, temps2; - float tempf1, tempf2; float mv, dx, dy, ix, iy, lx, ly, d, pp, nrx, nry, dp; float nn, ct1, ct2; float pt = R_TEMP; @@ -759,7 +834,7 @@ void update_particles_i(pixel *vid, int start, int inc) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--; - if(parts[i].life<=0 && t!=PT_METL && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR) + if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW) { kill_part(i); continue; @@ -767,7 +842,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(parts[i].life<=0 && t==PT_SPRK) { t = parts[i].ctype; - if(t!=PT_METL&&t!=PT_BMTL&&t!=PT_BRMT&&t!=PT_LRBD&&t!=PT_RBDM&&t!=PT_BTRY&&t!=PT_NBLE) + if(t!=PT_METL&&t!=PT_IRON&&t!=PT_BMTL&&t!=PT_BRMT&&t!=PT_LRBD&&t!=PT_RBDM&&t!=PT_BTRY&&t!=PT_NBLE) parts[i].temp = R_TEMP + 273.15f; if(!t) t = PT_METL; @@ -869,7 +944,7 @@ void update_particles_i(pixel *vid, int start, int inc) } // interpolator -#if defined(WIN32) && !defined(__MINGW32__) +#ifdef WIN32 mv = max(fabsf(parts[i].vx), fabsf(parts[i].vy)); #else mv = fmaxf(fabsf(parts[i].vx), fabsf(parts[i].vy)); @@ -943,6 +1018,8 @@ void update_particles_i(pixel *vid, int start, int inc) t = parts[i].type = PT_OIL; if(t==PT_BMTL && pv[y/CELL][x/CELL]>2.5f) t = parts[i].type = PT_BRMT; + if(t==PT_BMTL && pv[y/CELL][x/CELL]>1.0f && parts[i].tmp==1) + t = parts[i].type = PT_BRMT; if(t==PT_BRCK && pv[y/CELL][x/CELL]>2.8f) t = parts[i].type = PT_STNE; //if(t==PT_GLAS && pv[y/CELL][x/CELL]>4.0f) @@ -1118,7 +1195,7 @@ void update_particles_i(pixel *vid, int start, int inc) pt = parts[i].temp -= 2.5f; } - if(t==PT_WATR || t==PT_ETRD || t==PT_SLTW || t==PT_METL || t==PT_RBDM || t==PT_LRBD || t==PT_BRMT || t==PT_PSCN || t==PT_NSCN || t==PT_NTCT || t==PT_PTCT || t==PT_BMTL || t==PT_SPRK|| t == PT_NBLE || t==PT_INWR) + if(t==PT_WATR || t==PT_ETRD || t==PT_SLTW || t==PT_METL || t==PT_IRON || t==PT_RBDM || t==PT_LRBD || t==PT_BRMT || t==PT_PSCN || t==PT_NSCN || t==PT_NTCT || t==PT_PTCT || t==PT_BMTL || t==PT_SPRK|| t == PT_NBLE || t==PT_INWR) { nx = x % CELL; if(nx == 0) @@ -1136,7 +1213,7 @@ void update_particles_i(pixel *vid, int start, int inc) ny = y/CELL; if(nx>=0 && ny>=0 && nx>8)>=NPART || !r) continue; - if(((r&0xFF)==PT_METL || (r&0xFF)==PT_ETRD || (r&0xFF)==PT_PSCN || (r&0xFF)==PT_NSCN || (r&0xFF)==PT_NTCT || (r&0xFF)==PT_PTCT || (r&0xFF)==PT_BMTL || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD || (r&0xFF)==PT_BRMT||(r&0xFF)==PT_NBLE) || (r&0xFF)==PT_INWR && parts[r>>8].ctype!=PT_SPRK) - + if(((r&0xFF)==PT_METL || (r&0xFF)==PT_IRON || (r&0xFF)==PT_ETRD || (r&0xFF)==PT_PSCN || (r&0xFF)==PT_NSCN || (r&0xFF)==PT_NTCT || (r&0xFF)==PT_PTCT || (r&0xFF)==PT_BMTL || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD || (r&0xFF)==PT_BRMT || (r&0xFF)==PT_NBLE || (r&0xFF)==PT_INWR) && parts[r>>8].ctype!=PT_SPRK) { t = parts[i].type = PT_NONE; parts[r>>8].ctype = parts[r>>8].type; @@ -1217,6 +1293,67 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_BMTL) { + if(parts[i].tmp>1) { + parts[i].tmp--; + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + rt =parts[r>>8].type; + if((rt==PT_METL || rt==PT_IRON) && 1>(rand()/(RAND_MAX/100))) + { + parts[r>>8].type=PT_BMTL; + parts[r>>8].tmp=(parts[i].tmp<=7)?parts[i].tmp=1:parts[i].tmp-(rand()%5);//rand()/(RAND_MAX/300)+100; + } + } + } else if(parts[i].tmp==1 && 1>rand()%1000) { + parts[i].tmp = 0; + t = parts[i].type = PT_BRMT; + } + } + + else if(t==PT_IRON) { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + if((((r&0xFF) == PT_SALT && 15>(rand()/(RAND_MAX/700))) || + ((r&0xFF) == PT_SLTW && 30>(rand()/(RAND_MAX/2000))) || + ((r&0xFF) == PT_WATR && 5 >(rand()/(RAND_MAX/6000))) || + ((r&0xFF) == PT_O2 && 2 >(rand()/(RAND_MAX/500))) || + ((r&0xFF) == PT_LO2))&& + (!(parts[i].life)) + ) + { + parts[i].type=PT_BMTL; + parts[i].tmp=(rand()/(RAND_MAX/10))+20; + } + } + } + else if((t==PT_SPRK||parts[i].type==PT_SPRK) && parts[i].ctype==PT_IRON) { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + if(((r&0xFF) == PT_DSTW && 30>(rand()/(RAND_MAX/1000))) || + ((r&0xFF) == PT_SLTW && 30>(rand()/(RAND_MAX/1000))) || + ((r&0xFF) == PT_WATR && 30>(rand()/(RAND_MAX/1000)))) + { + parts[r>>8].type=PT_O2; + //parts[r>>8].tmp=(rand()/(RAND_MAX/10))+20; + } + } + } else if(t==PT_COAL) { if(parts[i].life<=0) { @@ -1285,16 +1422,18 @@ void update_particles_i(pixel *vid, int start, int inc) else if(t==PT_FUSE) { if(parts[i].life<=0) { - t = PT_NONE; + //t = parts[i].life = PT_NONE; kill_part(i); r = create_part(-1, x, y, PT_PLSM); - parts[r].life = 50; - goto killed; + if(r!=-1) + parts[r].life = 50; + //goto killed; } else if (parts[i].life < 40) { parts[i].life--; if((rand()%100)==0) { r = create_part(-1, (nx=x+rand()%3-1), (ny=y+rand()%3-1), PT_PLSM); - parts[r].life = 50; + if(r!=-1) + parts[r].life = 50; } } if((pv[y/CELL][x/CELL] > 2.7f)&&parts[i].tmp>40) @@ -1302,10 +1441,10 @@ void update_particles_i(pixel *vid, int start, int inc) else if(parts[i].tmp<40&&parts[i].tmp>0) parts[i].tmp--; else if(parts[i].tmp<=0) { - t = PT_NONE; + //t = PT_NONE; kill_part(i); r = create_part(-1, x, y, PT_FSEP); - goto killed; + //goto killed; } for(nx=-2; nx<3; nx++) for(ny=-2; ny<3; ny++) @@ -1326,16 +1465,18 @@ void update_particles_i(pixel *vid, int start, int inc) else if(t==PT_FSEP) { if(parts[i].life<=0) { - t = PT_NONE; + //t = PT_NONE; kill_part(i); r = create_part(-1, x, y, PT_PLSM); - parts[r].life = 50; - goto killed; + if(r!=-1) + parts[r].life = 50; + //goto killed; } else if (parts[i].life < 40) { parts[i].life--; if((rand()%10)==0) { r = create_part(-1, (nx=x+rand()%3-1), (ny=y+rand()%3-1), PT_PLSM); - parts[r].life = 50; + if(r!=-1) + parts[r].life = 50; } } for(nx=-2; nx<3; nx++) @@ -1346,7 +1487,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if((r&0xFF)==PT_SPRK || (parts[i].temp>=(273.15+400.0f)) && 1>(rand()%15)) + if(((r&0xFF)==PT_SPRK || (parts[i].temp>=(273.15+400.0f))) && 1>(rand()%15)) { if(parts[i].life>40) { parts[i].life = 39; @@ -1548,7 +1689,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_FIRE; parts[r>>8].life = 4; } - else if(((r&0xFF)!=PT_CLNE && ptypes[parts[r>>8].type].hardness>(rand()%1000))&&parts[i].life>=50) + else if(((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && ptypes[parts[r>>8].type].hardness>(rand()%1000))&&parts[i].life>=50) { parts[i].life--; parts[r>>8].type = PT_NONE; @@ -1641,6 +1782,9 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_MORT) { + create_part(-1, x, y-1, PT_SMKE); + } else if(t==PT_LCRY) { for(nx=-1; nx<2; nx++) @@ -1807,7 +1951,7 @@ void update_particles_i(pixel *vid, int start, int inc) } } else if(parts[i].tmp==2) { - int col = rand()%200+4; + int col = rand()%200+4; for(nx=-2; nx<3; nx++) { for(ny=-2; ny<3; ny++) { if(x+nx>=0 && y+ny>0 && x+nx>8].type; if(parts_avg(i,r>>8) != PT_INSL) { - if((rt==PT_METL||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE)&&parts[r>>8].life==0 && abs(nx)+abs(ny) < 4) + if((rt==PT_METL||rt==PT_IRON||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE)&&parts[r>>8].life==0 && abs(nx)+abs(ny) < 4) { parts[r>>8].life = 4; parts[r>>8].ctype = rt; @@ -1901,7 +2045,8 @@ void update_particles_i(pixel *vid, int start, int inc) continue; rt = parts[r>>8].type; if((a || ptypes[rt].explosive) && ((rt!=PT_RBDM && rt!=PT_LRBD && rt!=PT_INSL && rt!=PT_SWCH) || t!=PT_SPRK) && - (t!=PT_LAVA || parts[i].life>0 || (rt!=PT_STNE && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_NTCT && rt!=PT_PTCT && rt!=PT_METL && rt!=PT_ETRD && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SWCH && rt!=PT_INWR)) && + !(t==PT_PHOT && rt==PT_INSL) && + (t!=PT_LAVA || parts[i].life>0 || (rt!=PT_STNE && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_NTCT && rt!=PT_PTCT && rt!=PT_METL && rt!=PT_IRON && rt!=PT_ETRD && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SWCH && rt!=PT_INWR)) && ptypes[rt].flammable && (ptypes[rt].flammable + (int)(pv[(y+ny)/CELL][(x+nx)/CELL]*10.0f))>(rand()%1000)) { parts[r>>8].type = PT_FIRE; @@ -1915,7 +2060,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(lpv < 1) lpv = 1; if(legacy_enable) { - if(t!=PT_SPRK && ptypes[rt].meltable && ((rt!=PT_RBDM && rt!=PT_LRBD) || t!=PT_SPRK) && ((t!=PT_FIRE&&t!=PT_PLSM) || (rt!=PT_METL && rt!=PT_ETRD && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_NTCT && rt!=PT_PTCT && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SALT && rt!=PT_INWR)) && + if(t!=PT_SPRK && ptypes[rt].meltable && ((rt!=PT_RBDM && rt!=PT_LRBD) || t!=PT_SPRK) && ((t!=PT_FIRE&&t!=PT_PLSM) || (rt!=PT_METL && rt!=PT_IRON && rt!=PT_ETRD && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_NTCT && rt!=PT_PTCT && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SALT && rt!=PT_INWR)) && ptypes[rt].meltable*lpv>(rand()%1000)) { if(t!=PT_LAVA || parts[i].life>0) @@ -1987,7 +2132,7 @@ void update_particles_i(pixel *vid, int start, int inc) pavg = parts_avg(i, r>>8); if(pavg != PT_INSL) { - if(t==PT_SPRK && (rt==PT_METL||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE) && parts[r>>8].life==0 && + if(t==PT_SPRK && (rt==PT_METL||rt==PT_IRON||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE) && parts[r>>8].life==0 && (parts[i].life<3 || ((r>>8)=373.0f)&&parts[i].ctype==PT_NTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN&&parts[i].temp<=373.0f)&&parts[i].ctype==PT_PTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN)&&parts[i].ctype==PT_INWR) && pavg != PT_INSL &&!(parts[i].ctype==PT_SWCH&&(rt==PT_PSCN||rt==PT_NSCN)) ) @@ -2480,8 +2625,10 @@ killed: (pmap[y+ny][x+nx]&0xFF)!=0xFF) parts[i].ctype = pmap[y+ny][x+nx]&0xFF; } - else + else { create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); + } + } if(parts[i].type==PT_PCLN) { @@ -2499,8 +2646,21 @@ killed: (pmap[y+ny][x+nx]&0xFF)!=PT_STKM && (pmap[y+ny][x+nx]&0xFF)!=0xFF) parts[i].ctype = pmap[y+ny][x+nx]&0xFF; - if(parts[i].ctype && parts[i].life==10) - create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); + if(parts[i].ctype && parts[i].life==10) { + if(parts[i].ctype==PT_PHOT) { + for(nx=-1; nx<2; nx++) { + for(ny=-1; ny<2; ny++) { + r = create_part(-1, x+nx, y+ny, parts[i].ctype); + if(r!=-1) { + parts[r].vx = nx*3; + parts[r].vy = ny*3; + } + } + } + } else { + create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); + } + } } if(t==PT_YEST) { @@ -2534,7 +2694,7 @@ killed: if(parts[i].type == PT_PHOT) { rt = pmap[ny][nx] & 0xFF; - if(rt==PT_CLNE) { + if(rt==PT_CLNE || rt==PT_PCLN) { lt = pmap[ny][nx] >> 8; if(!parts[lt].ctype) parts[lt].ctype = PT_PHOT; @@ -2542,7 +2702,7 @@ killed: lt = pmap[y][x] & 0xFF; - r = eval_move(PT_PHOT, nx, ny, NULL); + r = eval_move(PT_PHOT, nx, ny, NULL); if(((rt==PT_GLAS && lt!=PT_GLAS) || (rt!=PT_GLAS && lt==PT_GLAS)) && r) { if(!get_normal_interp(REFRACT|parts[i].type, x, y, parts[i].vx, parts[i].vy, &nrx, &nry)) { @@ -2550,13 +2710,13 @@ killed: continue; } - r = get_wavelength_bin(&parts[i].ctype); - if(r == -1) { - kill_part(i); - continue; - } - nn = GLASS_IOR - GLASS_DISP*(r-15)/15.0f; - nn *= nn; + r = get_wavelength_bin(&parts[i].ctype); + if(r == -1) { + kill_part(i); + continue; + } + nn = GLASS_IOR - GLASS_DISP*(r-15)/15.0f; + nn *= nn; nrx = -nrx; nry = -nry; @@ -2567,10 +2727,10 @@ killed: if(ct2 < 0.0f) { parts[i].vx -= 2.0f*ct1*nrx; parts[i].vy -= 2.0f*ct1*nry; - parts[i].x = lx; - parts[i].y = ly; - nx = (int)(lx + 0.5f); - ny = (int)(ly + 0.5f); + parts[i].x = lx; + parts[i].y = ly; + nx = (int)(lx + 0.5f); + ny = (int)(ly + 0.5f); } else { ct2 = sqrtf(ct2); ct2 = ct2 - nn*ct1; @@ -2700,24 +2860,25 @@ killed: } else if(t==PT_NEUT || t==PT_PHOT) { - r = pmap[ny][nx]; + r = pmap[ny][nx]; - /* this should be replaced with a particle type attribute ("photwl" or something) */ - if((r & 0xFF) == PT_PSCN) parts[i].ctype = 0x00000000; - if((r & 0xFF) == PT_NSCN) parts[i].ctype = 0x00000000; - if((r & 0xFF) == PT_COAL) parts[i].ctype = 0x00000000; - if((r & 0xFF) == PT_BCOL) parts[i].ctype = 0x00000000; - if((r & 0xFF) == PT_PLEX) parts[i].ctype &= 0x1F00003E; - if((r & 0xFF) == PT_NITR) parts[i].ctype &= 0x0007C000; - if((r & 0xFF) == PT_NBLE) parts[i].ctype &= 0x3FFF8000; - if((r & 0xFF) == PT_LAVA) parts[i].ctype &= 0x3FF00000; - if((r & 0xFF) == PT_ACID) parts[i].ctype &= 0x1FE001FE; - if((r & 0xFF) == PT_DUST) parts[i].ctype &= 0x3FFFFFC0; - if((r & 0xFF) == PT_SNOW) parts[i].ctype &= 0x03FFFFFF; - if((r & 0xFF) == PT_GOO) parts[i].ctype &= 0x3FFAAA00; - if((r & 0xFF) == PT_PLNT) parts[i].ctype &= 0x0007C000; - if((r & 0xFF) == PT_PLUT) parts[i].ctype &= 0x001FCE00; - if((r & 0xFF) == PT_URAN) parts[i].ctype &= 0x003FC000; + /* this should be replaced with a particle type attribute ("photwl" or something) */ + if((r & 0xFF) == PT_PSCN) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_NSCN) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_SPRK) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_COAL) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_BCOL) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_PLEX) parts[i].ctype &= 0x1F00003E; + if((r & 0xFF) == PT_NITR) parts[i].ctype &= 0x0007C000; + if((r & 0xFF) == PT_NBLE) parts[i].ctype &= 0x3FFF8000; + if((r & 0xFF) == PT_LAVA) parts[i].ctype &= 0x3FF00000; + if((r & 0xFF) == PT_ACID) parts[i].ctype &= 0x1FE001FE; + if((r & 0xFF) == PT_DUST) parts[i].ctype &= 0x3FFFFFC0; + if((r & 0xFF) == PT_SNOW) parts[i].ctype &= 0x03FFFFFF; + if((r & 0xFF) == PT_GOO) parts[i].ctype &= 0x3FFAAA00; + if((r & 0xFF) == PT_PLNT) parts[i].ctype &= 0x0007C000; + if((r & 0xFF) == PT_PLUT) parts[i].ctype &= 0x001FCE00; + if((r & 0xFF) == PT_URAN) parts[i].ctype &= 0x003FC000; if(get_normal_interp(t, lx, ly, parts[i].vx, parts[i].vy, &nrx, &nry)) { dp = nrx*parts[i].vx + nry*parts[i].vy; @@ -2737,10 +2898,10 @@ killed: continue; } - if(!parts[i].ctype) { - kill_part(i); - continue; - } + if(!parts[i].ctype) { + kill_part(i); + continue; + } } else @@ -2801,10 +2962,10 @@ void update_particles(pixel *vid) t = parts[i].type; x = (int)(parts[i].x+0.5f); y = (int)(parts[i].y+0.5f); - if(x>=0 && y>=0 && x=0 && y>=0 && x