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
LFLAGS := -lSDL -lm -lbz2
MFLAGS_SSE3 := -march=k8 -DX86 -DX86_SSE3 -msse3
MFLAGS_SSE2 := -march=k8 -DX86 -DX86_SSE2 -msse2
MFLAGS_SSE := -march=pentium3 -DX86 -DX86_SSE
MFLAGS_SSE3 := -march=native -DX86 -DX86_SSE3 -msse3
MFLAGS_SSE2 := -march=native-DX86 -DX86_SSE2 -msse2
MFLAGS_SSE := -march=native -DX86 -DX86_SSE
FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -O2 -march=k8 -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lbz2
COMPILER := gcc
LINUX_TARG := powder-64-sse2 powder-sse powder-sse2
@ -19,6 +19,7 @@ powder-debug: $(SOURCES)
powder-sse3: $(SOURCES)
$(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN32
strip $@
mv $@ build
powder-sse2: $(SOURCES)
$(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN32
strip $@
@ -31,6 +32,7 @@ powder-64-sse3-opengl: $(SOURCES)
powder-64-sse3: $(SOURCES)
$(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64
strip $@
mv $@ build
powder-64-sse2: $(SOURCES)
$(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN64
strip $@

24
hmap.h

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

@ -49,7 +49,7 @@
#define PT_NITR 8
#define PT_CLNE 9
#define PT_GAS 10
#define PT_C4 11
#define PT_PLEX 11
#define PT_GOO 12
#define PT_ICEI 13
#define PT_METL 14
@ -106,10 +106,15 @@
#define PT_THRM 65
#define PT_GLOW 66
#define PT_BRCK 67
#define PT_FWRK 68
#define PT_PWPO 69
#define PT_PWNE 70
#define PT_NUM 71
#define PT_HFLM 68
#define PT_FIRW 69
#define PT_FUSE 70
#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 MAX_TEMP 9999
@ -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."},
{"DUST", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable."},
{"WATR", PIXPACK(0x2030D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, SC_LIQUID, R_TEMP+-2.0f+273.15f, 29, "Liquid. Conducts electricity. Freezes. Extinguishes fires."},
{"OIL", PIXPACK(0x404010), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 20, 0, 0, 5, 1, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Flammable. 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."},
{"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."},
@ -200,7 +205,7 @@ 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."},
{"C-4", PIXPACK(0xD080E0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 1000, 2, 50, 1, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Solid. Pressure sensitive explosive."},
{"GOO", PIXPACK(0x804000), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 75, "Solid. Deforms and disappears under pressure."},
{"ICE", PIXPACK(0xA0C0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 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."},
{"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."},
@ -227,7 +232,7 @@ static const part_type ptypes[PT_NUM] =
{"LN2", PIXPACK(0x80A0DF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 0, 1, SC_LIQUID, 70.15f, 70, "Liquid Nitrogen. Very cold."},
{"INSL", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 7, 0, 0, 10, 1, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Insulator, does not conduct heat or electricity."},
{"BHOL", PIXPACK(0x202020), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, -0.01f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+70.0f+273.15f, 255, "Black hole, sucks in other particles and heats up."},
{"WHOL", PIXPACK(0xEFEFEF), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.010f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+-16.0f+273.15f, 255, "White hole, pushes other particles away."},
{"WHOL", PIXPACK(0xEFEFEF), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.010f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP-16.0f+273.15f, 255, "White hole, pushes other particles away."},
{"RBDM", PIXPACK(0xCCCCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 1000, 1, 50, 1, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 240, "Rubidium, explosive, especially on contact with water, low melting point"},
{"LRBD", PIXPACK(0xAAAAAA), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000001f* CFDS,2, 1000, 1, 0, 2, 1, SC_EXPLOSIVE, R_TEMP+45.0f+273.15f, 170, "Liquid Rubidium."},
{"NTCT", PIXPACK(0x505040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when hot (More than 100C)"},
@ -235,8 +240,8 @@ static const part_type ptypes[PT_NUM] =
{"GLAS", PIXPACK(0x404040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 150, "Solid. Meltable. Shatters under pressure"},
{"PTCT", PIXPACK(0x405050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when cold (Less than 120C)"},
{"BGLA", PIXPACK(0x606060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Glass, Heavy particles. Meltable. Bagels."},
{"THDR", PIXPACK(0xFFFFA0), 0.0f, 0.00f * CFDS, 1.0f, 0.30f, -0.99f, 0.6f, 0.62f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, SC_ELEC, 9000.0f, 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."},
{"THDR", PIXPACK(0xFFFFA0), 0.0f, 0.00f * CFDS, 1.0f, 0.30f, -0.99f, 0.6f, 0.62f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, SC_ELEC, 9000.0f +273.15f, 251, "Lightning! Very hot, inflicts damage upon most materials, transfers current to metals."},
{"PLSM", PIXPACK(0xBB99FF), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.30f, 0.001f * CFDS, 0, 0, 0, 0, 0, 1, SC_GAS, 9000.0f +273.15f, 115, "Plasma, extremely hot."},
{"ETRD", PIXPACK(0x404040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)"},
{"NICE", PIXPACK(0xC0E0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0005f* CFDS, 0, 0, 0, 0, 20, 1, SC_SOLIDS, 35.0f, 46, "Nitrogen Ice."},
{"NBLE", PIXPACK(0xEB4917), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 106, "Noble Gas. Diffuses. Conductive. Ionizes into plasma when intruduced to electricity"},
@ -244,20 +249,25 @@ static const part_type ptypes[PT_NUM] =
{"LCRY", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Liquid Crystal. Changes colour when charged. (PSCN Charges, NSCN Discharges)"},
{"STKM", PIXPACK(0x000000), 0.5f, 0.00f * CFDS, 0.2f, 1.0f, 0.0f, 0.0f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Stickman. Don't kill him!"},
{"SWCH", PIXPACK(0x103B11), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Only conducts when switched on. (PSCN switches on, NSCN switches off)"},
{"SMKE", PIXPACK(0x222222), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.001f * CFDS, 1, 0, 0, 0, 1, 1, SC_GAS, R_TEMP+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"},
{"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."},
{"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"},
{"COAL", PIXPACK(0x222222), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly."},
{"LO2", PIXPACK(0x80A0EF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 5000, 0, 0, 0, 1, SC_LIQUID, 80.0f, 70, "Liquid Oxygen. Very cold. Reacts with fire"},
{"O2", PIXPACK(0x80A0FF), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 3.0f, 0.000f * CFDS, 0, 1000, 0, 0, 0, 1, SC_GAS, R_TEMP+0.0f +273.15f, 70, "Gas. Ignites easily."},
{"INWR", PIXPACK(0x544141), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Insulated Wire. Doesn't conduct to metal or semiconductors."},
{"YEST", PIXPACK(0xEEE0C0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 15, 0, 0, 30, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Yeast, grows when warm (~37C)."},
{"DYST", PIXPACK(0xBBB0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 20, 0, 0, 30, 0, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Deat Yeast."},
{"THRM", PIXPACK(0xA08090), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 211, "Thermite."},
{"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."},
{"THRM", PIXPACK(0xA08090), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 211, "Thermite. Burns at extremly high temperature."},
{"GLOW", PIXPACK(0x445544), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 2, 1, SC_LIQUID, R_TEMP+20.0f+273.15f, 44, "Glow, Glows under pressure"},
{"BRCK", PIXPACK(0x808080), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Brick, breakable building material."},
{"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"},
{"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"},
{"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"},
{"CFLM", PIXPACK(0x8080FF), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.0005f * CFDS, 1, 0, 0, 0, 1, 1, SC_SPECIAL, 0.0f, 88, "Sub-zero flame."},
{"FIRW", PIXPACK(0xFFA040), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, -0.99f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 70, "Fireworks!"},
{"FUSE", PIXPACK(0x0A5706), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly. Ignites at somewhat high temperatures and electricity."},
{"FSEP", PIXPACK(0x63AD5F), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Fuse Powder. See FUSE."},
{"AMTR", PIXPACK(0x808080), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.00f, 0.10f, 1.00f, 0.0000f * CFDS, 0, 0, 0, 0, 0, 1, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Anti-Matter, Destroys a majority of particles"},
{"BCOL", PIXPACK(0x333333), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Coal. Heavy particles. See COAL"},
{"PCLN", PIXPACK(0x3B3B10), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. When actived, duplicates any particles it touches."},
{"HSWC", PIXPACK(0x3B1010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated"},
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description
};
@ -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},
/* ACID */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* VOID */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* WTRV */ {ST_GAS, PT_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},
/* 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},
/* 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},
/* 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},
@ -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},
/* STKM */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 620.0f},
/* SWCH */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SMKE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SMKE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 625.0f},
/* DESL */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 335.0f},
/* COAL */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* LO2 */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_O2, 90.1f, PT_NONE, 0.0f},
/* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LO2, 90.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* 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},
/* THRM */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* GLOW */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* BRCK */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1223.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* FWRK */ {ST_SOLID, 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},
/* PWNE */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* HFLM */ {ST_GAS, PT_NONE, 0.0f, PT_NONE,0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* FIRW */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE,0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* FUSE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* FSEP */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* AMtr */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* BCOL */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* PCLN */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* HSWC */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
};
static unsigned char can_move[PT_NUM][PT_NUM] =
{
/* A B */
/* A 0 1 | B ligher than A */
/* B 1 0 | A heavier than B */
/* Water | Oil */
/* Water 0 | 1 | Water displaces oil */
/* 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*/
/* 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*/
/* 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*/
/* 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*/
/* 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 */
/* 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 */
/* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0}, /* Watr */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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}, /* BRCK */
/* FRWK */ {0,0,1,1,1,0,0,1,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,1,1,0,1,0,0,0,0}, /* THRM */
/* PWPO */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* PWPO*/
/* PWNE */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* PWNE*/
/* 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*/
/* 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*/
/* 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*/
/* 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*/
/* N D W O F S L G N C G P D I M S S W N P P A V W C D S S D B B P U W M P N L I B W R L H S G C B T P E N N B L S S S D C L O I Y D T G B H F F F A B P H */
/* o u a i i t a u i l a l f c e p n o e l l c o t n s a l m m r h r a W S S N N H H b R S a l s G h l t i B t C T W M e o O 2 N E Y H L R F I U S M C C S */
/* n s t l r n v n t n s e r e t r o o u u n i i r c t l t n t m o a x a c c 2 S o o d b C n a c l d s r c L r r K C K s a X W S S R O C L R S E T O L W */
/* e t r l e e a p r e s x m i l k w d t t t d d v t w t w d l t t n x n n U l l m d N d s n a r m d e E y y M H E l l R T T M W K M W E P R L N C */
/* NONE */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* None */
/* DUST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0}, /* Dust */
/* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0}, /* Watr */
/* OILL */ {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* Oill */
/* FIRE */ {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* Fire */
/* STN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,1,0,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,0,0}, /* FSEP */
/* AMTR */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* AMTR */
/* BCOL */ {0,1,1,1,1,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,1,0,1,1,0,1,1,0,1,0,1,0,0,1,0,0,0,0}, /* BCOL */
/* PCLN */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* PCLN */
/* HSWC */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* HSWC */
/* N D W O F S L G N C G P D I M S S W N P P A V W C D S S D B B P U W M P N L I B W R L H S G C B T P E N N B L S S S D C L O I Y D T G B H F F F A B P H */
/* o u a i i t a u i l a l f c e p n o e l l c o t n s a l m m r h r a W S S N N H H b R S a l s G h l t i B t C T W M e o O 2 N E Y H L R F I U S M C C S */
/* n s t l r n v n t n s e r e t r o o u u n i i r c t l t n t m o a x a c c 2 S o o d b C n a c l d s r c L r r K C K s a X W S S R O C L R S E T O L W */
/* e t r l e e a p r e s x m i l k w d t t t d d v t w t w d l t t n x n n U l l m d N d s n a r m d e E y y M H E l l R T T M W K M W E P R L N C */
};
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 "air.h"
#include "powder.h"
#include "defines.h"
#include <air.h>
#include <powder.h>
#include <defines.h>
float kernel[9];
float vx[YRES/CELL][XRES/CELL], ovx[YRES/CELL][XRES/CELL];
@ -54,15 +54,15 @@ void update_air(void)
vy[y][x] *= VLOSS;
vx[y][x] += dx*TSTEPV;
vy[y][x] += dy*TSTEPV;
if(bmap[y][x]==11 || bmap[y][x+1]==11 ||
bmap[y][x]==2 || bmap[y][x+1]==2 ||
(bmap[y][x]==3 && !emap[y][x]) ||
(bmap[y][x+1]==3 && !emap[y][x+1]))
if(bmap[y][x]==1 || bmap[y][x+1]==1 ||
bmap[y][x]==8 || bmap[y][x+1]==8 ||
(bmap[y][x]==7 && !emap[y][x]) ||
(bmap[y][x+1]==7 && !emap[y][x+1]))
vx[y][x] = 0;
if(bmap[y][x]==11 || bmap[y+1][x]==11 ||
bmap[y][x]==2 || bmap[y+1][x]==2 ||
(bmap[y][x]==3 && !emap[y][x]) ||
(bmap[y+1][x]==3 && !emap[y+1][x]))
if(bmap[y][x]==1 || bmap[y+1][x]==1 ||
bmap[y][x]==8 || bmap[y+1][x]==8 ||
(bmap[y][x]==7 && !emap[y][x]) ||
(bmap[y+1][x]==7 && !emap[y+1][x]))
vy[y][x] = 0;
}
@ -76,9 +76,9 @@ void update_air(void)
for(i=-1; i<2; i++)
if(y+j>0 && y+j<YRES/CELL-1 &&
x+i>0 && x+i<XRES/CELL-1 &&
bmap[y+j][x+i]!=11 &&
bmap[y+j][x+i]!=2 &&
(bmap[y+j][x+i]!=8 || emap[y+j][x+i]))
bmap[y+j][x+i]!=1 &&
bmap[y+j][x+i]!=8 &&
(bmap[y+j][x+i]!=7 || emap[y+j][x+i]))
{
f = kernel[i+1+(j+1)*3];
dx += vx[y+j][x+i]*f;
@ -118,7 +118,7 @@ void update_air(void)
dy += VADV*tx*ty*vy[j+1][i+1];
}
if(bmap[y][x] == 7)
if(bmap[y][x] == 4)
{
dx += fvx[y][x];
dy += fvy[y][x];

View File

@ -12,12 +12,13 @@
#endif
#endif
#include "defines.h"
#include "air.h"
#include "powder.h"
#include "graphics.h"
#include "font.h"
#include "misc.h"
#include <defines.h>
#include <air.h>
#include <powder.h>
#include <graphics.h>
#define INCLUDE_FONTDATA
#include <font.h>
#include <misc.h>
unsigned cmode = 3;
@ -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)
{
if(i==SEC&&SEC!=0)
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)
{
fillrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255);
@ -1420,10 +1417,23 @@ void draw_parts(pixel *vid)
{
if(cmode == 3||cmode==4 || cmode==6)
{
vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors;
cg = 12;
cb = 12;
cr = 12;
cg = 0;
cb = 0;
cr = 0;
for(x=0; x<12; x++) {
cr += (parts[i].ctype >> (x+18)) & 1;
cb += (parts[i].ctype >> x) & 1;
}
for(x=0; x<14; x++)
cg += (parts[i].ctype >> (x+9)) & 1;
x = 624/(cr+cg+cb+1);
cr *= x;
cg *= x;
cb *= x;
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;
y = ny/CELL;
cg += fire_g[y][x];
@ -1457,52 +1467,6 @@ void draw_parts(pixel *vid)
x = nx;
y = ny;
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)
{
@ -1766,7 +1730,40 @@ void draw_parts(pixel *vid)
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;
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);
}
} 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)
{
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;
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);
}
}*/
}
else if(t==PT_LAVA && parts[i].life)
{
@ -1914,7 +2027,7 @@ void draw_parts(pixel *vid)
else
{
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 G = color_data[caddress+1];
uint8 B = color_data[caddress+2];
@ -1950,7 +2063,7 @@ void draw_parts(pixel *vid)
//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 G = PIXG(ptypes[t].pcolors);
@ -2000,9 +2113,9 @@ void render_signs(pixel *vid_buf)
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)
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
sprintf(buff, "Temp: N/A"); //...tempirature
sprintf(buff, "Temp: 0.00"); //...tempirature
drawtext(vid_buf, x+3, y+3, buff, 255, 255, 255, 255);
}
@ -2171,11 +2284,12 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
return NULL;
if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50))
return NULL;
if(c[4]>SAVE_VERSION)
return NULL;
if(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) {
new_format = 1;
}
if(c[4]>SAVE_VERSION)
return NULL;
bw = c[6];
bh = c[7];
w = bw*CELL;

View File

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

View File

@ -4,13 +4,13 @@
#include <bzlib.h>
#include <math.h>
#include <time.h>
#include "http.h"
#include "md5.h"
#include "font.h"
#include "defines.h"
#include "powder.h"
#include "interface.h"
#include "misc.h"
#include <http.h>
#include <md5.h>
#include <font.h>
#include <defines.h>
#include <powder.h>
#include <interface.h>
#include <misc.h>
SDLMod sdl_mod;
int sdl_key, sdl_wheel, sdl_caps=0, sdl_ascii, sdl_zoom_trig=0;
@ -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);
}
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;
my /= sdl_scale;
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;
}
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)))
{
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)
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);
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)
{
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;
}
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)))
{
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)
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);
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)
{
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;
}
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)))
{
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)
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);
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)
{
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;
}
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)))
{
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)
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);
h = n;
@ -1551,18 +1519,10 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq,
{
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)
{
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(sdl_mod & (KMOD_LALT|KMOD_RALT))
{
PSR=h;
*psr=h;
SEC=-1;
}
else
*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(sdl_mod & (KMOD_LALT|KMOD_RALT))
{
PSR=h;
*psr=h;
SEC=-1;
}
else
*sr = h;
}
else if((b==4&&sec>0)&&(sdl_mod & (KMOD_LALT|KMOD_RALT)))
{
SEC = sec;
PSR=-1;
*psr=-1;
}
}
int sdl_poll(void)
@ -1826,7 +1759,7 @@ corrupt:
int search_ui(pixel *vid_buf)
{
int uih=0,nyu,nyd,b=1,bq,mx=0,my=0,mxq=0,myq=0,mmt=0,gi,gj,gx,gy,pos,i,mp,dp,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 thumb_drawn[GRID_X*GRID_Y];
pixel *v_buf = (pixel *)malloc(((YRES+MENUSIZE)*(XRES+BARSIZE))*PIXELSIZE);
@ -2019,6 +1952,7 @@ int search_ui(pixel *vid_buf)
}
mp = dp = -1;
dap = -1;
st = 0;
for(gj=0; gj<GRID_Y; gj++)
for(gi=0; gi<GRID_X; gi++)
@ -2031,7 +1965,7 @@ int search_ui(pixel *vid_buf)
}
else
pos = gi+GRID_X*gj;
if(!search_dates[pos])
if(!search_ids[pos])
break;
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;
@ -2070,10 +2004,16 @@ int search_ui(pixel *vid_buf)
mp = -1;
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);
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);
if(mp==pos && !st)
drawrect(vid_buf, gx-2, gy-2, XRES/GRID_S+3, YRES/GRID_S+3, 160, 160, 192, 255);
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, "\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)
{
sprintf(ts+1, "%d", search_votes[pos]);
@ -2132,6 +2082,7 @@ int search_ui(pixel *vid_buf)
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-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);
@ -2204,6 +2155,11 @@ int search_ui(pixel *vid_buf)
last = NULL;
}
}
if(b && !bq && dap!=-1)
{
sprintf(ed.str, "history:%s", search_ids[dap]);
lasttime = TIMEOUT;
}
if(b && !bq && tp!=-1)
{
@ -2231,7 +2187,7 @@ int search_ui(pixel *vid_buf)
uri = malloc(strlen(search_ids[mp])*3+strlen(search_dates[mp])*3+strlen(SERVER)+71);
strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID=");
strcaturl(uri, search_ids[mp]);
strcaturl(uri, "&Date=");
strappend(uri, "&Date=");
strcaturl(uri, search_dates[mp]);
} else {
uri = malloc(strlen(search_ids[mp])*3+strlen(SERVER)+64);
@ -2449,9 +2405,22 @@ int search_ui(pixel *vid_buf)
thlen = 4;
}
thumb_cache_add(img_id[i], thumb, thlen);
for(pos=0; pos<GRID_X*GRID_Y; pos++)
if(search_ids[pos] && !strcmp(search_ids[pos], img_id[i]))
for(pos=0; pos<GRID_X*GRID_Y; pos++) {
if(search_dates[pos]) {
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)
{
search_thumbs[pos] = thumb;
@ -2476,10 +2445,25 @@ int search_ui(pixel *vid_buf)
}
if(pos<GRID_X*GRID_Y)
{
if(search_dates[pos]) {
char *id_d_temp = malloc(strlen(search_ids[pos])+strlen(search_dates[pos])+1);
uri = malloc(strlen(search_ids[pos])*3+strlen(search_dates[pos])*3+strlen(SERVER)+71);
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);
free(uri);
}
@ -2686,10 +2670,13 @@ int search_results(char *str, int votes)
return i;
*(r++) = 0;
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);

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

@ -37,18 +37,18 @@
#include <unistd.h>
#endif
#include "misc.h"
#include "font.h"
#include "defines.h"
#include "powder.h"
#include "graphics.h"
#include "version.h"
#include "http.h"
#include "md5.h"
#include "update.h"
#include "hmap.h"
#include "air.h"
#include "icon.h"
#include <misc.h>
#include <font.h>
#include <defines.h>
#include <powder.h>
#include <graphics.h>
#include <version.h>
#include <http.h>
#include <md5.h>
#include <update.h>
#include <hmap.h>
#include <air.h>
#include <icon.h>
static const char *it_msg =
"\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 amd = 1;
int FPSB = 0;
int cracker = 1;
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];
for(y=by0; y<by0+bh; y++)
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);
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(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);
if(i<0) i=0;
@ -349,8 +348,10 @@ void *build_save(int *size, int x0, int y0, int w, int h)
i = (p*101+99)/100 + 612;
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
c[0] = 0x50; //0x66;
c[1] = 0x53; //0x75;
c[2] = 0x76; //0x43;
@ -364,7 +365,6 @@ void *build_save(int *size, int x0, int y0, int w, int h)
c[10] = p >> 16;
c[11] = p >> 24;
i -= 12;
if(BZ2_bzBuffToBuffCompress((char *)(c+12), (unsigned *)&i, (char *)d, p, 9, 0, 0) != BZ_OK)
@ -385,6 +385,7 @@ 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 bx0=x0/CELL, by0=y0/CELL, bw, bh, w, h;
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
@ -474,38 +475,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
for(x=bx0; x<bx0+bw; x++)
{
if(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++;
}
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++];
if(j >= PT_NUM)
goto corrupt;
if(j && !(isplayer == 1 && j==PT_STKM))
if(j)// && !(isplayer == 1 && j==PT_STKM))
{
if(pmap[y][x])
{
@ -635,12 +605,10 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
ttv |= (d[p++]);
parts[i-1].temp = ttv;
} else {
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.15;
} else {
parts[i-1].temp = ((d[p++]*((O_MAX_TEMP+(-O_MIN_TEMP))/255))+O_MIN_TEMP)+273;
}
}
else
@ -716,7 +684,6 @@ corrupt:
memset(signs, 0, sizeof(signs));
memset(parts, 0, sizeof(particle)*NPART);
memset(bmap, 0, sizeof(bmap));
}
return 1;
}
@ -1010,7 +977,7 @@ int main(int argc, char *argv[])
#ifdef INTERNAL
int vs = 0;
#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;
float nfvx, nfvy;
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++)
{
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-1] = 0.0f;
@ -1335,7 +1302,7 @@ int main(int argc, char *argv[])
if(sdl_key=='h')
hud_enable = !hud_enable;
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(clipboard_ready==1)
@ -1394,7 +1361,7 @@ int main(int argc, char *argv[])
if(sdl_key=='v')
vs = !vs;
if(vs)
dump_frame(vid_buf, XRES, YRES, XRES);
dump_frame(vid_buf, XRES, YRES, XRES+BARSIZE);
#endif
if(sdl_wheel)
@ -1441,7 +1408,7 @@ int main(int argc, char *argv[])
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
&& 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_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);
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)
{
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;
nfvy = (y-ly)*0.005f;
@ -1837,7 +1804,7 @@ int main(int argc, char *argv[])
{
fvx[j][i] = nfvx;
fvy[j][i] = nfvy;
bmap[j][i] = 7;
bmap[j][i] = 4;
}
}
}
@ -1941,7 +1908,7 @@ int main(int argc, char *argv[])
su = c;
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);
}
else

View File

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

View File

@ -219,6 +219,20 @@ void strcaturl(char *dst, char *src)
*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)
{
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>
#endif
#include "update.h"
#include <update.h>
static char *exe_name(void)
{