Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: speed up?  (Read 854 times)

Jothki

  • Bay Watcher
    • View Profile
Re: speed up?
« Reply #15 on: July 09, 2007, 08:25:00 am »

It's fairly likely that the redraw time is irrelevent, though. Even if the computation and rendering are seperated out, that just means that the game will render 60 fps while actually running at far less than that.
Logged

Veroule

  • Bay Watcher
    • View Profile
Re: speed up?
« Reply #16 on: July 09, 2007, 09:53:00 pm »

I am not quite going to let this one go.  I ran DF through my debugger and coordinated enough stuff to see that the changes from the Kobold Quest code are pretty minor.

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 == TRUE

         enabler.remove_textures();

         destroy_window_GL (&window);                           // Destroy The Active Window


Logged
"Please, spare us additional torture; and just euthanise yourselves."
Delivered by Tim Curry of Clue as a parody of the lead ass from American Idol in the show Psych.
Pages: 1 [2]