Results 1 to 4 of 4

Thread: Whats the matter with....

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    93

    Whats the matter with....

    Code:
    Public Sub LoadSprite(ByRef Sprite As DirectDrawSurface7, File As String, bWidth As Integer, bHeight As Integer, ColourKey As Integer)
    
    Dim CKey As DDCOLORKEY
    Dim ddsdNewSprite As DDSURFACEDESC2
        
        'This routine loads sprites in the FObject file and sets their colour keys
        ddsdNewSprite.lFlags = DDSD_CAPS Or DDSD_WIDTH Or DDSD_HEIGHT           'Set the surface description to include the Capabilities, Width and Height
        ddsdNewSprite.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN                    'Set the surface's capabilities to be an offscreen surface
        ddsdNewSprite.lWidth = bWidth                                           'Set the width of the surface
        ddsdNewSprite.lHeight = bHeight                                         'Set the height of the surface
        THIS? -> Set Sprite = dd.CreateSurfaceFromResource("", File, ddsdNewSprite)      'Load the bitmap from the resource file into the surface using the surface description
        CKey.low = ColourKey                                                    'Set the low value of the colour key
        CKey.high = ColourKey                                                   'and the high value (in this case they're the same because we're not using a range)
        Sprite.SetColorKey DDCKEY_SRCBLT, CKey                                  'Set the sprites colourkey using the key just created
    
    End Sub
    Thanks
    Last edited by LBS; May 9th, 2002 at 01:49 PM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    What error do you get?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    93
    Automation Error

  4. #4
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553

    Automation error

    These automation errors can come up even if there isn't really a error! that error gets me often! i hate it!!!
    HATE AUTOMATION ERROR!
    But, i think the error has something to do with that line...
    ICQ: 128716725

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width