もしかして・・・
Posted: 2009年6月07日(日) 11:26
龍神録の館43章の・・・ fprintf(fp,"%d:%d\n",fps_count,term);のfpって
どこに宣言されているのでしょうか?
どこに宣言されているのでしょうか?
void fps_wait(){
int term,i,gnt;
static int t=0;
static FILE *fp=fopen("txt.txt","w");
if(fps_count==0){//60フレームの1回目なら
if(t==0)//完全に最初ならまたない
term=0;
else//前回記録した時間を元に計算
term=count0t+1000-GetNowCount();
}
else //待つべき時間=現在あるべき時刻-現在の時刻
term = (int)(count0t+fps_count*(1000.0/FLAME))-GetNowCount();
fprintf(fp,"%d:%d\n",fps_count,term);
if(fps_count==600)
fclose(fp);
if(term>0)//待つべき時間だけ待つ
Sleep(term);
gnt=GetNowCount();
if(fps_count==0)//60フレームに1度基準を作る
count0t=gnt;
f[fps_count]=gnt-t;//1周した時間を記録
t=gnt;
//平均計算
if(fps_count==FLAME-1){
ave=0;
for(i=0;i<FLAME;i++)
ave+=f;
ave/=FLAME;
}
fps_count = (++fps_count)%FLAME ;
}