どこを直したらいいのでしょうか?
class Cfps{
public:
Cfps(void);
Cfps(int set_fps);
bool proc(int* wait_time , int* now_fps);
private:
int seted_fps;
LONGLONG before;
LONGLONG log[100];
int cnt;
};
Cfps::Cfps(void){
seted_fps=60;
before=GetNowHiPerformanceCount();
for(int i=0;i<100;i++){
log[i]=(int)((double)(1/60)*(double)(1000000));
}
cnt=0;
return;
}
Cfps::Cfps(int set_fps){
seted_fps=set_fps;
before=GetNowHiPerformanceCount();
for(int i=0;i<100;i++){
log[i]=(int)((double)(1/set_fps)*(double)(1000000));
}
cnt=0;
return;
}
bool Cfps::proc(int* wait_time , int* now_fps){
bool draw_flag;
LONGLONG now=GetNowHiPerformanceCount();
LONGLONG past=now-before;
before=now;
int wait=(int)(((double)(1/seted_fps)*(double)(1000))-((double)(past)/(double)(1000)));
if(wait<0){
*wait_time=0;
draw_flag=false;
}else{
*wait_time=wait;
draw_flag=true;
}
log[cnt]=past;
cnt++;
if(cnt>=100) cnt=0;
LONGLONG l=0;
for(int i=0;i<100;i++){
l+=log[i];
}
l/=100;
*now_fps=(int)((double)(1000000)/(double)(l));
return draw_flag;
}