DF Gameplay Questions / Re: speed up?
« on: July 09, 2007, 09:53:00 pm »I am just going to post the portion from enablerst::loop of KQ that I changed. In a few days I may figure all the adjustments I need to make to actually patch DF to have a similar change and then it should become much clearer how much the graphics redraw wastes.
Without futher ado:
code:else // If There Are No Messages
{
if (window.isVisible == FALSE) // If Window Is Not Visible
{
WaitMessage (); // Application Is Minimized Wait For A Message
}
else // If Window Is Visible
{
//Sam helped with this section
QueryPerformanceCounter(&qpc2);LARGE_INTEGER effrate;
effrate.QuadPart=qprate.QuadPart;if(qpc.QuadPart+effrate.QuadPart<qpc2.QuadPart||(flag & ENABLERFLAG_MAXFPS))
{
int t;
for(t=0;t<tile>flag|=TILEFLAG_DEAD;
if(tile.size()>0)next_tile_slot=0;
else next_tile_slot=-1;if(mainloop())
{
PostMessage(window.hWnd, WM_QUIT, 0, 0); // Send A WM_QUIT Message
is_program_looping = FALSE; // Stop Looping Of The Program
}
}if(!is_program_looping)continue;
// the continue above effectively blocks this section out when mainloop returns true
// got rid of advanced and put another timing check on the render in here
// the qprate is defined below for 100 FPS, so times 10 to make 10 FPS on the draw
// Have to make seperate variables to handle different speeds cleanly
// everything except the mouse is smooth this way CPU usage is next to nothing
if(qpc.QuadPart+effrate.QuadPart*10<qpc2.QuadPart)
{
render(window);
QueryPerformanceCounter(&qpc);
}if(!(flag & ENABLERFLAG_MAXFPS))Sleep(1);
}
}
} // Loop While isMessagePumpActive == TRUEenabler.remove_textures();
destroy_window_GL (&window); // Destroy The Active Window