paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/test dblbuffer.cpp,1.1.1.1.6.1,1.1.1.1.6.2


From: Alexander Pipelka <address@hidden>
Subject: [paragui-cvs] CVS: paragui/test dblbuffer.cpp,1.1.1.1.6.1,1.1.1.1.6.2
Date: Mon, 03 Jun 2002 06:21:21 -0400

Update of /cvsroot/paragui/paragui/test
In directory subversions:/tmp/cvs-serv26817/test

Modified Files:
      Tag: devel-1-0
        dblbuffer.cpp 
Log Message:
dblbuffer cleanups



Index: dblbuffer.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/dblbuffer.cpp,v
retrieving revision 1.1.1.1.6.1
retrieving revision 1.1.1.1.6.2
diff -C2 -r1.1.1.1.6.1 -r1.1.1.1.6.2
*** dblbuffer.cpp       3 Jun 2002 09:15:44 -0000       1.1.1.1.6.1
--- dblbuffer.cpp       3 Jun 2002 10:21:19 -0000       1.1.1.1.6.2
***************
*** 9,21 ****
  #include "pgcheckbutton.h"
  
- /*
- #include <cstdio>
- #include <cstdlib>
- #include <cstring>
- #include <cctype>
- 
- #include "SDL.h"
- */
- 
  #include <ctime>
  
--- 9,12 ----
***************
*** 45,49 ****
  {
        /* Load the sprite image */
!       sprite = PG_FileArchive::LoadSurface(file, true);
        if ( sprite == NULL ) {
                PG_LogMSG( "Couldn't load %s: %s", file, SDL_GetError());
--- 36,40 ----
  {
        /* Load the sprite image */
!       sprite = PG_FileArchive::LoadSurface(file, false);
        if ( sprite == NULL ) {
                PG_LogMSG( "Couldn't load %s: %s", file, SDL_GetError());
***************
*** 205,222 ****
        // get the label
        PG_Label* fps = static_cast<PG_Label*>(app.GetWidgetByName("fps"));
-       /*
-       if ( ! screen ) {
-               fprintf( "Couldn't set %dx%d video mode: %s",
-                                       width, height, SDL_GetError());
-               exit(2);
-       }
-       */
  
        screen = app.GetScreen();
  
-       /*
-       screen = SDL_SetVideoMode(width, height, video_bpp, videoflags);
-       */
- 
        /* Load the sprite */
        if ( LoadSprite(screen, "icon.bmp") < 0 ) {
--- 196,202 ----
***************
*** 287,312 ****
        done = 0;
        sprites_visible = 0;
        while ( !done ) {
                /* Check for events */
                ++frames;
                while ( SDL_PollEvent(&event) ) {
-                       /*
-                       switch (event.type) {
-                               case SDL_KEYDOWN:
-                                       // Any keypress quits the app...
-                               case SDL_QUIT:
-                                       done = 1;
-                                       break;
-                               default:
-                                       break;
-                       }
-                       */
                        app.PumpIntoEventQueue(&event);
                }
                now = SDL_GetTicks();
!               if ( now > then ) {
                                fps->SetTextFormat("%2.2f FPS",  
((double)frames*1000)/(now-then));
  
!                               if((now-then) > 2000) {
                                        then = now;
                                        frames=0;
--- 267,283 ----
        done = 0;
        sprites_visible = 0;
+ 
        while ( !done ) {
                /* Check for events */
                ++frames;
+ 
                while ( SDL_PollEvent(&event) ) {
                        app.PumpIntoEventQueue(&event);
                }
                now = SDL_GetTicks();
!               if ( now > then+1000 ) {
                                fps->SetTextFormat("%2.2f FPS",  
((double)frames*1000)/(now-then));
  
!                               if((now-then) > 1000) {
                                        then = now;
                                        frames=0;
***************
*** 327,337 ****
                        PG_Widget::BulkBlit();
                }
                /* Update the screen! */
!               if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
!                       SDL_Flip(screen);
!               } else {
!                       SDL_UpdateRect(screen, 0,0,0,0);
!                       //SDL_UpdateRects(screen, nupdates, sprite_rects);
!               }
        }
        free(mem);
--- 298,304 ----
                        PG_Widget::BulkBlit();
                }
+ 
                /* Update the screen! */
!               SDL_Flip(screen);
        }
        free(mem);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]