Big buffer

This commit is contained in:
jl777
2019-02-20 20:33:13 -11:00
parent 5280af8c12
commit 0594b52df2
5 changed files with 25 additions and 2 deletions

10
.gitignore vendored
View File

@@ -132,3 +132,13 @@ src/cc/rogue/rogue
src/cc/rogue/rogue.so src/cc/rogue/rogue.so
src/cc/rogue/test.zip src/cc/rogue/test.zip
src/rogue.530623577502174316.0
src/rogue.530623577502174316.pack
src/rogue.530623577502174316.player
src/checkfile
src/log

View File

@@ -34,6 +34,7 @@ void restore_player(struct rogue_state *rs)
int32_t i,total = 0; THING *obj; int32_t i,total = 0; THING *obj;
//rs->P.gold = purse; //rs->P.gold = purse;
max_hp = rs->P.hitpoints; max_hp = rs->P.hitpoints;
//pstats.s_hpt = max_hp;
pstats.s_str = rs->P.strength & 0xffff; pstats.s_str = rs->P.strength & 0xffff;
if ( (max_stats.s_str= (rs->P.strength >> 16) & 0xffff) == 0 ) if ( (max_stats.s_str= (rs->P.strength >> 16) & 0xffff) == 0 )
max_stats.s_str = 16; max_stats.s_str = 16;

View File

@@ -160,6 +160,18 @@ readchar(struct rogue_state *rs)
if ( rs->ind < rs->numkeys ) if ( rs->ind < rs->numkeys )
{ {
c = rs->keystrokes[rs->ind++]; c = rs->keystrokes[rs->ind++];
if ( 0 )
{
static FILE *fp; static int32_t counter;
if ( fp == 0 )
fp = fopen("log","wb");
if ( fp != 0 )
{
fprintf(fp,"%d: (%c) hp.%d\n",counter,c,pstats.s_hpt);
fflush(fp);
counter++;
}
}
while ( c == 'Q' && rs->ind < rs->numkeys ) while ( c == 'Q' && rs->ind < rs->numkeys )
{ {
//fprintf(stderr,"Got 'Q' next (%c)\n",rs->keystrokes[rs->ind]); sleep(2); //fprintf(stderr,"Got 'Q' next (%c)\n",rs->keystrokes[rs->ind]); sleep(2);

View File

@@ -238,7 +238,7 @@ death(struct rogue_state *rs,char monst)
//struct tm *localtime(const time_t *); //struct tm *localtime(const time_t *);
if ( rs->guiflag == 0 ) if ( rs->guiflag == 0 )
{ {
fprintf(stderr,"death during replay\n"); fprintf(stderr,"death during replay by (%c)\n",monst); //sleep(3);
rs->replaydone = (uint32_t)time(NULL); rs->replaydone = (uint32_t)time(NULL);
return; return;
} }

View File

@@ -607,7 +607,7 @@ playit(struct rogue_state *rs)
} }
else else
{ {
if ( rs->needflush != 0 && rs->num > 1024 ) if ( rs->needflush != 0 && rs->num > 8000 )
{ {
if ( flushkeystrokes(rs) == 0 ) if ( flushkeystrokes(rs) == 0 )
rs->needflush = 0; rs->needflush = 0;