diff options
| author | Jacob1 <jfu614@gmail.com> | 2012-05-24 14:51:21 (GMT) |
|---|---|---|
| committer | Jacob1 <jfu614@gmail.com> | 2012-05-24 14:51:21 (GMT) |
| commit | 3959db4c38df2aa2f7fe32f14dbdc9b9a75b5f0e (patch) | |
| tree | 9b758d1b166a5132fe07a8dc4f9eb9def2cf8334 /src | |
| parent | 1c7fdb0c26d8bca5a1cb13a790090b87c3d809aa (diff) | |
| download | powder-3959db4c38df2aa2f7fe32f14dbdc9b9a75b5f0e.zip powder-3959db4c38df2aa2f7fe32f14dbdc9b9a75b5f0e.tar.gz | |
console doesn't enable hud, fast heat for PUMP/GPMP/ANIM, GPMP activated at draw
Diffstat (limited to 'src')
| -rw-r--r-- | src/luaconsole.c | 3 | ||||
| -rw-r--r-- | src/main.c | 5 | ||||
| -rw-r--r-- | src/powder.c | 32 |
3 files changed, 19 insertions, 21 deletions
diff --git a/src/luaconsole.c b/src/luaconsole.c index 92b58bb..65320ce 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){ @@ -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 da75ee2..e3e8c18 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<MAX_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); } 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; |
