[futurebasic] Re: [FB]Speeding up code

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

From: Derek Smith <dereksmi@...>
Date: Sat, 31 Oct 1998 14:11:48 -1000
On Sat, 31 Oct 1998, jonathan wrote:

> >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?

Get rid of that DRAWPICTURE call.  That is where the bottleneck is.  I
would suggest a different way to store your graphics.  Instead of
individual PICT resources, line them all up in one single graphic resource
with ClarisWorks or SuperPaint in a 10x10 grid (or however many graphics
you have)  So if you are using 32x32 cicns, make a 320x320 grid to hold
all your graphics and line up all the cicns by their ID numbers.

Then at startup as Jonathan said, make a GWorld and draw this large PICT
into it.  Now, whenever you need to call Drawpicture, call COPYBITS with
this larger GWrold as the source, you game GWorld as the destination and
use a rectangle of the source cicn in the large GWorld and the normal
destination GWorld.

It takes a bit of trying to line everything up right, but the speedup is
immense.

-Derek
----------------
http://www2.hawaii.edu/~dereksmi
----------------