[futurebasic] [FB]Speeding up code

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

From: "Jagwio" <wrileyla@...>
Date: Sat, 31 Oct 1998 14:11:59 -0600 (CST)
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?

'----start code----

LOCAL FN offScreen
  CALL GETGWORLD(oldGWorld&,oldDevice&)
  CALL SETGWORLD(gWorld&,0)
END FN

LOCAL FN onScreen
  CALL SETGWORLD(oldGWorld&,oldDevice&)
END FN

LOCAL FN drawGuy
  CALL COPYBITS(#gWorld2&+2,#wPtr&+2,guyR,guyC,_transparent,0)
END FN

LOCAL FN cobit
  CALL 
COPYBITS(#gWorld&+2,#wPtr&+2,#gWorld&+_portRect,#wPtr&+_portRect,_srccopy,0)
END FN

LOCAL FN cicn(horz,vert,id%)
  CALL SETRECT(rect,horz,vert,horz+32,vert+32)
  myPICT& = FN GETPICTURE(id%)
  LONG IF gWorld&>0 AND myPICT&>0
    CALL DRAWPICTURE(myPICT&, rect)
  END IF
END FN


LOCAL FN displayMap
  FN offScreen
  FOR t=0 TO 9
    z=t*32
    c=t+x
    FOR g=0 TO 9
      FN cicn(g*32,z,map(c,g+y)+129)
    NEXT g
  NEXT t
  FN onscreen
  FN cobit
  FN drawGuy
END FN
'----End Code----

P.S.  Happy Halloween, mwa ha ha ha ha!