From 3959db4c38df2aa2f7fe32f14dbdc9b9a75b5f0e Mon Sep 17 00:00:00 2001 From: Jacob1 Date: Thu, 24 May 2012 10:51:21 -0400 Subject: [PATCH] console doesn't enable hud, fast heat for PUMP/GPMP/ANIM, GPMP activated at draw --- includes/defines.h | 8 -------- src/luaconsole.c | 3 +-- src/main.c | 5 +---- src/powder.c | 32 +++++++++++++++++--------------- 4 files changed, 19 insertions(+), 29 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index bb57b8e39..300884196 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -199,14 +199,6 @@ extern long debug_perf_frametime[DEBUG_PERF_FRAMECOUNT]; extern long debug_perf_partitime[DEBUG_PERF_FRAMECOUNT]; extern long debug_perf_time; -extern int debug_flags; -#define DEBUG_PERF_FRAMECOUNT 256 -extern int debug_perf_istart; -extern int debug_perf_iend; -extern long debug_perf_frametime[DEBUG_PERF_FRAMECOUNT]; -extern long debug_perf_partitime[DEBUG_PERF_FRAMECOUNT]; -extern long debug_perf_time; - extern int active_menu; extern int sys_pause; diff --git a/src/luaconsole.c b/src/luaconsole.c index 92b58bb78..65320cefa 100644 --- a/src/luaconsole.c +++ b/src/luaconsole.c @@ -32,7 +32,6 @@ int tptProperties; //Table for some TPT properties int tptPropertiesVersion; int tptElements; //Table for TPT element names int tptParts, tptPartsMeta, tptElementTransitions, tptPartsCData, tptPartMeta, tptPart, cIndex; -int loop_time = 0; void luacon_open(){ int i = 0, j; char tmpname[12]; @@ -220,7 +219,7 @@ tpt.partsdata = nil"); { lua_el_mode[i] = 0; } - lua_sethook(l, &lua_hook, LUA_MASKCOUNT, 200); + lua_sethook(l, &lua_hook, LUA_MASKCOUNT, 4000000); } #ifndef FFI int luacon_partread(lua_State* l){ diff --git a/src/main.c b/src/main.c index 96f3822b5..c39655b56 100644 --- a/src/main.c +++ b/src/main.c @@ -221,6 +221,7 @@ int frameidx = 0; //int CGOL = 0; //int GSPEED = 1;//causes my .exe to crash.. int sound_enable = 0; +int loop_time = 0; int debug_flags = 0; int debug_perf_istart = 1; @@ -2743,8 +2744,6 @@ int main(int argc, char *argv[]) break; } free(console); - if (!console_mode) - hud_enable = 1; #else char *console; sys_pause = 1; @@ -2757,8 +2756,6 @@ int main(int argc, char *argv[]) break; } free(console); - if (!console_mode) - hud_enable = 1; #endif } diff --git a/src/powder.c b/src/powder.c index da75ee2b2..e3e8c182b 100644 --- a/src/powder.c +++ b/src/powder.c @@ -717,23 +717,25 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a { if (t==SPC_HEAT&&parts[pmap[y][x]>>8].temp>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp + 0.1f, MIN_TEMP, MAX_TEMP); - } else if ((sdl_mod & (KMOD_SHIFT)) && (sdl_mod & (KMOD_CTRL))) { - parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp + 50.0f, MIN_TEMP, MAX_TEMP); - } else { - parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp + 4.0f, MIN_TEMP, MAX_TEMP); - } + float heatchange; + int r = pmap[y][x], fast = ((sdl_mod & (KMOD_SHIFT)) && (sdl_mod & (KMOD_CTRL))); + if ((r&0xFF)==PT_PUMP || (r&0xFF)==PT_GPMP) + heatchange = fast?1.0f:.1f; + else + heatchange = fast?50.0f:4.0f; + + parts[r>>8].temp = restrict_flt(parts[r>>8].temp + heatchange, MIN_TEMP, MAX_TEMP); } if (t==SPC_COOL&&parts[pmap[y][x]>>8].temp>MIN_TEMP) { - if ((pmap[y][x]&0xFF)==PT_PUMP || (pmap[y][x]&0xFF)==PT_GPMP) { - parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 0.1f, MIN_TEMP, MAX_TEMP); - } else if ((sdl_mod & (KMOD_SHIFT)) && (sdl_mod & (KMOD_CTRL))) { - parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 50.0f, MIN_TEMP, MAX_TEMP); - } else { - parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 4.0f, MIN_TEMP, MAX_TEMP); - } + float heatchange; + int r = pmap[y][x], fast = ((sdl_mod & (KMOD_SHIFT)) && (sdl_mod & (KMOD_CTRL))); + if ((r&0xFF)==PT_PUMP || (r&0xFF)==PT_GPMP) + heatchange = fast?1.0f:.1f; + else + heatchange = fast?50.0f:4.0f; + + parts[r>>8].temp = restrict_flt(parts[r>>8].temp - heatchange, MIN_TEMP, MAX_TEMP); } return pmap[y][x]>>8; } @@ -963,7 +965,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a parts[i].tmp = 10; if (t==PT_BRAY) parts[i].life = 30; - if (t==PT_PUMP) + if (t==PT_PUMP || t==PT_GPMP) parts[i].life= 10; if (t==PT_SING) parts[i].life = rand()%50+60;