Am Dienstag, 5. Juni 2007 schrieb [EMAIL PROTECTED]:
> On Tue, 05 Jun 2007 14:51:36 -0400 Dennis Schridde
>
> <[EMAIL PROTECTED]> wrote:
> >> > I say the delay in menu code.  Hit esc, game is pause, it
> >
> >should
> >
> >> > not eat up same CPU cycles as when play game right?
> >>
> >> The solution for this would be the ability to set different
> >
> >framerates
> >
> >> depending on whether we are paused/in a menu or not.
> >
> >PS: Another, probably better idea, would be to leave out as much
> >as possible
> >of the gameLoop...
> >It currently already checks for (paused), but maybe some more
> >things can be
> >ignored... And maybe it can even be optimized?
> >
> >> I don't think the right solution is to sprinkle a few delays
> >
> >here and
> >
> >> there.
>
> Hmm. I like easy approach, which would be, as before.
> When paused, game loops through this over and over, so it is one
> big busy loop.  So you still need a delay to fix.
> Why go make complex code, when add 1 call fix issue?  This only
> hits when user paused.
>
> Index: loop.c
> ===================================================================
> --- loop.c    (revision 1467)
> +++ loop.c    (working copy)
> @@ -508,6 +508,7 @@
>                               }
>                       }
>               }
> +             SDL_Delay(20); //Added to prevent busy loop, and get CPU time
> back when paused!.
>       }
>
>       /* Check for quit */
>
> >> > >> For the other, request  of framerate is defaults, so this
> >
> >is 30?
> >
> >> > >> 60? Is way to tell?   CPU on 2 machines is 2.4GHz dual core
> >
> >duo,
> >
> >> and 2.0GHz turion.  Both have same results of eating all
> >>CPU time.
> >> Even my machine 2.6GHz dual core it eats up too much CPU
> >>time compare to what it was before.
> >>
> >> > >I can reduce the load to 20% user-time on my AthlonXP 2GHz.
> >> >
> >> > How?
> >>
> >> set framerate=20 in ~/.warzone2100/config
>
> ok, defaults is 60.
> Something no right then.  If framerate = 60, and still eat all CPU
> time no matter how fast CPU is?
The code _works_. If Windows spends all time in warzone2100.exe for no reason, 
I can't do anything about it.

--Dennis

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to