[futurebasic] Re: [FB]Speeding up code

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1998 : Group Archive : Group : All Groups

From: jonathan <jonathan@...>
Date: Dim, 1 Nov 98 00:41:58 +0100
>Is there anyone who could help me make this code faster?  It is draws a 
>portion 
>of a map into a GWorld and then copies it over to the window, it's just 
>reeeal 
>slow!  (maybe it's my computer, Performa 550)  But stuff like Realmz does 
>this 
>kind of stuff reather quickly, what am I missing?

[snip]

Although, as one wise list member pointed out, your
machine may be a trifle slooooow, there are probably
ways you can hasten things, a little.

* Create a GWorld at startup, and don't kill it til
the end. This way you won't get the overhead of building/killing
in each cycle.
* There's supposed to be a way, thru twiddling palettes/cluts,
to force the Mac _not_ to check if the screen and the Gworld
are using the same palette (in 256 colors, which I imagine that
you are using anyway, for speed). Personnally I have never got
this to work, but someone else might have been there...
* Instead of copying lots of small rects, it's quicker to try
and group them into long horizontal rects, and then copy that.
(You may already be doing that, as your code is just a sample loop)
* There is also the question of aligning on, I believe, 4 byte
boudaries, that hastens things, but as you're copying a 32 bit
long rect, that would already seem to be the case.

HTH
jonathan

-------------------------------------------------------------
! "format utile"  studio de graphisme/graphic design studio !
!      32 bd de Menilmontant, 75020 Paris, France           !
!    phone +33 1 43 49 02 04 +++ fax +33 1 43 49 16 51      !
-------------------------------------------------------------
           *** coming soon to a browser near you ***
           <http://www.cybercities.com/formatutile>
-------------------------------------------------------------