This commit is contained in:
Philip
2010-10-04 00:27:40 -04:00
parent ebb784de70
commit e4f9f77de9
32 changed files with 1920 additions and 1232 deletions

View File

@@ -1,11 +1,11 @@
SOURCES := *.c SOURCES := src/*.c
CFLAGS := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L CFLAGS := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -Iincludes/
OFLAGS := -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations OFLAGS := -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations
LFLAGS := -lSDL -lm -lbz2 LFLAGS := -lSDL -lm -lbz2
MFLAGS_SSE3 := -march=k8 -DX86 -DX86_SSE3 -msse3 MFLAGS_SSE3 := -march=native -DX86 -DX86_SSE3 -msse3
MFLAGS_SSE2 := -march=k8 -DX86 -DX86_SSE2 -msse2 MFLAGS_SSE2 := -march=native-DX86 -DX86_SSE2 -msse2
MFLAGS_SSE := -march=pentium3 -DX86 -DX86_SSE MFLAGS_SSE := -march=native -DX86 -DX86_SSE
FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -O2 -march=k8 -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lbz2 FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -O2 -march=k8 -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lbz2
COMPILER := gcc COMPILER := gcc
LINUX_TARG := powder-64-sse2 powder-sse powder-sse2 LINUX_TARG := powder-64-sse2 powder-sse powder-sse2
@@ -19,6 +19,7 @@ powder-debug: $(SOURCES)
powder-sse3: $(SOURCES) powder-sse3: $(SOURCES)
$(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN32 $(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN32
strip $@ strip $@
mv $@ build
powder-sse2: $(SOURCES) powder-sse2: $(SOURCES)
$(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN32 $(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN32
strip $@ strip $@
@@ -31,6 +32,7 @@ powder-64-sse3-opengl: $(SOURCES)
powder-64-sse3: $(SOURCES) powder-64-sse3: $(SOURCES)
$(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64
strip $@ strip $@
mv $@ build
powder-64-sse2: $(SOURCES) powder-64-sse2: $(SOURCES)
$(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN64 $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN64
strip $@ strip $@

24
hmap.h

File diff suppressed because one or more lines are too long

View File

@@ -7,8 +7,8 @@
#define PATH_SEP "/" #define PATH_SEP "/"
#endif #endif
#define SAVE_VERSION 42 #define SAVE_VERSION 43
#define MINOR_VERSION 1 #define MINOR_VERSION 0
#define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter. #define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter.
#define BETA #define BETA
@@ -66,9 +66,6 @@ typedef unsigned char uint8;
extern int amd; extern int amd;
unsigned int PSR;
unsigned int SEC;
extern int FPSB; extern int FPSB;
extern int legacy_enable; extern int legacy_enable;

File diff suppressed because one or more lines are too long

34
includes/hmap.h Executable file

File diff suppressed because one or more lines are too long

View File

@@ -159,7 +159,7 @@ int save_name_ui(pixel *vid_buf);
void menu_ui(pixel *vid_buf, int i, int *sl, int *sr); void menu_ui(pixel *vid_buf, int i, int *sl, int *sr);
void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr,int *psr,int b, int bq, int mx, int my); void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, int my);
int sdl_poll(void); int sdl_poll(void);

View File

@@ -3,7 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef WIN32 #if defined(WIN32) && !defined(__GNUC__)
#define x86_cpuid(func,af,bf,cf,df) \ #define x86_cpuid(func,af,bf,cf,df) \
do {\ do {\
__asm mov eax, func\ __asm mov eax, func\
@@ -63,6 +63,8 @@ int load_string(FILE *f, char *str, int max);
void strcaturl(char *dst, char *src); void strcaturl(char *dst, char *src);
void strappend(char *dst, char *src);
void *file_load(char *fn, int *size); void *file_load(char *fn, int *size);
int cpu_check(void); int cpu_check(void);

View File

@@ -49,7 +49,7 @@
#define PT_NITR 8 #define PT_NITR 8
#define PT_CLNE 9 #define PT_CLNE 9
#define PT_GAS 10 #define PT_GAS 10
#define PT_C4 11 #define PT_PLEX 11
#define PT_GOO 12 #define PT_GOO 12
#define PT_ICEI 13 #define PT_ICEI 13
#define PT_METL 14 #define PT_METL 14
@@ -106,10 +106,15 @@
#define PT_THRM 65 #define PT_THRM 65
#define PT_GLOW 66 #define PT_GLOW 66
#define PT_BRCK 67 #define PT_BRCK 67
#define PT_FWRK 68 #define PT_HFLM 68
#define PT_PWPO 69 #define PT_FIRW 69
#define PT_PWNE 70 #define PT_FUSE 70
#define PT_NUM 71 #define PT_FSEP 71
#define PT_AMTR 72
#define PT_BCOL 73
#define PT_PCLN 74
#define PT_HSWC 75
#define PT_NUM 76
#define R_TEMP 22 #define R_TEMP 22
#define MAX_TEMP 9999 #define MAX_TEMP 9999
@@ -140,7 +145,7 @@ struct particle
float temp; float temp;
float pavg[2]; float pavg[2];
int flags; int flags;
int tmp; int tmp;
}; };
typedef struct particle particle; typedef struct particle particle;
@@ -190,7 +195,7 @@ static const part_type ptypes[PT_NUM] =
{"", 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."}, {"", 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."}, {"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."}, {"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. Solidifies under pressure"}, {"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."}, {"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."}, {"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."}, {"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."},
@@ -200,10 +205,10 @@ static const part_type ptypes[PT_NUM] =
{"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."}, {"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."}, {"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."}, {"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, 1, 0, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+-50.0f+273.15f, 46, "Solid. Freezes water. Crushes under pressure. Cools down air."}, {"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."}, {"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."}, {"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."}, {"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"}, {"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."}, {"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."}, {"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."},
@@ -224,41 +229,46 @@ static const part_type ptypes[PT_NUM] =
{"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."}, {"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."}, {"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."}, {"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."}, {"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."}, {"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."}, {"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."}, {"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"}, {"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."}, {"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)"}, {"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."}, {"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"}, {"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)"}, {"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."}, {"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, 251, "Lightning! Very hot, inflicts damage upon most materials, transfers current to metals."}, {"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, 115, "Plasma, extremely hot."}, {"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)"}, {"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."}, {"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"}, {"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."}, {"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)"}, {"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!"}, {"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)"}, {"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+400.0f+273.15f, 88, "Smoke"}, {"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"}, {"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, 10, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly."}, {"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"}, {"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."}, {"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."}, {"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)."}, {"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."}, {"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_POWDERS, R_TEMP+0.0f +273.15f, 211, "Thermite."}, {"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."}, {"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."}, {"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."},
{"FWRK", PIXPACK(0x666666), 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_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "Fireworks!! Glows in fancy"}, {"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."},
{"PWPO", PIXPACK(0x555080), 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, "Pressure sensitive wire, turns on when high pressure"}, {"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!"},
{"PWNE", PIXPACK(0x585080), 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, "Pressure sensitive wire, turns on when low pressure"}, {"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."},
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description {"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
}; };
static part_state pstates[PT_NUM] = static part_state pstates[PT_NUM] =
@@ -287,11 +297,11 @@ static part_state pstates[PT_NUM] =
/* PLNT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 573.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}, /* 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}, /* VOID */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* WTRV */ {ST_GAS, PT_NONE, 0.0f, PT_DSTW, 371.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},
/* CNCT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1123.0f, PT_NONE, 0.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}, /* 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}, /* SALT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1173.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SLTW */ {ST_LIQUID, PT_ICEI, 233.0f, PT_NONE, 0.0f, PT_WTRV, 383.0f, PT_NONE, 0.0f}, /* SLTW */ {ST_LIQUID, PT_ICEI, 233.0f, PT_NONE, 0.0f, PT_WTRV, 483.0f, PT_NONE, 0.0f},
/* DMND */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* 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}, /* 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}, /* BRMT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
@@ -321,106 +331,117 @@ static part_state pstates[PT_NUM] =
/* LCRY */ {ST_SOLID, PT_NONE, 0.0f, PT_BGLA, 1273.0f, PT_NONE, 0.0f, PT_NONE, 0.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}, /* 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}, /* 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_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}, /* 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}, /* 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}, /* 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}, /* 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}, /* 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, 353.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}, /* 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}, /* 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}, /* 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}, /* BRCK */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1223.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* FWRK */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.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},
/* PWPO */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.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},
/* PWNE */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.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] = static unsigned char can_move[PT_NUM][PT_NUM] =
{ {
/* A B */ /* Water | Oil */
/* A 0 1 | B ligher than A */ /* Water 0 | 1 | Water displaces oil */
/* B 1 0 | A heavier than B */ /* Oil 0 | 0 | Oil doesn't displace water */
/* N D W O F M L G N C G C G I W 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 F P P*/ /* 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 e a u i l a 4 o c i 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 W W W*/ /* 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 t v n t n s o e r 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 2 W S S R O C R P N*/ /* 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 l a p r e s i e k w d t t t d d v t w t w d l t t n x n n u l l m d N d s n a r m d e E y y M H E l l R T T M W K K O E*/ /* 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}, /* None */ /* 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,0,0,0}, /* Dust */ /* 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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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}, /* FUSE */
/* N D W O F M L G N C G C G I W 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 F P P*/ /* FSEP */ {0,1,1,1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,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,1,1,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,0,0}, /* FSEP */
/* o u a i i e a u i l a 4 o c i 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 W W W*/ /* 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 */
/* n s t l r t v n t n s o e r 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 2 W S S R O C R P N*/ /* 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 */
/* e t r l e l a p r e s i e k w d t t t d d v t w t w d l t t n x n n u l l m d N d s n a r m d e E y y M H E l l R T T M W K K O E*/ /* 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 */
}; };
extern int isplayer; extern int isplayer;

11
script.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
git pull
make powder-64-sse3
make powder-64-sse2
make powder-sse3
make powder-debug
make powder-sse2
make powder
make powder-sse
tar czf PowderToyGit.tar.gz ./

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -1,7 +1,7 @@
#include <math.h> #include <math.h>
#include "air.h" #include <air.h>
#include "powder.h" #include <powder.h>
#include "defines.h" #include <defines.h>
float kernel[9]; float kernel[9];
float vx[YRES/CELL][XRES/CELL], ovx[YRES/CELL][XRES/CELL]; float vx[YRES/CELL][XRES/CELL], ovx[YRES/CELL][XRES/CELL];
@@ -54,15 +54,15 @@ void update_air(void)
vy[y][x] *= VLOSS; vy[y][x] *= VLOSS;
vx[y][x] += dx*TSTEPV; vx[y][x] += dx*TSTEPV;
vy[y][x] += dy*TSTEPV; vy[y][x] += dy*TSTEPV;
if(bmap[y][x]==11 || bmap[y][x+1]==11 || if(bmap[y][x]==1 || bmap[y][x+1]==1 ||
bmap[y][x]==2 || bmap[y][x+1]==2 || bmap[y][x]==8 || bmap[y][x+1]==8 ||
(bmap[y][x]==3 && !emap[y][x]) || (bmap[y][x]==7 && !emap[y][x]) ||
(bmap[y][x+1]==3 && !emap[y][x+1])) (bmap[y][x+1]==7 && !emap[y][x+1]))
vx[y][x] = 0; vx[y][x] = 0;
if(bmap[y][x]==11 || bmap[y+1][x]==11 || if(bmap[y][x]==1 || bmap[y+1][x]==1 ||
bmap[y][x]==2 || bmap[y+1][x]==2 || bmap[y][x]==8 || bmap[y+1][x]==8 ||
(bmap[y][x]==3 && !emap[y][x]) || (bmap[y][x]==7 && !emap[y][x]) ||
(bmap[y+1][x]==3 && !emap[y+1][x])) (bmap[y+1][x]==7 && !emap[y+1][x]))
vy[y][x] = 0; vy[y][x] = 0;
} }
@@ -76,9 +76,9 @@ void update_air(void)
for(i=-1; i<2; i++) for(i=-1; i<2; i++)
if(y+j>0 && y+j<YRES/CELL-1 && if(y+j>0 && y+j<YRES/CELL-1 &&
x+i>0 && x+i<XRES/CELL-1 && x+i>0 && x+i<XRES/CELL-1 &&
bmap[y+j][x+i]!=11 && bmap[y+j][x+i]!=1 &&
bmap[y+j][x+i]!=2 && bmap[y+j][x+i]!=8 &&
(bmap[y+j][x+i]!=8 || emap[y+j][x+i])) (bmap[y+j][x+i]!=7 || emap[y+j][x+i]))
{ {
f = kernel[i+1+(j+1)*3]; f = kernel[i+1+(j+1)*3];
dx += vx[y+j][x+i]*f; dx += vx[y+j][x+i]*f;
@@ -118,7 +118,7 @@ void update_air(void)
dy += VADV*tx*ty*vy[j+1][i+1]; dy += VADV*tx*ty*vy[j+1][i+1];
} }
if(bmap[y][x] == 7) if(bmap[y][x] == 4)
{ {
dx += fvx[y][x]; dx += fvx[y][x];
dy += fvy[y][x]; dy += fvy[y][x];
@@ -138,4 +138,4 @@ void update_air(void)
memcpy(vx, ovx, sizeof(vx)); memcpy(vx, ovx, sizeof(vx));
memcpy(vy, ovy, sizeof(vy)); memcpy(vy, ovy, sizeof(vy));
memcpy(pv, opv, sizeof(pv)); memcpy(pv, opv, sizeof(pv));
} }

View File

@@ -12,12 +12,13 @@
#endif #endif
#endif #endif
#include "defines.h" #include <defines.h>
#include "air.h" #include <air.h>
#include "powder.h" #include <powder.h>
#include "graphics.h" #include <graphics.h>
#include "font.h" #define INCLUDE_FONTDATA
#include "misc.h" #include <font.h>
#include <misc.h>
unsigned cmode = 3; unsigned cmode = 3;
@@ -117,7 +118,7 @@ void sdl_blit_2(int x, int y, int w, int h, pixel *src, int pitch)
void sdl_blit(int x, int y, int w, int h, pixel *src, int pitch) void sdl_blit(int x, int y, int w, int h, pixel *src, int pitch)
{ {
#ifdef OpenGL #ifdef OpenGL
RenderScene(); RenderScene();
#else #else
if(sdl_scale == 2) if(sdl_scale == 2)
sdl_blit_2(x, y, w, h, src, pitch); sdl_blit_2(x, y, w, h, src, pitch);
@@ -708,7 +709,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc)
//x = 2+32*(b/2); //x = 2+32*(b/2);
//y = YRES+2+20*(b%2); //y = YRES+2+20*(b%2);
#ifdef OpenGL #ifdef OpenGL
fillrect(vid_buf, x, y, 28, 16, PIXR(pc), PIXG(pc), PIXB(pc), 255); fillrect(vid_buf, x, y, 28, 16, PIXR(pc), PIXG(pc), PIXB(pc), 255);
#else #else
for(j=1; j<15; j++) for(j=1; j<15; j++)
{ {
@@ -744,11 +745,7 @@ 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) void draw_menu(pixel *vid_buf, int i, int hover)
{ {
if(i==SEC&&SEC!=0) drawrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255);
drawrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 0, 255, 255, 255);
else
drawrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255);
if(hover==i) if(hover==i)
{ {
fillrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); fillrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255);
@@ -851,13 +848,13 @@ int drawtext(pixel *vid, int x, int y, 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 drawrect(pixel *vid, int x, int y, int w, int h, int r, int g, int b, int a)
{ {
#ifdef OpenGL #ifdef OpenGL
glBegin(GL_LINE_LOOP); glBegin(GL_LINE_LOOP);
glColor4ub(r, g, b, a); glColor4ub(r, g, b, a);
glVertex2i(x, y); glVertex2i(x, y);
glVertex2i(x+w, y); glVertex2i(x+w, y);
glVertex2i(x+w, y+h); glVertex2i(x+w, y+h);
glVertex2i(x, y+h); glVertex2i(x, y+h);
glEnd(); glEnd();
#else #else
int i; int i;
for(i=0; i<=w; i++) for(i=0; i<=w; i++)
@@ -876,13 +873,13 @@ 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) void fillrect(pixel *vid, int x, int y, int w, int h, int r, int g, int b, int a)
{ {
#ifdef OpenGL #ifdef OpenGL
glBegin(GL_QUADS); glBegin(GL_QUADS);
glColor4ub(r, g, b, a); glColor4ub(r, g, b, a);
glVertex2i(x, y); glVertex2i(x, y);
glVertex2i(x+w, y); glVertex2i(x+w, y);
glVertex2i(x+w, y+h); glVertex2i(x+w, y+h);
glVertex2i(x, y+h); glVertex2i(x, y+h);
glEnd(); glEnd();
#else #else
int i,j; int i,j;
for(j=1; j<h; j++) for(j=1; j<h; j++)
@@ -900,12 +897,12 @@ void clearrect(pixel *vid, int x, int y, int w, int h)
void drawdots(pixel *vid, int x, int y, int h, int r, int g, int b, int a) void drawdots(pixel *vid, int x, int y, int h, int r, int g, int b, int a)
{ {
#ifdef OpenGL #ifdef OpenGL
int i; int i;
glBegin(GL_QUADS); glBegin(GL_QUADS);
glColor4ub(r, g, b, a); glColor4ub(r, g, b, a);
for(i = 0; i <= h; i +=2) for(i = 0; i <= h; i +=2)
glVertex2i(x, y+i); glVertex2i(x, y+i);
glEnd(); glEnd();
#else #else
int i; int i;
for(i=0; i<=h; i+=2) for(i=0; i<=h; i+=2)
@@ -975,7 +972,7 @@ inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
return; return;
if(a!=255) if(a!=255)
{ {
glBegin (GL_QUADS); glBegin (GL_QUADS);
glColor4ub(r,g,b,a); glColor4ub(r,g,b,a);
glVertex2i(x, y); glVertex2i(x, y);
} }
@@ -1173,12 +1170,12 @@ void xor_rect(pixel *vid, int x, int y, int w, int h)
} }
void draw_parts(pixel *vid) void draw_parts(pixel *vid)
{ {
int i, x, y, t, nx, ny, r, s; int i, x, y, t, nx, ny, r, s;
int cr, cg, cb; int cr, cg, cb;
float fr, fg, fb; float fr, fg, fb;
float pt = R_TEMP; float pt = R_TEMP;
for(i = 0; i<NPART; i++){ for(i = 0; i<NPART; i++) {
#ifdef OpenGL #ifdef OpenGL
if(cmode == 6) //If fire mode if(cmode == 6) //If fire mode
{ {
@@ -1189,18 +1186,18 @@ void draw_parts(pixel *vid)
{ {
for(y=-1; y<=1; y++) for(y=-1; y<=1; y++)
{ {
if ((abs(x) == 0) && (abs(y) == 0)) if ((abs(x) == 0) && (abs(y) == 0))
blendpixel(vid,x+nx,y+ny,224,224,170,255); blendpixel(vid,x+nx,y+ny,224,224,170,255);
else if (abs(y) != 0 && abs(x) != 0) else if (abs(y) != 0 && abs(x) != 0)
blendpixel(vid,x+nx,y+ny,224,224,170,20); blendpixel(vid,x+nx,y+ny,224,224,170,20);
else else
blendpixel(vid,x+nx,y+ny,224,224,170,40); blendpixel(vid,x+nx,y+ny,224,224,170,40);
} }
} }
} }
else if(t==PT_PLUT) else if(t==PT_PLUT)
{ {
int tempx; int tempx;
int tempy; int tempy;
@@ -1212,7 +1209,7 @@ void draw_parts(pixel *vid)
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, ny-1, cr, cg, cb, 96); blendpixel(vid, nx, ny-1, cr, cg, cb, 96);
for(tempx = 2; tempx < 10; tempx++) { for(tempx = 2; tempx < 10; tempx++) {
for(tempy = 2; tempy < 10; tempy++) { for(tempy = 2; tempy < 10; tempy++) {
blendpixel(vid, nx+tempx, ny-tempy, cr, cg, cb, 5); blendpixel(vid, nx+tempx, ny-tempy, cr, cg, cb, 5);
blendpixel(vid, nx-tempx, ny+tempy, cr, cg, cb, 5); blendpixel(vid, nx-tempx, ny+tempy, cr, cg, cb, 5);
@@ -1220,23 +1217,23 @@ void draw_parts(pixel *vid)
blendpixel(vid, nx-tempx, ny-tempy, cr, cg, cb, 5); blendpixel(vid, nx-tempx, ny-tempy, cr, cg, cb, 5);
} }
} }
} }
} }
if(parts[i].type){ if(parts[i].type) {
//Do nothing //Do nothing
t = parts[i].type; t = parts[i].type;
nx = (int)(parts[i].x+0.5f); nx = (int)(parts[i].x+0.5f);
ny = (int)(parts[i].y+0.5f); ny = (int)(parts[i].y+0.5f);
glBegin (GL_POINTS); glBegin (GL_POINTS);
glColor3ub (PIXR(ptypes[t].pcolors), PIXG(ptypes[t].pcolors), PIXB(ptypes[t].pcolors)); glColor3ub (PIXR(ptypes[t].pcolors), PIXG(ptypes[t].pcolors), PIXB(ptypes[t].pcolors));
glVertex2d (nx, ny); glVertex2d (nx, ny);
glEnd (); glEnd ();
} }
#else #else
if(parts[i].type){ if(parts[i].type) {
t = parts[i].type; t = parts[i].type;
nx = (int)(parts[i].x+0.5f); nx = (int)(parts[i].x+0.5f);
ny = (int)(parts[i].y+0.5f); ny = (int)(parts[i].y+0.5f);
if(cmode!=CM_HEAT) if(cmode!=CM_HEAT)
@@ -1291,20 +1288,20 @@ void draw_parts(pixel *vid)
cr = PIXR(ptypes[t].pcolors)/s; cr = PIXR(ptypes[t].pcolors)/s;
cg = PIXG(ptypes[t].pcolors)/s; cg = PIXG(ptypes[t].pcolors)/s;
cb = PIXB(ptypes[t].pcolors)/s; cb = PIXB(ptypes[t].pcolors)/s;
if(cmode==6){ if(cmode==6) {
for(x=-1; x<=1; x++) for(x=-1; x<=1; x++)
{ {
for(y=-1; y<=1; y++) for(y=-1; y<=1; y++)
{ {
if ((abs(x) == 0) && (abs(y) == 0)) if ((abs(x) == 0) && (abs(y) == 0))
blendpixel(vid,x+nx,y+ny,cr,cg,cb,100); blendpixel(vid,x+nx,y+ny,cr,cg,cb,100);
else if (abs(y) != 0 || abs(x) != 0) else if (abs(y) != 0 || abs(x) != 0)
blendpixel(vid,x+nx,y+ny,cr,cg,cb,40); blendpixel(vid,x+nx,y+ny,cr,cg,cb,40);
} }
} }
} else { } else {
blendpixel(vid, nx, ny, cr, cg, cb, 255); blendpixel(vid, nx, ny, cr, cg, cb, 255);
} }
if(cmode==4) if(cmode==4)
{ {
@@ -1420,10 +1417,23 @@ void draw_parts(pixel *vid)
{ {
if(cmode == 3||cmode==4 || cmode==6) if(cmode == 3||cmode==4 || cmode==6)
{ {
vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors; cg = 0;
cg = 12; cb = 0;
cb = 12; cr = 0;
cr = 12; 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;
x = nx/CELL; x = nx/CELL;
y = ny/CELL; y = ny/CELL;
cg += fire_g[y][x]; cg += fire_g[y][x];
@@ -1457,52 +1467,6 @@ void draw_parts(pixel *vid)
x = nx; x = nx;
y = ny; y = ny;
blendpixel(vid,x,y,17,217,24,255); blendpixel(vid,x,y,17,217,24,255);
}
else if((t==PT_FWRK && parts[i].life >= 1)&&(cmode == 3||cmode==4 || cmode==6))
{
x = nx;
y = ny;
vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors;
cg = 10;
cb = 10;
cr = 10;
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 if(t==PT_DUST && parts[i].life >= 1)
{
x = nx;
y = ny;
if(cmode == 3||cmode==4 || cmode==6)
{
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(parts[i].tmp,parts[i].ctype,parts[i].flags);
cg = parts[i].tmp/4;
cb = parts[i].ctype/4;
cr = parts[i].flags/4;
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
blendpixel(vid,x,y,parts[i].tmp,parts[i].ctype,parts[i].flags,255);
} }
else if(t==PT_LNTG&&cmode == 6) else if(t==PT_LNTG&&cmode == 6)
{ {
@@ -1710,17 +1674,17 @@ void draw_parts(pixel *vid)
blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32);
} }
} }
else if(t==PT_GLOW) else if(t==PT_GLOW)
{ {
fg = 0; fg = 0;
fb = 0; fb = 0;
fr = 0; fr = 0;
if(pv[ny/CELL][nx/CELL]>0){ if(pv[ny/CELL][nx/CELL]>0) {
fg = 6 * pv[ny/CELL][nx/CELL]; fg = 6 * pv[ny/CELL][nx/CELL];
fb = 4 * pv[ny/CELL][nx/CELL]; fb = 4 * pv[ny/CELL][nx/CELL];
fr = 2 * pv[ny/CELL][nx/CELL]; fr = 2 * pv[ny/CELL][nx/CELL];
} }
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB((int)restrict_flt(0x44 + fr*8, 0, 255), (int)restrict_flt(0x88 + fg*8, 0, 255), (int)restrict_flt(0x44 + fb*8, 0, 255)); vid[ny*(XRES+BARSIZE)+nx] = PIXRGB((int)restrict_flt(0x44 + fr*8, 0, 255), (int)restrict_flt(0x88 + fg*8, 0, 255), (int)restrict_flt(0x44 + fb*8, 0, 255));
if(cmode == 3||cmode==4 || cmode==6) if(cmode == 3||cmode==4 || cmode==6)
{ {
x = nx/CELL; x = nx/CELL;
@@ -1735,38 +1699,71 @@ void draw_parts(pixel *vid)
if(fr > 255) fr = 255; if(fr > 255) fr = 255;
fire_r[y][x] = fr; fire_r[y][x] = fr;
} }
if(cmode == 4){ if(cmode == 4) {
uint8 R = (int)restrict_flt(0x44 + fr*8, 0, 255); uint8 R = (int)restrict_flt(0x44 + fr*8, 0, 255);
uint8 G = (int)restrict_flt(0x88 + fg*8, 0, 255); uint8 G = (int)restrict_flt(0x88 + fg*8, 0, 255);
uint8 B = (int)restrict_flt(0x44 + fb*8, 0, 255); uint8 B = (int)restrict_flt(0x44 + fb*8, 0, 255);
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-1, R, G, B, 112); blendpixel(vid, nx+1, ny, R, G, B, 223);
blendpixel(vid, nx-1, ny-1, R, G, B, 112); blendpixel(vid, nx-1, ny, R, G, B, 223);
blendpixel(vid, nx+1, ny+1, R, G, B, 112); blendpixel(vid, nx, ny+1, R, G, B, 223);
blendpixel(vid, nx-1, ny+1, R, G, B, 112); blendpixel(vid, nx, ny-1, R, G, B, 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);
}
} }
else if(t==PT_LCRY) else if(t==PT_LCRY)
{ {
uint8 GR = 0x50+(parts[i].life*10); uint8 GR = 0x50+(parts[i].life*10);
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, GR, GR); vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, GR, GR);
if(cmode == 4){ if(cmode == 4) {
blendpixel(vid, nx+1, ny, GR, GR, GR, 223); blendpixel(vid, nx+1, ny, GR, GR, GR, 223);
blendpixel(vid, nx-1, ny, GR, GR, GR, 223); blendpixel(vid, nx-1, ny, GR, GR, GR, 223);
blendpixel(vid, nx, ny+1, GR, GR, GR, 223); blendpixel(vid, nx, ny+1, GR, GR, GR, 223);
blendpixel(vid, nx, ny-1, GR, GR, GR, 223); blendpixel(vid, nx, ny-1, GR, GR, GR, 223);
blendpixel(vid, nx+1, ny-1, GR, GR, GR, 112); blendpixel(vid, nx+1, ny-1, GR, GR, GR, 112);
blendpixel(vid, nx-1, ny-1, GR, GR, GR, 112); blendpixel(vid, nx-1, ny-1, GR, GR, GR, 112);
blendpixel(vid, nx+1, ny+1, GR, GR, GR, 112); blendpixel(vid, nx+1, ny+1, GR, GR, GR, 112);
blendpixel(vid, nx-1, ny+1, GR, GR, GR, 112); blendpixel(vid, nx-1, ny+1, GR, GR, GR, 112);
} }
} else if(t==PT_PLSM) }
else if(t==PT_PCLN)
{
uint8 GR = 0x3B+(parts[i].life*19);
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, GR, 10);
if(cmode == 4) {
blendpixel(vid, nx+1, ny, GR, GR, 10, 223);
blendpixel(vid, nx-1, ny, GR, GR, 10, 223);
blendpixel(vid, nx, ny+1, GR, GR, 10, 223);
blendpixel(vid, nx, ny-1, GR, GR, 10, 223);
blendpixel(vid, nx+1, ny-1, GR, GR, 10, 112);
blendpixel(vid, nx-1, ny-1, GR, GR, 10, 112);
blendpixel(vid, nx+1, ny+1, GR, GR, 10, 112);
blendpixel(vid, nx-1, ny+1, GR, GR, 10, 112);
}
}
else if(t==PT_HSWC)
{
uint8 GR = 0x3B+(parts[i].life*19);
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, 10, 10);
if(cmode == 4) {
blendpixel(vid, nx+1, ny, GR, 10, 10, 223);
blendpixel(vid, nx-1, ny, GR, 10, 10, 223);
blendpixel(vid, nx, ny+1, GR, 10, 10, 223);
blendpixel(vid, nx, ny-1, GR, 10, 10, 223);
blendpixel(vid, nx+1, ny-1, GR, 10, 10, 112);
blendpixel(vid, nx-1, ny-1, GR, 10, 10, 112);
blendpixel(vid, nx+1, ny+1, GR, 10, 10, 112);
blendpixel(vid, nx-1, ny+1, GR, 10, 10, 112);
}
}
else if(t==PT_PLSM)
{ {
float ttemp = (float)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); int caddress = restrict_flt(restrict_flt(ttemp, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
@@ -1805,10 +1802,126 @@ void draw_parts(pixel *vid)
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);
} }
} else if(t==PT_HFLM)
{
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 = hflm_data[caddress];
uint8 G = hflm_data[caddress+1];
uint8 B = hflm_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);
}
} else if(t==PT_FIRW&&parts[i].tmp>=3)
{
float ttemp = (float)parts[i].tmp-4;
int caddress = restrict_flt(restrict_flt(ttemp, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
uint8 R = firw_data[caddress];
uint8 G = firw_data[caddress+1];
uint8 B = firw_data[caddress+2];
if(cmode == 3||cmode==4 || cmode==6)
{
cr = R/2;
cg = G/2;
cb = B/2;
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);
}
} }
else if(t==PT_FIRE && parts[i].life) else if(t==PT_FIRE && parts[i].life)
{ {
if(cmode == 3||cmode==4 || cmode==6) 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)
{ {
cr = parts[i].life / 4; cr = parts[i].life / 4;
cg = parts[i].life / 16; cg = parts[i].life / 16;
@@ -1845,7 +1958,7 @@ void draw_parts(pixel *vid)
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);
blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32);
} }*/
} }
else if(t==PT_LAVA && parts[i].life) else if(t==PT_LAVA && parts[i].life)
{ {
@@ -1914,7 +2027,7 @@ void draw_parts(pixel *vid)
else else
{ {
float ttemp = parts[i].temp+(-MIN_TEMP); float ttemp = parts[i].temp+(-MIN_TEMP);
int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/512) ) *3, 0.0f, (512.0f*3)-3); int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/1024) ) *3, 0.0f, (1024.0f*3)-3);
uint8 R = color_data[caddress]; uint8 R = color_data[caddress];
uint8 G = color_data[caddress+1]; uint8 G = color_data[caddress+1];
uint8 B = color_data[caddress+2]; uint8 B = color_data[caddress+2];
@@ -1942,7 +2055,7 @@ void draw_parts(pixel *vid)
draw_line(vid , nx, ny+3, player[11], player[12], R, G, B, s); draw_line(vid , nx, ny+3, player[11], player[12], R, G, B, s);
draw_line(vid , player[11], player[12], player[15], player[16], R, G, B, s); draw_line(vid , player[11], player[12], player[15], player[16], R, G, B, s);
isplayer = 1; //It's a secret. Tssss... isplayer = 1; //It's a secret. Tssss...
} }
else else
{ {
@@ -1950,7 +2063,7 @@ void draw_parts(pixel *vid)
//blendpixel(vid, nx+1, ny, R, G, B, 255); //blendpixel(vid, nx+1, ny, R, G, B, 255);
} }
} }
if(cmode == 4&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH) 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 R = PIXR(ptypes[t].pcolors);
uint8 G = PIXG(ptypes[t].pcolors); uint8 G = PIXG(ptypes[t].pcolors);
@@ -1970,11 +2083,11 @@ void draw_parts(pixel *vid)
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);
} }
} }
#endif #endif
} }
#ifdef OpenGL #ifdef OpenGL
glFlush (); glFlush ();
#endif #endif
} }
@@ -2000,9 +2113,9 @@ void render_signs(pixel *vid_buf)
if(strcmp(signs[i].text, "{t}")==0) if(strcmp(signs[i].text, "{t}")==0)
{ {
if((pmap[signs[i].y][signs[i].x]>>8)>0 && (pmap[signs[i].y][signs[i].x]>>8)<NPART) if((pmap[signs[i].y][signs[i].x]>>8)>0 && (pmap[signs[i].y][signs[i].x]>>8)<NPART)
sprintf(buff, "Temp: %4.2f", parts[pmap[signs[i].y][signs[i].x]>>8].temp-273.15f); //...tempirature sprintf(buff, "Temp: %4.2f", parts[pmap[signs[i].y][signs[i].x]>>8].temp-273.15); //...tempirature
else else
sprintf(buff, "Temp: N/A"); //...tempirature sprintf(buff, "Temp: 0.00"); //...tempirature
drawtext(vid_buf, x+3, y+3, buff, 255, 255, 255, 255); drawtext(vid_buf, x+3, y+3, buff, 255, 255, 255, 255);
} }
@@ -2069,33 +2182,33 @@ void prepare_alpha(void)
pixel *render_packed_rgb(void *image, int width, int height, int cmp_size) pixel *render_packed_rgb(void *image, int width, int height, int cmp_size)
{ {
unsigned char *tmp; unsigned char *tmp;
pixel *res; pixel *res;
int i; int i;
tmp = malloc(width*height*3); tmp = malloc(width*height*3);
if(!tmp) if(!tmp)
return NULL; return NULL;
res = malloc(width*height*PIXELSIZE); res = malloc(width*height*PIXELSIZE);
if(!res) if(!res)
{ {
free(tmp); free(tmp);
return NULL; return NULL;
} }
i = width*height*3; i = width*height*3;
if(BZ2_bzBuffToBuffDecompress((char *)tmp, (unsigned *)&i, (char *)image, cmp_size, 0, 0)) if(BZ2_bzBuffToBuffDecompress((char *)tmp, (unsigned *)&i, (char *)image, cmp_size, 0, 0))
{ {
free(res); free(res);
free(tmp); free(tmp);
return NULL; return NULL;
} }
for(i=0; i<width*height; i++) for(i=0; i<width*height; i++)
res[i] = PIXRGB(tmp[3*i], tmp[3*i+1], tmp[3*i+2]); res[i] = PIXRGB(tmp[3*i], tmp[3*i+1], tmp[3*i+2]);
free(tmp); free(tmp);
return res; return res;
} }
void draw_image(pixel *vid, pixel *img, int x, int y, int w, int h, int a) void draw_image(pixel *vid, pixel *img, int x, int y, int w, int h, int a)
@@ -2171,11 +2284,12 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
return NULL; return NULL;
if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50)) if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50))
return NULL; return NULL;
if(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) {
new_format = 1;
}
if(c[4]>SAVE_VERSION) if(c[4]>SAVE_VERSION)
return NULL; return NULL;
if(c[2]==0x43 && c[1]==0x75 && c[0]==0x66){
new_format = 1;
}
bw = c[6]; bw = c[6];
bh = c[7]; bh = c[7];
w = bw*CELL; w = bw*CELL;
@@ -2442,14 +2556,14 @@ void sdl_open(void)
} }
atexit(SDL_Quit); atexit(SDL_Quit);
#ifdef OpenGL #ifdef OpenGL
sdl_scrn=SDL_SetVideoMode(XRES*sdl_scale + BARSIZE*sdl_scale,YRES*sdl_scale + MENUSIZE*sdl_scale,32,SDL_OPENGL); sdl_scrn=SDL_SetVideoMode(XRES*sdl_scale + BARSIZE*sdl_scale,YRES*sdl_scale + MENUSIZE*sdl_scale,32,SDL_OPENGL);
SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);
Enable2D (); Enable2D ();
// glBegin(GL_TRIANGLES); // glBegin(GL_TRIANGLES);
// glColor3ub (255, 0, 0); // glColor3ub (255, 0, 0);
// glVertex2d (0, 0); // glVertex2d (0, 0);
// glColor3ub (0, 255, 0); // glColor3ub (0, 255, 0);
// glVertex2d (640,0); // glVertex2d (640,0);
// glColor3ub (0, 0, 255); // glColor3ub (0, 0, 255);
// glVertex2d (50, 50); // glVertex2d (50, 50);
//glEnd (); //glEnd ();
@@ -2488,11 +2602,11 @@ void Enable2D ()
glPushMatrix (); glPushMatrix ();
glLoadIdentity (); glLoadIdentity ();
glEnable (GL_BLEND); glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST); glHint( GL_LINE_SMOOTH_HINT, GL_NICEST);
glHint( GL_POINT_SMOOTH_HINT, GL_NICEST); glHint( GL_POINT_SMOOTH_HINT, GL_NICEST);
} }
void RenderScene () void RenderScene ()
{ {
@@ -2500,6 +2614,6 @@ void RenderScene ()
} }
void ClearScreen() void ClearScreen()
{ {
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
} }
#endif #endif

View File

@@ -42,9 +42,9 @@
#include <netdb.h> #include <netdb.h>
#endif #endif
#include "defines.h" #include <defines.h>
#include "http.h" #include <http.h>
#include "md5.h" #include <md5.h>
#ifdef WIN32 #ifdef WIN32
#define PERROR SOCKET_ERROR #define PERROR SOCKET_ERROR

View File

@@ -4,13 +4,13 @@
#include <bzlib.h> #include <bzlib.h>
#include <math.h> #include <math.h>
#include <time.h> #include <time.h>
#include "http.h" #include <http.h>
#include "md5.h" #include <md5.h>
#include "font.h" #include <font.h>
#include "defines.h" #include <defines.h>
#include "powder.h" #include <powder.h>
#include "interface.h" #include <interface.h>
#include "misc.h" #include <misc.h>
SDLMod sdl_mod; SDLMod sdl_mod;
int sdl_key, sdl_wheel, sdl_caps=0, sdl_ascii, sdl_zoom_trig=0; int sdl_key, sdl_wheel, sdl_caps=0, sdl_ascii, sdl_zoom_trig=0;
@@ -1292,7 +1292,7 @@ void menu_ui(pixel *vid_buf, int i, int *sl, int *sr)
else if(n==*sr) else if(n==*sr)
{ {
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255); drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255);
} }
} }
} }
for(n = 0; n<PT_NUM; n++) for(n = 0; n<PT_NUM; n++)
@@ -1401,9 +1401,9 @@ void menu_ui(pixel *vid_buf, int i, int *sl, int *sr)
//drawtext(vid_buf, XRES+2, (12*i)+2, msections[i].icon, 255, 255, 255, 255); //drawtext(vid_buf, XRES+2, (12*i)+2, msections[i].icon, 255, 255, 255, 255);
} }
void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, int mx, int my) void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, int my)
{ {
int h,x,y,n=0,height,width,sy,rows=0,sec=-1; int h,x,y,n=0,height,width,sy,rows=0;
mx /= sdl_scale; mx /= sdl_scale;
my /= sdl_scale; my /= sdl_scale;
rows = ceil((float)msections[i].itemcount/16.0f); rows = ceil((float)msections[i].itemcount/16.0f);
@@ -1425,12 +1425,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq,
y += 19; y += 19;
} }
x -= draw_tool_xy(vid_buf, x, y, n, mwalls[n-122].colour)+5; x -= draw_tool_xy(vid_buf, x, y, n, mwalls[n-122].colour)+5;
if(!bq && mx>=x+32 && mx<x+58 && my>=y && my< y+15&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) if(!bq && mx>=x+32 && mx<x+58 && my>=y && my< y+15)
{
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255);
h = n;
}
else if(!bq && mx>=x+32 && mx<x+58 && my>=y && my< y+15)
{ {
drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255);
h = n; h = n;
@@ -1442,10 +1437,6 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq,
else if(n==*sr) else if(n==*sr)
{ {
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255); drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255);
}
else if(n==*psr)
{
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255);
} }
} }
} }
@@ -1462,12 +1453,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq,
y += 19; y += 19;
} }
x -= draw_tool_xy(vid_buf, x, y, n, mwalls[n-122].colour)+5; x -= draw_tool_xy(vid_buf, x, y, n, mwalls[n-122].colour)+5;
if(!bq && mx>=x+32 && mx<x+58 && my>=y && my< y+15&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) if(!bq && mx>=x+32 && mx<x+58 && my>=y && my< y+15)
{
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255);
h = n;
}
else if(!bq && mx>=x+32 && mx<x+58 && my>=y && my< y+15)
{ {
drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255);
h = n; h = n;
@@ -1479,10 +1465,6 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq,
else if(n==*sr) else if(n==*sr)
{ {
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255); drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255);
}
else if(n==*psr)
{
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255);
} }
} }
} }
@@ -1496,12 +1478,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq,
y += 19; y += 19;
} }
x -= draw_tool_xy(vid_buf, x, y, n, ptypes[n].pcolors)+5; x -= draw_tool_xy(vid_buf, x, y, n, ptypes[n].pcolors)+5;
if(!bq && mx>=x+32 && mx<x+58 && my>=y && my< y+15&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) if(!bq && mx>=x+32 && mx<x+58 && my>=y && my< y+15)
{
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255);
h = n;
}
else if(!bq && mx>=x+32 && mx<x+58 && my>=y && my< y+15)
{ {
drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255);
h = n; h = n;
@@ -1513,10 +1490,6 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq,
else if(n==*sr) else if(n==*sr)
{ {
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255); drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255);
}
else if(n==*psr)
{
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255);
} }
} }
} }
@@ -1533,12 +1506,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq,
y += 19; y += 19;
} }
x -= draw_tool_xy(vid_buf, x, y, n, ptypes[n].pcolors)+5; x -= draw_tool_xy(vid_buf, x, y, n, ptypes[n].pcolors)+5;
if(!bq && mx>=x+32 && mx<x+58 && my>=y && my< y+15&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) if(!bq && mx>=x+32 && mx<x+58 && my>=y && my< y+15)
{
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255);
h = n;
}
else if(!bq && mx>=x+32 && mx<x+58 && my>=y && my< y+15)
{ {
drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255);
h = n; h = n;
@@ -1550,19 +1518,11 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq,
else if(n==*sr) else if(n==*sr)
{ {
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255); drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255);
}
else if(n==*psr)
{
drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255);
} }
} }
} }
} }
if(!bq&&mx>=sdl_scale*(XRES-2) && mx<sdl_scale*(XRES+BARSIZE-1) &&my>= sdl_scale*((i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16)) && my<sdl_scale*((i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16)+15))
{
if(i>=0&&i<SC_TOTAL)
sec = i;
}
if(h==-1) if(h==-1)
{ {
drawtext(vid_buf, XRES-textwidth((char *)msections[i].name)-BARSIZE, sy-10, (char *)msections[i].name, 255, 255, 255, 255); drawtext(vid_buf, XRES-textwidth((char *)msections[i].name)-BARSIZE, sy-10, (char *)msections[i].name, 255, 255, 255, 255);
@@ -1578,39 +1538,12 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq,
if(b==1&&h!=-1) if(b==1&&h!=-1)
{ {
if(sdl_mod & (KMOD_LALT|KMOD_RALT))
{
PSR=h;
*psr=h;
SEC=-1;
}
else
*sl = h; *sl = h;
} }
else if((b==1&&sec>0)&&(sdl_mod & (KMOD_LALT|KMOD_RALT)))
{
SEC = sec;
PSR=-1;
*psr=-1;
}
if(b==4&&h!=-1) if(b==4&&h!=-1)
{ {
if(sdl_mod & (KMOD_LALT|KMOD_RALT))
{
PSR=h;
*psr=h;
SEC=-1;
}
else
*sr = h; *sr = h;
} }
else if((b==4&&sec>0)&&(sdl_mod & (KMOD_LALT|KMOD_RALT)))
{
SEC = sec;
PSR=-1;
*psr=-1;
}
} }
int sdl_poll(void) int sdl_poll(void)
@@ -1826,7 +1759,7 @@ corrupt:
int search_ui(pixel *vid_buf) 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,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,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 is_p1=0, exp_res=GRID_X*GRID_Y, tp, view_own=0;
int thumb_drawn[GRID_X*GRID_Y]; int thumb_drawn[GRID_X*GRID_Y];
pixel *v_buf = (pixel *)malloc(((YRES+MENUSIZE)*(XRES+BARSIZE))*PIXELSIZE); pixel *v_buf = (pixel *)malloc(((YRES+MENUSIZE)*(XRES+BARSIZE))*PIXELSIZE);
@@ -1856,7 +1789,7 @@ int search_ui(pixel *vid_buf)
memset(img_id, 0, sizeof(img_id)); memset(img_id, 0, sizeof(img_id));
memset(search_ids, 0, sizeof(search_ids)); memset(search_ids, 0, sizeof(search_ids));
memset(search_dates, 0, sizeof(search_dates)); memset(search_dates, 0, sizeof(search_dates));
memset(search_names, 0, sizeof(search_names)); memset(search_names, 0, sizeof(search_names));
memset(search_scoreup, 0, sizeof(search_scoreup)); memset(search_scoreup, 0, sizeof(search_scoreup));
memset(search_scoredown, 0, sizeof(search_scoredown)); memset(search_scoredown, 0, sizeof(search_scoredown));
@@ -2019,6 +1952,7 @@ int search_ui(pixel *vid_buf)
} }
mp = dp = -1; mp = dp = -1;
dap = -1;
st = 0; st = 0;
for(gj=0; gj<GRID_Y; gj++) for(gj=0; gj<GRID_Y; gj++)
for(gi=0; gi<GRID_X; gi++) for(gi=0; gi<GRID_X; gi++)
@@ -2031,7 +1965,7 @@ int search_ui(pixel *vid_buf)
} }
else else
pos = gi+GRID_X*gj; pos = gi+GRID_X*gj;
if(!search_dates[pos]) if(!search_ids[pos])
break; break;
gx = ((XRES/GRID_X)*gi) + (XRES/GRID_X-XRES/GRID_S)/2; gx = ((XRES/GRID_X)*gi) + (XRES/GRID_X-XRES/GRID_S)/2;
gy = ((((YRES-(MENUSIZE-20))+15)/GRID_Y)*gj) + ((YRES-(MENUSIZE-20))/GRID_Y-(YRES-(MENUSIZE-20))/GRID_S+10)/2 + 18; gy = ((((YRES-(MENUSIZE-20))+15)/GRID_Y)*gj) + ((YRES-(MENUSIZE-20))/GRID_Y-(YRES-(MENUSIZE-20))/GRID_S+10)/2 + 18;
@@ -2070,10 +2004,16 @@ int search_ui(pixel *vid_buf)
mp = -1; mp = -1;
dp = pos; dp = pos;
} }
if(!search_dates[pos] && mx>=gx-6 && mx<=gx+4 && my>=gy+YRES/GRID_S-4 && my<=gy+YRES/GRID_S+6)
{
mp = -1;
dap = pos;
}
} }
drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2, 6, YRES/GRID_S+3, 128, 128, 128, 255); drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2, 6, YRES/GRID_S+3, 128, 128, 128, 255);
fillrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2, 6, 1+(YRES/GRID_S+3)/2, 0, 107, 10, 255); fillrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2, 6, 1+(YRES/GRID_S+3)/2, 0, 107, 10, 255);
fillrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2), 6, 1+(YRES/GRID_S+3)/2, 107, 10, 0, 255); fillrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2), 6, 1+(YRES/GRID_S+3)/2, 107, 10, 0, 255);
if(mp==pos && !st) if(mp==pos && !st)
drawrect(vid_buf, gx-2, gy-2, XRES/GRID_S+3, YRES/GRID_S+3, 160, 160, 192, 255); drawrect(vid_buf, gx-2, gy-2, XRES/GRID_S+3, YRES/GRID_S+3, 160, 160, 192, 255);
else else
@@ -2091,6 +2031,16 @@ int search_ui(pixel *vid_buf)
drawtext(vid_buf, gx-6, gy-6, "\xCD", 255, 255, 255, 255); drawtext(vid_buf, gx-6, gy-6, "\xCD", 255, 255, 255, 255);
drawtext(vid_buf, gx-6, gy-6, "\xCE", 212, 151, 81, 255); drawtext(vid_buf, gx-6, gy-6, "\xCE", 212, 151, 81, 255);
} }
if(!search_dates[pos] && own)
{
fillrect(vid_buf, gx-5, gy+YRES/GRID_S-3, 7, 8, 255, 255, 255, 255);
if(dap == pos) {
drawtext(vid_buf, gx-6, gy+YRES/GRID_S-4, "\xA6", 200, 100, 80, 255);
} else {
drawtext(vid_buf, gx-6, gy+YRES/GRID_S-4, "\xA6", 160, 70, 50, 255);
}
//drawtext(vid_buf, gx-6, gy-6, "\xCE", 212, 151, 81, 255);
}
if(view_own || svf_admin || svf_mod) if(view_own || svf_admin || svf_mod)
{ {
sprintf(ts+1, "%d", search_votes[pos]); sprintf(ts+1, "%d", search_votes[pos]);
@@ -2132,10 +2082,11 @@ int search_ui(pixel *vid_buf)
nyd = search_scoredown[pos]/ry; nyd = search_scoredown[pos]/ry;
} }
fillrect(vid_buf, gx-1+(XRES/GRID_S)+5, gy-1+((YRES/GRID_S+3)/2)-nyu, 4, nyu, 57, 187, 57, 255);
fillrect(vid_buf, gx-1+(XRES/GRID_S)+5, gy-1+((YRES/GRID_S+3)/2)-nyu, 4, nyu, 57, 187, 57, 255);
fillrect(vid_buf, gx-1+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2), 4, nyd, 187, 57, 57, 255); fillrect(vid_buf, gx-1+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2), 4, nyd, 187, 57, 57, 255);
//drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)-nyu, 4, nyu, 0, 107, 10, 255); //drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)-nyu, 4, nyu, 0, 107, 10, 255);
// drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)+1, 4, nyd, 107, 10, 0, 255); //drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)+1, 4, nyd, 107, 10, 0, 255);
} }
} }
@@ -2204,6 +2155,11 @@ int search_ui(pixel *vid_buf)
last = NULL; last = NULL;
} }
} }
if(b && !bq && dap!=-1)
{
sprintf(ed.str, "history:%s", search_ids[dap]);
lasttime = TIMEOUT;
}
if(b && !bq && tp!=-1) if(b && !bq && tp!=-1)
{ {
@@ -2227,17 +2183,17 @@ int search_ui(pixel *vid_buf)
fillrect(vid_buf, 0, 0, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 255); fillrect(vid_buf, 0, 0, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 255);
info_box(vid_buf, "Loading..."); info_box(vid_buf, "Loading...");
if(search_dates[mp]){ if(search_dates[mp]) {
uri = malloc(strlen(search_ids[mp])*3+strlen(search_dates[mp])*3+strlen(SERVER)+71); uri = malloc(strlen(search_ids[mp])*3+strlen(search_dates[mp])*3+strlen(SERVER)+71);
strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID=");
strcaturl(uri, search_ids[mp]); strcaturl(uri, search_ids[mp]);
strcaturl(uri, "&Date="); strappend(uri, "&Date=");
strcaturl(uri, search_dates[mp]); strcaturl(uri, search_dates[mp]);
} else { } else {
uri = malloc(strlen(search_ids[mp])*3+strlen(SERVER)+64); uri = malloc(strlen(search_ids[mp])*3+strlen(SERVER)+64);
strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID=");
strcaturl(uri, search_ids[mp]); strcaturl(uri, search_ids[mp]);
} }
data = http_simple_get(uri, &status, &dlen); data = http_simple_get(uri, &status, &dlen);
free(uri); free(uri);
@@ -2449,9 +2405,22 @@ int search_ui(pixel *vid_buf)
thlen = 4; thlen = 4;
} }
thumb_cache_add(img_id[i], thumb, thlen); thumb_cache_add(img_id[i], thumb, thlen);
for(pos=0; pos<GRID_X*GRID_Y; pos++) for(pos=0; pos<GRID_X*GRID_Y; pos++) {
if(search_ids[pos] && !strcmp(search_ids[pos], img_id[i])) if(search_dates[pos]) {
break; char *id_d_temp = malloc(strlen(search_ids[pos])+strlen(search_dates[pos])+1);
strcpy(id_d_temp, search_ids[pos]);
strappend(id_d_temp, "_");
strappend(id_d_temp, search_dates[pos]);
//img_id[i] = mystrdup(id_d_temp);
if(id_d_temp && !strcmp(id_d_temp, img_id[i])) {
break;
}
} else {
if(search_ids[pos] && !strcmp(search_ids[pos], img_id[i])) {
break;
}
}
}
if(pos<GRID_X*GRID_Y) if(pos<GRID_X*GRID_Y)
{ {
search_thumbs[pos] = thumb; search_thumbs[pos] = thumb;
@@ -2476,10 +2445,25 @@ int search_ui(pixel *vid_buf)
} }
if(pos<GRID_X*GRID_Y) if(pos<GRID_X*GRID_Y)
{ {
uri = malloc(strlen(search_ids[pos])*3+strlen(SERVER)+64); if(search_dates[pos]) {
strcpy(uri, "http://" SERVER "/Get.api?Op=thumb&ID="); char *id_d_temp = malloc(strlen(search_ids[pos])+strlen(search_dates[pos])+1);
strcaturl(uri, search_ids[pos]); uri = malloc(strlen(search_ids[pos])*3+strlen(search_dates[pos])*3+strlen(SERVER)+71);
img_id[i] = mystrdup(search_ids[pos]); strcpy(uri, "http://" SERVER "/Get.api?Op=thumb&ID=");
strcaturl(uri, search_ids[pos]);
strappend(uri, "&Date=");
strcaturl(uri, search_dates[pos]);
strcpy(id_d_temp, search_ids[pos]);
strappend(id_d_temp, "_");
strappend(id_d_temp, search_dates[pos]);
img_id[i] = mystrdup(id_d_temp);
} else {
uri = malloc(strlen(search_ids[pos])*3+strlen(SERVER)+64);
strcpy(uri, "http://" SERVER "/Get.api?Op=thumb&ID=");
strcaturl(uri, search_ids[pos]);
img_id[i] = mystrdup(search_ids[pos]);
}
img_http[i] = http_async_req_start(img_http[i], uri, NULL, 0, 1); img_http[i] = http_async_req_start(img_http[i], uri, NULL, 0, 1);
free(uri); free(uri);
} }
@@ -2528,9 +2512,9 @@ int search_results(char *str, int votes)
free(search_names[i]); free(search_names[i]);
search_names[i] = NULL; search_names[i] = NULL;
} }
if(search_dates[i]) if(search_dates[i])
{ {
free(search_dates[i]); free(search_dates[i]);
search_dates[i] = NULL; search_dates[i] = NULL;
} }
if(search_owners[i]) if(search_owners[i])
@@ -2625,77 +2609,80 @@ int search_results(char *str, int votes)
search_owners[i] = mystrdup(q); search_owners[i] = mystrdup(q);
search_names[i] = mystrdup(r); search_names[i] = mystrdup(r);
if(s) if(s)
search_votes[i] = atoi(s); search_votes[i] = atoi(s);
thumb_cache_find(str+5, search_thumbs+i, search_thsizes+i); thumb_cache_find(str+5, search_thumbs+i, search_thsizes+i);
i++; i++;
} }
else if(!strncmp(str, "HISTORY ", 8)) else if(!strncmp(str, "HISTORY ", 8))
{ {
if(i>=GRID_X*GRID_Y) if(i>=GRID_X*GRID_Y)
break; break;
if(votes) if(votes)
{ {
sd = strchr(str+8, ' '); sd = strchr(str+8, ' ');
if(!sd) if(!sd)
return i; return i;
*(sd++) = 0; *(sd++) = 0;
pu = strchr(sd, ' '); pu = strchr(sd, ' ');
if(!pu) if(!pu)
return i; return i;
*(pu++) = 0; *(pu++) = 0;
s = strchr(pu, ' '); s = strchr(pu, ' ');
if(!s) if(!s)
return i; return i;
*(s++) = 0; *(s++) = 0;
vu = strchr(s, ' '); vu = strchr(s, ' ');
if(!vu) if(!vu)
return i; return i;
*(vu++) = 0; *(vu++) = 0;
vd = strchr(vu, ' '); vd = strchr(vu, ' ');
if(!vd) if(!vd)
return i; return i;
*(vd++) = 0; *(vd++) = 0;
q = strchr(vd, ' '); q = strchr(vd, ' ');
} }
else else
{ {
sd = strchr(str+8, ' '); sd = strchr(str+8, ' ');
if(!sd) if(!sd)
return i; return i;
*(sd++) = 0; *(sd++) = 0;
pu = strchr(sd, ' '); pu = strchr(sd, ' ');
if(!pu) if(!pu)
return i; return i;
*(pu++) = 0; *(pu++) = 0;
vu = strchr(pu, ' '); vu = strchr(pu, ' ');
if(!vu) if(!vu)
return i; return i;
*(vu++) = 0; *(vu++) = 0;
vd = strchr(vu, ' '); vd = strchr(vu, ' ');
if(!vd) if(!vd)
return i; return i;
*(vd++) = 0; *(vd++) = 0;
q = strchr(vd, ' '); q = strchr(vd, ' ');
} }
if(!q) if(!q)
return i; return i;
*(q++) = 0; *(q++) = 0;
r = strchr(q, ' '); r = strchr(q, ' ');
if(!r) if(!r)
return i; return i;
*(r++) = 0; *(r++) = 0;
search_ids[i] = mystrdup(str+8); search_ids[i] = mystrdup(str+8);
search_dates[i] = mystrdup(sd);
search_publish[i] = atoi(pu);
search_scoreup[i] = atoi(vu);
search_scoredown[i] = atoi(vd);
search_owners[i] = mystrdup(q);
search_names[i] = mystrdup(r);
if(s) search_dates[i] = mystrdup(sd);
search_votes[i] = atoi(s);
thumb_cache_find(str+8, search_thumbs+i, search_thsizes+i); search_publish[i] = atoi(pu);
search_scoreup[i] = atoi(vu);
search_scoredown[i] = atoi(vd);
search_owners[i] = mystrdup(q);
search_names[i] = mystrdup(r);
if(s)
search_votes[i] = atoi(s);
thumb_cache_find(str+8, search_thumbs+i, search_thsizes+i);
i++; i++;
} }
else if(!strncmp(str, "TAG ", 4)) else if(!strncmp(str, "TAG ", 4))
@@ -2971,4 +2958,4 @@ int execute_vote(pixel *vid_buf, char *id, char *action)
if(result) if(result)
free(result); free(result);
return 1; return 1;
} }

331
main.c → src/main.c Normal file → Executable file
View File

@@ -37,18 +37,18 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#include "misc.h" #include <misc.h>
#include "font.h" #include <font.h>
#include "defines.h" #include <defines.h>
#include "powder.h" #include <powder.h>
#include "graphics.h" #include <graphics.h>
#include "version.h" #include <version.h>
#include "http.h" #include <http.h>
#include "md5.h" #include <md5.h>
#include "update.h" #include <update.h>
#include "hmap.h" #include <hmap.h>
#include "air.h" #include <air.h>
#include "icon.h" #include <icon.h>
static const char *it_msg = static const char *it_msg =
"\brThe Powder Toy\n" "\brThe Powder Toy\n"
@@ -101,7 +101,6 @@ int legacy_enable = 0; //Used to disable new features such as heat, will be set
int death = 0, framerender = 0; int death = 0, framerender = 0;
int amd = 1; int amd = 1;
int FPSB = 0; int FPSB = 0;
int cracker = 1;
sign signs[MAXSIGNS]; sign signs[MAXSIGNS];
@@ -248,7 +247,7 @@ void *build_save(int *size, int x0, int y0, int w, int h)
d[p++] = bmap[y][x]; d[p++] = bmap[y][x];
for(y=by0; y<by0+bh; y++) for(y=by0; y<by0+bh; y++)
for(x=bx0; x<bx0+bw; x++) for(x=bx0; x<bx0+bw; x++)
if(bmap[y][x]==7) if(bmap[y][x]==4)
{ {
i = (int)(fvx[y][x]*64.0f+127.5f); i = (int)(fvx[y][x]*64.0f+127.5f);
if(i<0) i=0; if(i<0) i=0;
@@ -257,7 +256,7 @@ void *build_save(int *size, int x0, int y0, int w, int h)
} }
for(y=by0; y<by0+bh; y++) for(y=by0; y<by0+bh; y++)
for(x=bx0; x<bx0+bw; x++) for(x=bx0; x<bx0+bw; x++)
if(bmap[y][x]==7) if(bmap[y][x]==4)
{ {
i = (int)(fvy[y][x]*64.0f+127.5f); i = (int)(fvy[y][x]*64.0f+127.5f);
if(i<0) i=0; if(i<0) i=0;
@@ -311,10 +310,10 @@ void *build_save(int *size, int x0, int y0, int w, int h)
i = m[j]; i = m[j];
if(i) if(i)
{ {
//New Temperature saving uses a 16bit unsigned int for temperatures, giving a precision of 1 degree versus 36 for the old format //New Temperature saving uses a 16bit unsigned int for temperatures, giving a precision of 1 degree versus 36 for the old format
int tttemp = (int)parts[i-1].temp; int tttemp = (int)parts[i-1].temp;
d[p++] = ((tttemp&0xFF00)>>8); d[p++] = ((tttemp&0xFF00)>>8);
d[p++] = (tttemp&0x00FF); d[p++] = (tttemp&0x00FF);
} }
} }
for(j=0; j<w*h; j++) for(j=0; j<w*h; j++)
@@ -348,12 +347,14 @@ void *build_save(int *size, int x0, int y0, int w, int h)
} }
i = (p*101+99)/100 + 612; i = (p*101+99)/100 + 612;
c = malloc(i); c = malloc(i);
//New file header uses PSv, replacing fuC. This is to detect if the client uses a new save format for temperatures
//This creates a problem for old clients, that display and "corrupt" error instead of a "newer version" error //New file header uses PSv, replacing fuC. This is to detect if the client uses a new save format for temperatures
c[0] = 0x50; //0x66; //This creates a problem for old clients, that display and "corrupt" error instead of a "newer version" error
c[1] = 0x53; //0x75;
c[2] = 0x76; //0x43; c[0] = 0x50; //0x66;
c[1] = 0x53; //0x75;
c[2] = 0x76; //0x43;
c[3] = legacy_enable; c[3] = legacy_enable;
c[4] = SAVE_VERSION; c[4] = SAVE_VERSION;
c[5] = CELL; c[5] = CELL;
@@ -364,7 +365,6 @@ void *build_save(int *size, int x0, int y0, int w, int h)
c[10] = p >> 16; c[10] = p >> 16;
c[11] = p >> 24; c[11] = p >> 24;
i -= 12; i -= 12;
if(BZ2_bzBuffToBuffCompress((char *)(c+12), (unsigned *)&i, (char *)d, p, 9, 0, 0) != BZ_OK) if(BZ2_bzBuffToBuffCompress((char *)(c+12), (unsigned *)&i, (char *)d, p, 9, 0, 0) != BZ_OK)
@@ -385,22 +385,23 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
int i,j,k,x,y,p=0,*m=calloc(XRES*YRES, sizeof(int)), ver, pty, ty, legacy_beta=0; int i,j,k,x,y,p=0,*m=calloc(XRES*YRES, sizeof(int)), ver, pty, ty, legacy_beta=0;
int bx0=x0/CELL, by0=y0/CELL, bw, bh, w, h; int bx0=x0/CELL, by0=y0/CELL, bw, bh, w, h;
int fp[NPART], nf=0, new_format = 0, ttv = 0; int fp[NPART], nf=0, new_format = 0, ttv = 0;
//New file header uses PSv, replacing fuC. This is to detect if the client uses a new save format for temperatures
//This creates a problem for old clients, that display and "corrupt" error instead of a "newer version" error
if(size<16) //New file header uses PSv, replacing fuC. This is to detect if the client uses a new save format for temperatures
return 1; //This creates a problem for old clients, that display and "corrupt" error instead of a "newer version" error
if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50))
return 1;
if(c[2]==0x76 && c[1]==0x53 && c[0]==0x50){
new_format = 1;
}
if(c[4]>SAVE_VERSION)
return 2;
ver = c[4];
if(ver<34) if(size<16)
{ return 1;
if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50))
return 1;
if(c[2]==0x76 && c[1]==0x53 && c[0]==0x50) {
new_format = 1;
}
if(c[4]>SAVE_VERSION)
return 2;
ver = c[4];
if(ver<34)
{
legacy_enable = 1; legacy_enable = 1;
} }
else else
@@ -474,38 +475,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
for(x=bx0; x<bx0+bw; x++) for(x=bx0; x<bx0+bw; x++)
{ {
if(d[p]) if(d[p])
{
bmap[y][x] = d[p]; bmap[y][x] = d[p];
if(!cracker)
{
if(bmap[y][x]==1)
bmap[y][x]=11;
else if(bmap[y][x]==2)
bmap[y][x]=9;
else if(bmap[y][x]==3)
bmap[y][x]=8;
else if(bmap[y][x]==4)
bmap[y][x]=7;
else if(bmap[y][x]==5)
bmap[y][x]=5;
else if(bmap[y][x]==6)
bmap[y][x]=4;
else if(bmap[y][x]==7)
bmap[y][x]=3;
else if(bmap[y][x]==8)
bmap[y][x]=2;
else if(bmap[y][x]==9)
bmap[y][x]=12;
else if(bmap[y][x]==10)
bmap[y][x]=13;
else if(bmap[y][x]==11)
bmap[y][x]=14;
else if(bmap[y][x]==12)
bmap[y][x]=15;
else if(bmap[y][x]==13)
bmap[y][x]=20;
}
}
p++; p++;
} }
for(y=by0; y<by0+bh; y++) for(y=by0; y<by0+bh; y++)
@@ -536,7 +506,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
j=d[p++]; j=d[p++];
if(j >= PT_NUM) if(j >= PT_NUM)
goto corrupt; goto corrupt;
if(j && !(isplayer == 1 && j==PT_STKM)) if(j)// && !(isplayer == 1 && j==PT_STKM))
{ {
if(pmap[y][x]) if(pmap[y][x])
{ {
@@ -623,34 +593,32 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
{ {
if(ver>=34&&legacy_beta==0) if(ver>=34&&legacy_beta==0)
{ {
if(p >= size) if(p >= size)
{ {
goto corrupt; goto corrupt;
} }
if(i <= NPART) if(i <= NPART)
{ {
if(ver>=42){ if(ver>=42) {
if(new_format){ if(new_format) {
ttv = (d[p++])<<8; ttv = (d[p++])<<8;
ttv |= (d[p++]); ttv |= (d[p++]);
parts[i-1].temp = ttv; parts[i-1].temp = ttv;
} else { } else {
parts[i-1].temp = (d[p++]*((MAX_TEMP+(-MIN_TEMP))/255))+MIN_TEMP;
parts[i-1].temp = (d[p++]*((MAX_TEMP+(-MIN_TEMP))/255))+MIN_TEMP; }
} } else {
} parts[i-1].temp = ((d[p++]*((O_MAX_TEMP+(-O_MIN_TEMP))/255))+O_MIN_TEMP)+273;
else { }
parts[i-1].temp = ((d[p++]*((O_MAX_TEMP+(-O_MIN_TEMP))/255))+O_MIN_TEMP)+273.15; }
} else
} {
else p++;
{ if(new_format) {
p ++; p++;
if(new_format){ }
p++; }
} }
}
}
else else
{ {
parts[i-1].temp = ptypes[parts[i-1].type].heat; parts[i-1].temp = ptypes[parts[i-1].type].heat;
@@ -716,7 +684,6 @@ corrupt:
memset(signs, 0, sizeof(signs)); memset(signs, 0, sizeof(signs));
memset(parts, 0, sizeof(particle)*NPART); memset(parts, 0, sizeof(particle)*NPART);
memset(bmap, 0, sizeof(bmap)); memset(bmap, 0, sizeof(bmap));
} }
return 1; return 1;
} }
@@ -1010,7 +977,7 @@ int main(int argc, char *argv[])
#ifdef INTERNAL #ifdef INTERNAL
int vs = 0; int vs = 0;
#endif #endif
int x, y, b = 0, sl=1, sr=0,su=0,psr=-1, c, lb = 0, lx = 0, ly = 0, lm = 0;//, tx, ty; int x, y, b = 0, sl=1, sr=0, su=0, c, lb = 0, lx = 0, ly = 0, lm = 0;//, tx, ty;
int da = 0, db = 0, it = 2047, mx, my, bs = 2; int da = 0, db = 0, it = 2047, mx, my, bs = 2;
float nfvx, nfvy; float nfvx, nfvy;
int load_mode=0, load_w=0, load_h=0, load_x=0, load_y=0, load_size=0; int load_mode=0, load_w=0, load_h=0, load_x=0, load_y=0, load_size=0;
@@ -1126,7 +1093,7 @@ int main(int argc, char *argv[])
{ {
for(i=1; i<XRES/CELL; i++) for(i=1; i<XRES/CELL; i++)
{ {
if(bmap[j][i]==11 || bmap[j][i]==2 || (bmap[j][i]==3 && !emap[j][i])) if(bmap[j][i]==1 || bmap[j][i]==8 || (bmap[j][i]==7 && !emap[j][i]))
{ {
vx[j][i] = 0.0f; vx[j][i] = 0.0f;
vx[j][i-1] = 0.0f; vx[j][i-1] = 0.0f;
@@ -1141,7 +1108,7 @@ int main(int argc, char *argv[])
update_air(); update_air();
} }
#ifdef OpenGL #ifdef OpenGL
ClearScreen(); ClearScreen();
#else #else
if(cmode==0 || cmode==1) if(cmode==0 || cmode==1)
{ {
@@ -1158,7 +1125,7 @@ int main(int argc, char *argv[])
} }
#endif #endif
update_particles(vid_buf); update_particles(vid_buf);
draw_parts(vid_buf); draw_parts(vid_buf);
if(cmode==2) if(cmode==2)
{ {
@@ -1212,15 +1179,15 @@ int main(int argc, char *argv[])
break; break;
} }
} }
if(sdl_key=='d' && isplayer) if(sdl_key=='d' && isplayer)
{ {
death = 1; death = 1;
//death = !(death); //death = !(death);
} }
if(sdl_key=='f') if(sdl_key=='f')
{ {
framerender = 1; framerender = 1;
} }
if((sdl_key=='l' || sdl_key=='k') && stamps[0].name[0]) if((sdl_key=='l' || sdl_key=='k') && stamps[0].name[0])
{ {
if(load_mode) if(load_mode)
@@ -1282,60 +1249,60 @@ int main(int argc, char *argv[])
{ {
set_cmode(5); set_cmode(5);
} }
if(sdl_key=='7') if(sdl_key=='7')
{ {
set_cmode(6); set_cmode(6);
} }
if(sdl_key==SDLK_LEFTBRACKET){ if(sdl_key==SDLK_LEFTBRACKET) {
if(sdl_zoom_trig==1) if(sdl_zoom_trig==1)
{ {
ZSIZE -= 1; ZSIZE -= 1;
if(ZSIZE>32) if(ZSIZE>32)
ZSIZE = 32; ZSIZE = 32;
if(ZSIZE<2) if(ZSIZE<2)
ZSIZE = 2; ZSIZE = 2;
ZFACTOR = 256/ZSIZE; ZFACTOR = 256/ZSIZE;
} }
else else
{ {
if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL))
bs -= 1; bs -= 1;
else else
bs -= ceil((bs/5)+0.5f); bs -= ceil((bs/5)+0.5f);
if(bs>1224) if(bs>1224)
bs = 1224; bs = 1224;
if(bs<0) if(bs<0)
bs = 0; bs = 0;
} }
} }
if(sdl_key==SDLK_RIGHTBRACKET){ if(sdl_key==SDLK_RIGHTBRACKET) {
if(sdl_zoom_trig==1) if(sdl_zoom_trig==1)
{ {
ZSIZE += 1; ZSIZE += 1;
if(ZSIZE>32) if(ZSIZE>32)
ZSIZE = 32; ZSIZE = 32;
if(ZSIZE<2) if(ZSIZE<2)
ZSIZE = 2; ZSIZE = 2;
ZFACTOR = 256/ZSIZE; ZFACTOR = 256/ZSIZE;
} }
else else
{ {
if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL))
bs += 1; bs += 1;
else else
bs += ceil((bs/5)+0.5f); bs += ceil((bs/5)+0.5f);
if(bs>1224) if(bs>1224)
bs = 1224; bs = 1224;
if(bs<0) if(bs<0)
bs = 0; bs = 0;
} }
} }
if(sdl_key==SDLK_SPACE) if(sdl_key==SDLK_SPACE)
sys_pause = !sys_pause; sys_pause = !sys_pause;
if(sdl_key=='h') if(sdl_key=='h')
hud_enable = !hud_enable; hud_enable = !hud_enable;
if(sdl_key=='p') if(sdl_key=='p')
dump_frame(vid_buf, XRES, YRES, XRES); dump_frame(vid_buf, XRES, YRES, XRES+BARSIZE);
if(sdl_key=='v'&&(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL))) if(sdl_key=='v'&&(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)))
{ {
if(clipboard_ready==1) if(clipboard_ready==1)
@@ -1394,7 +1361,7 @@ int main(int argc, char *argv[])
if(sdl_key=='v') if(sdl_key=='v')
vs = !vs; vs = !vs;
if(vs) if(vs)
dump_frame(vid_buf, XRES, YRES, XRES); dump_frame(vid_buf, XRES, YRES, XRES+BARSIZE);
#endif #endif
if(sdl_wheel) if(sdl_wheel)
@@ -1441,7 +1408,7 @@ int main(int argc, char *argv[])
active_menu = i; active_menu = i;
} }
} }
menu_ui_v3(vid_buf, active_menu, &sl, &sr, &psr, b, bq, x, y); menu_ui_v3(vid_buf, active_menu, &sl, &sr, b, bq, x, y);
if(zoom_en && x>=sdl_scale*zoom_wx && y>=sdl_scale*zoom_wy if(zoom_en && x>=sdl_scale*zoom_wx && y>=sdl_scale*zoom_wy
&& x<sdl_scale*(zoom_wx+ZFACTOR*ZSIZE) && x<sdl_scale*(zoom_wx+ZFACTOR*ZSIZE)
@@ -1797,7 +1764,7 @@ int main(int argc, char *argv[])
memset(fire_g, 0, sizeof(fire_g)); memset(fire_g, 0, sizeof(fire_g));
memset(fire_b, 0, sizeof(fire_b)); memset(fire_b, 0, sizeof(fire_b));
} }
if(x>=19 && x<=35 && svf_last && svf_open) if(x>=19 && x<=35 && svf_last && svf_open && !bq)
parse_save(svf_last, svf_lsize, 1, 0, 0); parse_save(svf_last, svf_lsize, 1, 0, 0);
if(x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq) if(x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq)
{ {
@@ -1826,7 +1793,7 @@ int main(int argc, char *argv[])
if(lm == 1) if(lm == 1)
{ {
xor_line(lx, ly, x, y, vid_buf); xor_line(lx, ly, x, y, vid_buf);
if(c==127 && lx>=0 && ly>=0 && lx<XRES && ly<YRES && bmap[ly/CELL][lx/CELL]==7) if(c==127 && lx>=0 && ly>=0 && lx<XRES && ly<YRES && bmap[ly/CELL][lx/CELL]==4)
{ {
nfvx = (x-lx)*0.005f; nfvx = (x-lx)*0.005f;
nfvy = (y-ly)*0.005f; nfvy = (y-ly)*0.005f;
@@ -1837,7 +1804,7 @@ int main(int argc, char *argv[])
{ {
fvx[j][i] = nfvx; fvx[j][i] = nfvx;
fvy[j][i] = nfvy; fvy[j][i] = nfvy;
bmap[j][i] = 7; bmap[j][i] = 4;
} }
} }
} }
@@ -1941,7 +1908,7 @@ int main(int argc, char *argv[])
su = c; su = c;
if(lm == 1) if(lm == 1)
{ {
if(c!=127 || lx<0 || ly<0 || lx>=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=7) if(c!=127 || lx<0 || ly<0 || lx>=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=4)
create_line(lx, ly, x, y, bs, c); create_line(lx, ly, x, y, bs, c);
} }
else else
@@ -2081,7 +2048,7 @@ int main(int argc, char *argv[])
{ {
#ifdef BETA #ifdef BETA
sprintf(uitext, "Version %d (Beta %d) FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); sprintf(uitext, "Version %d (Beta %d) FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS);
//printf("%s\n", uitext); //printf("%s\n", uitext);
#else #else
sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS);
#endif #endif
@@ -2110,16 +2077,16 @@ int main(int argc, char *argv[])
fillrect(vid_buf, 12, 12, textwidth(uitext)+8, 15, 0, 0, 0, 140); fillrect(vid_buf, 12, 12, textwidth(uitext)+8, 15, 0, 0, 0, 140);
drawtext(vid_buf, 16, 16, uitext, 32, 216, 255, 200); drawtext(vid_buf, 16, 16, uitext, 32, 216, 255, 200);
} }
sdl_blit(0, 0, XRES+BARSIZE, YRES+MENUSIZE, vid_buf, XRES+BARSIZE); sdl_blit(0, 0, XRES+BARSIZE, YRES+MENUSIZE, vid_buf, XRES+BARSIZE);
//Setting an element for the stick man //Setting an element for the stick man
if(isplayer==0) if(isplayer==0)
{ {
if(ptypes[sr].falldown>0 || sr == PT_NEUT || sr == PT_PHOT) if(ptypes[sr].falldown>0 || sr == PT_NEUT || sr == PT_PHOT)
player[2] = sr; player[2] = sr;
else else
player[2] = PT_DUST; player[2] = PT_DUST;
} }
} }

View File

@@ -1,6 +1,6 @@
// based on public-domain code from Colin Plumb (1993) // based on public-domain code from Colin Plumb (1993)
#include <string.h> #include <string.h>
#include "md5.h" #include <md5.h>
static unsigned getu32(const unsigned char *addr) static unsigned getu32(const unsigned char *addr)
{ {

View File

@@ -219,6 +219,20 @@ void strcaturl(char *dst, char *src)
*d = 0; *d = 0;
} }
void strappend(char *dst, char *src)
{
char *d;
unsigned char *s;
for(d=dst; *d; d++) ;
for(s=(unsigned char *)src; *s; s++)
{
*(d++) = *s;
}
*d = 0;
}
void *file_load(char *fn, int *size) void *file_load(char *fn, int *size)
{ {
FILE *f = fopen(fn, "rb"); FILE *f = fopen(fn, "rb");

File diff suppressed because it is too large Load Diff

View File

@@ -37,7 +37,7 @@
#include <sys/param.h> #include <sys/param.h>
#endif #endif
#include "update.h" #include <update.h>
static char *exe_name(void) static char *exe_name(void)
{ {