Re: [Celestia-developers] windows capture video fix?
Real-time 3D visualization of space
Status: Beta
Brought to you by:
cjlaurel
From: Chris L. <cl...@gm...> - 2009-08-30 17:41:25
|
Steve, I'll be away from my computer until tonight. After that, I can take a look at the change you've made. I changed the text drawing functions slightly a few weeks ago--they'd been updating the OpenGL transformation matrix every time a character was drawn, which is very inefficient when a lot of characters are drawn. Obviously, the code to draw the video recording text was missed in the update. --Chris On Sun, Aug 30, 2009 at 8:50 AM, Steve Popovich <car...@ya...> wrote: > OK, > This will be my last attempt at this. Notice that line 178 is commented > out. It is not even needed. It's not 100% but it does look expectable for > now. The only problem I can see is the line at the bottom of the red > rectangle is offset by a few spaces but it is always in the confines of the > rectangle. It used to be completely left justified but now it is a few > spaces in. Still, x and y offsets could be causing problems elsewhere that > hasn't been seen yet. > > > Index: celestia/src/celengine/overlay.h > =================================================================== > --- celestia/src/celengine/overlay.h (revision 4863) > +++ celestia/src/celengine/overlay.h (working copy) > @@ -15,7 +15,6 @@ > #include <cstdio> > #include <celtxf/texturefont.h> > > - > class Overlay; > > // Custom streambuf class to support C++ operator style output. The > @@ -77,6 +76,7 @@ > int windowHeight; > TextureFont* font; > bool useTexture; > + bool useRect; > bool fontChanged; > int textBlock; > > Index: celestia/src/celengine/overlay.cpp > =================================================================== > --- celestia/src/celengine/overlay.cpp (revision 4863) > +++ celestia/src/celengine/overlay.cpp (working copy) > @@ -24,6 +24,7 @@ > windowHeight(1), > font(NULL), > useTexture(false), > + useRect(false), > fontChanged(false), > textBlock(0), > xoffset(0.0f), > @@ -83,6 +84,7 @@ > > void Overlay::beginText() > { > + xoffset = 0.0f; > glPushMatrix(); > textBlock++; > } > @@ -173,6 +175,7 @@ > i += UTF8EncodedSize(ch); > print(ch); > } > +// xoffset = 0.0f; > } > > > @@ -180,21 +183,24 @@ > { > va_list args; > va_start(args, format); > - > + if (useRect) > + { > + xoffset = 0.0f; > + useRect = false; > + } > char buf[1024]; > vsprintf(buf, format, args); > print(buf); > - > va_end(args); > } > > - > void Overlay::rect(float x, float y, float w, float h, bool fill) > { > if (useTexture) > { > glDisable(GL_TEXTURE_2D); > useTexture = false; > + useRect = true; > } > > if (fill) > > > Steve > > --- On *Sun, 8/30/09, Steve Popovich <car...@ya...>* wrote: > > > From: Steve Popovich <car...@ya...> > Subject: Re: [Celestia-developers] windows capture video fix? > To: "vincent" <vin...@fr...> > Cc: cel...@li... > Date: Sunday, August 30, 2009, 10:34 AM > > > I seen a problem this morning with my second attempt at fixing this. When > increasing time, the display for time speed is partially overwritten. The > first email I sent on this subject has a zip file attached that should work > even though it's a hack. There needs to be a better way of keeping track of > these x and y offsets that Chris introduced a few weeks ago. > Steve > > --- On *Sat, 8/29/09, Steve Popovich <car...@ya...>* wrote: > > > From: Steve Popovich <car...@ya...> > Subject: Re: [Celestia-developers] windows capture video fix? > To: "vincent" <vin...@fr...> > Cc: cel...@li... > Date: Saturday, August 29, 2009, 11:57 PM > > Vincent, > Sorry about the last patch. It works but it's a real hack. > This looks much better and works too. > > Index: celestia/src/celengine/overlay.h > =================================================================== > --- celestia/src/celengine/overlay.h (revision 4863) > +++ celestia/src/celengine/overlay.h (working copy) > @@ -15,7 +15,6 @@ > #include <cstdio> > #include <celtxf/texturefont.h> > > - > class Overlay; > > // Custom streambuf class to support C++ operator style output. The > @@ -77,6 +76,7 @@ > int windowHeight; > TextureFont* font; > bool useTexture; > + bool useRect; > bool fontChanged; > int textBlock; > > Index: celestia/src/celengine/overlay.cpp > =================================================================== > --- celestia/src/celengine/overlay.cpp (revision 4863) > +++ celestia/src/celengine/overlay.cpp (working copy) > @@ -24,6 +24,7 @@ > windowHeight(1), > font(NULL), > useTexture(false), > + useRect(false), > fontChanged(false), > textBlock(0), > xoffset(0.0f), > @@ -83,6 +84,7 @@ > > void Overlay::beginText() > { > + xoffset = 0.0f; > glPushMatrix(); > textBlock++; > } > @@ -173,6 +175,7 @@ > i += UTF8EncodedSize(ch); > print(ch); > } > + xoffset = 0.0f; > } > > > @@ -180,21 +183,24 @@ > { > va_list args; > va_start(args, format); > - > + if (useRect) > + { > + xoffset = 0.0f; > + useRect = false; > + } > char buf[1024]; > vsprintf(buf, format, args); > print(buf); > - > va_end(args); > } > > - > void Overlay::rect(float x, float y, float w, float h, bool fill) > { > if (useTexture) > { > glDisable(GL_TEXTURE_2D); > useTexture = false; > + useRect = true; > } > > if (fill) > > Steve > > --- On *Sat, 8/29/09, Steve Popovich <car...@ya...>* wrote: > > > From: Steve Popovich <car...@ya...> > Subject: [Celestia-developers] windows capture video fix? > To: "vincent" <vin...@fr...> > Cc: cel...@li... > Date: Saturday, August 29, 2009, 11:02 PM > > Vincent, > This seems to work on QT4 Theora. There were 2 problems. One was the date > was shifted to the right when the red rectangle was displayed. The second > was the timer. The only way to fix the timer was to duplicate, then rename > oprintf to oprint and put a line to set the xoffset = 0.0f. I also had to > add a xoffset = 0.0f to beginText. This stopped the date from shifting when > the red rectangle was drawn. Then celestiacore calls oprint when displaying > the timer. The reason I had to duplicate it was that oprintf was used to > display the Terse info at the top left main window. A xoffset = 0.0f caused > the info to over right the lables. To sum up this is what I did. See zip > file. > Steve > > > > -----Inline Attachment Follows----- > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > -----Inline Attachment Follows----- > > _______________________________________________ > Celestia-developers mailing list > Cel...@li... > https://lists.sourceforge.net/lists/listinfo/celestia-developers > > > > -----Inline Attachment Follows----- > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > -----Inline Attachment Follows----- > > _______________________________________________ > Celestia-developers mailing list > Cel...@li... > https://lists.sourceforge.net/lists/listinfo/celestia-developers > > > > -----Inline Attachment Follows----- > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > -----Inline Attachment Follows----- > > _______________________________________________ > Celestia-developers mailing list > Cel...@li...<http://mc/compose?to=Cel...@li...> > https://lists.sourceforge.net/lists/listinfo/celestia-developers > > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Celestia-developers mailing list > Cel...@li... > https://lists.sourceforge.net/lists/listinfo/celestia-developers > > |