Hi there,

Jim, are you using CS/CEL 1.4? If so, probably you have the same
problem that I had. Caedes wrote a patch to fix that, but I think the
changes from it were only commit to trunk and not 1.4. I append the
patch to this mail. Hope it helps.

Cheers

2008/9/17 Jorrit Tyberghein <[EMAIL PROTECTED]>:
> What kind of image is it that you're drawing on the screen? Is it a
> power of two?
> Does it contain transparency? I think you should avoid a big single 
> screen-size
> image that has transparency. Better to work with smaller HUD images instead.
>
>
> Greetings,
>
> On Wed, Sep 17, 2008 at 6:33 AM, Jim Sager <[EMAIL PROTECTED]> wrote:
>> I copy/pasted the code from Walktest to show pixmaps. If I draw on the
>> entire screen every frame, it slows things down horribly.
>>
>> If you want an example, try:
>> http://rapidshare.com/files/145329460/xyzim.zip.html
>>
>> Hit f6 a few times and as the windows pop up, the Frames Per Second drop
>> sharply.
>>
>> I want to use a HUD, but I don't want to lose noticeable amounts of Frames
>> Per Second.
>>
>> I also have a mainly 2d program that I have on the back burner.  I'd really
>> like to use CRYSTALSPACE with it because I am familiar with the library.
>>
>> Thank you for reading,
>> Jim
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Crystal-main mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/crystal-main
>> Unsubscribe:
>> mailto:[EMAIL PROTECTED]
>>
>>
>
>
>
> --
> Project Manager of Crystal Space (http://www.crystalspace3d.org)
> and CEL (http://cel.crystalspace3d.org)
> Support Crystal Space. Donate at
> https://sourceforge.net/donate/index.php?group_id=649
> Visit my town at http://waldir.myminicity.com/
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Crystal-main mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/crystal-main
> Unsubscribe: mailto:[EMAIL PROTECTED]
>
Index: plugins/tools/billboard/billboard.h
===================================================================
--- plugins/tools/billboard/billboard.h	(revision 3597)
+++ plugins/tools/billboard/billboard.h	(working copy)
@@ -304,6 +304,12 @@
   int default_bg_color;
 
   csEventID CanvasResize;
+  csEventID PreProcess;
+  csEventID PostProcess;
+  csEventID MouseUp;
+  csEventID MouseDown;
+  csEventID MouseMove;
+  csEventID MouseDoubleClick;
 
 public:
   csRef<iEngine> engine;
Index: plugins/tools/billboard/billboard.cpp
===================================================================
--- plugins/tools/billboard/billboard.cpp	(revision 3597)
+++ plugins/tools/billboard/billboard.cpp	(working copy)
@@ -710,10 +710,12 @@
 
   int fw = g3d->GetWidth ();
   int fh = g3d->GetHeight ();
+  //printf("celBillboard::Draw w:%d h:%d\n",fw,fh);
   csRect r;
   GetRect (r);
   if (r.xmax <= 0 || r.xmin >= fw-1) return;
   if (r.ymax <= 0 || r.ymin >= fh-1) return;
+  //printf("celBillboard::Draw xmin:%d xmax:%d ymin:%d ymax:%d\n",fw,fh,r.xmin,r.xmax,r.ymin,r.ymax);
 
   SetupMaterial ();
   if (!material) return;
@@ -885,6 +887,12 @@
   vc = csQueryRegistry<iVirtualClock> (object_reg);
   name_reg = csEventNameRegistry::GetRegistry (object_reg);
   CanvasResize = csevCanvasResize (name_reg, g3d->GetDriver2D ());
+  PreProcess = csevPreProcess(object_reg);
+  PostProcess = csevPostProcess(object_reg);
+  MouseUp = csevMouseUp(name_reg,0);
+  MouseDown = csevMouseDown(name_reg,0);
+  MouseMove = csevMouseMove(name_reg,0);
+  MouseDoubleClick = csevMouseDoubleClick(name_reg,0);
 
   scfiEventHandler = new EventHandler (this);
   csRef<iEventQueue> q = csQueryRegistry<iEventQueue> (object_reg);
@@ -1055,11 +1063,11 @@
     screen_w_fact = BSX / g3d->GetWidth ();
     screen_h_fact = BSY / g3d->GetHeight ();
   }
-  else if (ev.Name == csevPreProcess (object_reg))
+  else if (ev.Name == PreProcess)
   {
     HandleMovingBillboards (vc->GetElapsedTicks ());
   }
-  else if (ev.Name == csevPostProcess (object_reg))
+  else if (ev.Name == PostProcess)
   {
     if (billboards.GetSize () > 0)
     {
@@ -1074,10 +1082,17 @@
       g3d->SetWorldToCamera (csReversibleTransform ());
       for (i = 0 ; i < billboards.GetSize () ; i++)
       {
-	celBillboard* bb = billboards[i];
+	celBillboard *bb = billboards[i];
+        bb->Draw (g3d, z);
+	z -= dz;
+      }
+      mesh_draw (g3d);
+      g3d->BeginDraw (CSDRAW_2DGRAPHICS);
+      for (i = 0 ; i < billboards.GetSize () ; i++)
+      {
+	celBillboard *bb = billboards[i];
 	if (bb->flags.Check (CEL_BILLBOARD_VISIBLE))
 	{
-          bb->Draw (g3d, z);
 	  const char* t = bb->GetText ();
 	  if (t)
 	  {
@@ -1085,8 +1100,7 @@
 	    if (!font) font = default_font;
 	    if (font)
 	    {
-	      mesh_draw (g3d);
-	      g3d->BeginDraw (CSDRAW_2DGRAPHICS);
+	      // mesh_draw (g3d);
 	      csRect r;
 	      bb->GetRect (r);
               int text_dx = bb->GetTextDX ();
@@ -1099,16 +1113,15 @@
 	      g3d->GetDriver2D ()->Write (font,
 			r.xmin+text_dx, r.ymin+text_dy,
 			fg, bg, t);
-	      g3d->BeginDraw (CSDRAW_3DGRAPHICS);
 	    }
 	  }
 	}
-	z -= dz;
       }
-      mesh_draw (g3d);
+      g3d->BeginDraw (CSDRAW_3DGRAPHICS);
+
     }
   }
-  else if (ev.Name == csevMouseUp (name_reg, 0))
+  else if (ev.Name == MouseUp)
   {
     if (moving_billboard)
     {
@@ -1126,7 +1139,7 @@
 	  	csMouseEventHelper::GetX(&ev), csMouseEventHelper::GetY(&ev), 
 		csMouseEventHelper::GetButton(&ev));
   }
-  else if (ev.Name == csevMouseDown (name_reg, 0))
+  else if (ev.Name == MouseDown)
   {
     celBillboard* bb = FindBillboard (csMouseEventHelper::GetX(&ev), 
 					  csMouseEventHelper::GetY(&ev),
@@ -1151,7 +1164,7 @@
 			       csMouseEventHelper::GetButton(&ev));
     }
   }
-  else if (ev.Name == csevMouseMove (name_reg, 0))
+  else if (ev.Name == MouseMove)
   {
     if (moving_billboard)
     {
@@ -1180,7 +1193,7 @@
 			     csMouseEventHelper::GetButton(&ev));
     }
   }
-  else if (ev.Name == csevMouseDoubleClick (name_reg, 0))
+  else if (ev.Name == MouseDoubleClick)
   {
     celBillboard* bb = FindBillboard (csMouseEventHelper::GetX(&ev),
 					  csMouseEventHelper::GetY(&ev),
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to