gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/sprite_instance.cpp serv...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog server/sprite_instance.cpp serv...
Date: Sun, 01 Jun 2008 20:37:29 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/06/01 20:37:29

Modified files:
        .              : ChangeLog 
        server         : sprite_instance.cpp 
        server/asobj   : Key.cpp Key.h 
        gui            : gui.cpp gui.h 

Log message:
                * server/asobj/Key.{cpp,h}: small change, lots of rebuilding:
                  any name containing a double underscore is reserved to the
                  implementation, so don't use them even as header guards. Drop
                  bounds assertion before std::bitset, which has its own checks.
                * gui/gui.{cpp,h}: an initial underscore followed by a capital
                  letter is also a reserved identifier. Boost-formatize FPS
                  debugging and use iostreams, not printf. Drop 
GNASH_REPORT_FUNCTION
                  where it's commented out. Use LOG_ONCE.
                * server/sprite_instance.cpp: very minor comment cleanup.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6769&r2=1.6770
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.546&r2=1.547
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Key.cpp?cvsroot=gnash&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Key.h?cvsroot=gnash&r1=1.38&r2=1.39
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.168&r2=1.169
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.h?cvsroot=gnash&r1=1.92&r2=1.93

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6769
retrieving revision 1.6770
diff -u -b -r1.6769 -r1.6770
--- ChangeLog   30 May 2008 20:26:58 -0000      1.6769
+++ ChangeLog   1 Jun 2008 20:37:27 -0000       1.6770
@@ -1,3 +1,16 @@
+2008-06-01 Benjamin Wolsey <address@hidden>
+
+       * server/asobj/Key.{cpp,h}: small change, lots of rebuilding:
+         any name containing a double underscore is reserved to the
+         implementation, so don't use them even as header guards. Drop
+         bounds assertion before std::bitset, which has its own checks.
+       * gui/gui.{cpp,h}: an initial underscore followed by a capital
+         letter is also a reserved identifier. Boost-formatize FPS
+         debugging and use iostreams, not printf. Drop GNASH_REPORT_FUNCTION
+         where it's commented out. Use LOG_ONCE.
+       * server/sprite_instance.cpp: very minor comment cleanup.
+       
+
 2008-05-30 Sandro Santilli <address@hidden>
 
        * gui/Player.{cpp,h}: keep the toplevel movie in an intrusive_ptr

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.546
retrieving revision 1.547
diff -u -b -r1.546 -r1.547
--- server/sprite_instance.cpp  29 May 2008 12:53:44 -0000      1.546
+++ server/sprite_instance.cpp  1 Jun 2008 20:37:28 -0000       1.547
@@ -18,7 +18,7 @@
 //
 
 #ifdef HAVE_CONFIG_H
-#include "gnashconfig.h" // USE_SWFTREE, SIZET_FMT
+#include "gnashconfig.h" // USE_SWFTREE 
 #endif
 
 #include "log.h" 

Index: server/asobj/Key.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Key.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- server/asobj/Key.cpp        29 May 2008 09:22:00 -0000      1.55
+++ server/asobj/Key.cpp        1 Jun 2008 20:37:29 -0000       1.56
@@ -73,8 +73,6 @@
     // we lookup keycode to add to _unreleasedKeys.   
     size_t keycode = key::codeMap[code][key::KEY];
 
-    assert(keycode < _unreleasedKeys.size());
-
     _unreleasedKeys.set(keycode, 1);
 }
 
@@ -91,8 +89,6 @@
     // we lookup keycode to add to _unreleasedKeys.
     size_t keycode = key::codeMap[code][key::KEY];
 
-    assert(keycode < _unreleasedKeys.size());
-
     _unreleasedKeys.set(keycode, 0);
 }
 

Index: server/asobj/Key.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Key.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- server/asobj/Key.h  21 Apr 2008 11:27:44 -0000      1.38
+++ server/asobj/Key.h  1 Jun 2008 20:37:29 -0000       1.39
@@ -17,8 +17,8 @@
 // 
 
 
-#ifndef __KEY_H__
-#define __KEY_H__
+#ifndef HAVE_KEY_H
+#define HAVE_KEY_H
 
 #include "smart_ptr.h" // GNASH_USE_GC
 #include "as_object.h" // for inheritance
@@ -90,6 +90,6 @@
 
 } // end of gnash namespace
 
-// __KEY_H__
+// HAVE_KEY_H
 #endif
 

Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.168
retrieving revision 1.169
diff -u -b -r1.168 -r1.169
--- gui/gui.cpp 19 May 2008 13:03:55 -0000      1.168
+++ gui/gui.cpp 1 Jun 2008 20:37:29 -0000       1.169
@@ -32,6 +32,7 @@
 
 #ifdef GNASH_FPS_DEBUG
 #include "ClockTime.h"
+#include <boost/format.hpp>
 #endif
 
 #include <cstdio>
@@ -109,7 +110,7 @@
     ,_keyboardMouseMovementsStep(1)
 #endif
 {
-//    GNASH_REPORT_FUNCTION;
+
 }
 
 Gui::Gui(unsigned long xid, float scale, bool loop, unsigned int depth)
@@ -154,10 +155,10 @@
 
 Gui::~Gui()
 {
-//    GNASH_REPORT_FUNCTION;
+
     delete _renderer;
 #ifdef GNASH_FPS_DEBUG
-    printf("Total frame advances: %u\n", fps_counter_total);
+    std::cerr << "Total frame advances: " << fps_counter_total << std::endl;
 #endif
 }
 
@@ -176,25 +177,14 @@
 bool
 Gui::showMouse(bool /* show */)
 {
-       static bool warned = false;
-       if (!warned)
-       {
-       log_unimpl(_("Mouse show/hide not yet supported in this GUI"));
-       warned = true;
-       }
-       
+       LOG_ONCE(log_unimpl(_("Mouse show/hide not yet supported in this 
GUI")));
        return true;
 }
 
 void
 Gui::showMenu(bool /* show */)
 {
-       static bool warned = false;
-       if (!warned)
-       {
-       log_unimpl(_("menushow not yet supported in this GUI"));
-       warned = true;
-       }
+       LOG_ONCE(log_unimpl(_("menushow not yet supported in this GUI")));
 }
 
 void
@@ -211,14 +201,9 @@
 void
 Gui::menu_restart()
 {
-//    GNASH_REPORT_FUNCTION;
-
        _stage->reset();
        _started = false;
        start();
-
-       //_stage->restart();
-
 }
 
 void
@@ -413,45 +398,30 @@
 void
 Gui::menu_quit()
 {
-//    GNASH_REPORT_FUNCTION;
     quit();
 }
 
 void
 Gui::menu_play()
 {
-//    GNASH_REPORT_FUNCTION;
-    //get_current_root()->set_play_state(gnash::sprite_instance::PLAY);
     play();
 }
 
 void
 Gui::menu_pause()
 {
-//    GNASH_REPORT_FUNCTION;
-
     pause();
-//    movie_root* m = get_current_root();
-//    if (m->get_play_state() == gnash::sprite_instance::STOP) {
-//      m->set_play_state(gnash::sprite_instance::PLAY);
-//    } else {
-//      m->set_play_state(gnash::sprite_instance::STOP);
-//    }
-
 }
 
 void
 Gui::menu_stop()
 {
-//    GNASH_REPORT_FUNCTION;
-    //get_current_root()->set_play_state(gnash::sprite_instance::STOP);
     stop();
 }
 
 void
 Gui::menu_step_forward()
 {
-//    GNASH_REPORT_FUNCTION;
        movie_root* m = get_current_root();
        m->goto_frame(m->get_current_frame()+1);
 }
@@ -459,8 +429,6 @@
 void
 Gui::menu_step_backward()
 {
-//    GNASH_REPORT_FUNCTION;
-
        movie_root* m = get_current_root();
        m->goto_frame(m->get_current_frame()-1);
 }
@@ -468,8 +436,6 @@
 void
 Gui::menu_jump_forward()
 {
-//    GNASH_REPORT_FUNCTION;
-
        movie_root* m = get_current_root();
        m->goto_frame(m->get_current_frame()+10);
 }
@@ -477,8 +443,6 @@
 void
 Gui::menu_jump_backward()
 {
-//    GNASH_REPORT_FUNCTION;
-
        movie_root* m = get_current_root();
        m->goto_frame(m->get_current_frame()-10);
 }
@@ -486,7 +450,7 @@
 void
 Gui::menu_toggle_sound()
 {
-//    GNASH_REPORT_FUNCTION;
+
     media::sound_handler* s = get_sound_handler();
 
     if (!s)
@@ -906,7 +870,7 @@
 
     if ( ! _started ) start();
   
-//     GNASH_REPORT_FUNCTION;
+
 
 #ifdef SKIP_RENDERING_IF_LATE
        WallClockTimer advanceTimer;
@@ -1137,7 +1101,6 @@
 void 
 Gui::fpsCounterTick()
 {
-  // GNASH_REPORT_FUNCTION;
 
   // increment this *before* the early return so that
   // frame count on exit is still valid
@@ -1172,7 +1135,7 @@
       // the timers are unsigned, so when the clock runs "backwards" it leads
       // to a very high difference value. In theory, this should never happen
       // with ticks, but it does on my machine (which may have a hw problem?).
-      printf("Time glich detected, need to restart FPS counters, sorry...\n");
+      std::cerr << "Time glitch detected, need to restart FPS counters, 
sorry..." << std::endl;
       
       fps_timer = current_timer;
       fps_start_timer = current_timer;
@@ -1193,9 +1156,11 @@
     float avg = fps_counter_total / secs_total; 
   
     //log_debug("Effective frame rate: %0.2f fps", (float)(fps_counter/secs));
-    printf("Effective frame rate: %0.2f fps (min %0.2f, avg %0.2f, max %0.2f, "
-      "%u frames in %0.1f secs total)\n", rate, fps_rate_min, avg, 
fps_rate_max,
-      fps_counter_total, secs_total);
+    std::cerr << boost::format("Effective frame rate: %0.2f fps "
+                               "(min %0.2f, avg %0.2f, max %0.2f, "
+                               "%u frames in %0.1f secs total)") % rate %
+                               fps_rate_min % avg % fps_rate_max %
+                               fps_counter_total % secs_total << std::endl;
       
     fps_counter = 0;
     fps_timer = current_timer;

Index: gui/gui.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.h,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -b -r1.92 -r1.93
--- gui/gui.h   2 May 2008 14:53:42 -0000       1.92
+++ gui/gui.h   1 Jun 2008 20:37:29 -0000       1.93
@@ -15,8 +15,8 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-#ifndef _GUI_H_
-#define _GUI_H_
+#ifndef HAVE_GUI_H
+#define HAVE_GUI_H
 
 #ifdef HAVE_CONFIG_H
 #include "gnashconfig.h"
@@ -34,6 +34,10 @@
 #include <string>
 #include <map>
 
+// Define this to enable fps debugging without touching
+// gnashconfig.h
+//#define GNASH_FPS_DEBUG
+
 // Define the following macro if you want to skip rendering
 // when late on FPS time.
 // This is an experimental feature, so it's off by default




reply via email to

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