Results 1 to 8 of 8

Thread: isometric tile metrics

  1. #1

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    isometric tile metrics

    Public Function DrawLayer(DDSDest As cSurface, DDSTiles As cSurface, Layer As LayerEnum) As Boolean
    #If APP_RELEASE Then
    On Error GoTo Err:
    #End If
    Dim L As Long
    Dim X As Long
    Dim Y As Long
    Dim oRect As RECT

    For L = 0 To LayerMax
    For X = 0 To Header.Width
    For Y = 0 To Header.Height
    Let oRect.Left = Tiles(L, X, Y).ResourceX * TILE_WIDTH
    Let oRect.Right = oRect.Left + TILE_WIDTH
    Let oRect.Top = Tiles(L, X, Y).ResourceY * TILE_HEIGHT
    Let oRect.Bottom = oRect.Top + TILE_HEIGHT

    Call DDSTiles.BlitFast(DDSDest, X * TILE_WIDTH + (Y And 2) * (TILE_WIDTH / 2), Y * (BASE_HEIGHT / 2 + 2) - (TILE_HEIGHT - BASE_HEIGHT), oRect)
    Next Y
    Next X
    Next L

    DrawLayer = True
    Err:
    End Function

    doesnt seem to work it only draws one tile with larger sized maps.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    doesnt seem to work it
    Bummer.

    So what is your Visual Basic question?

  3. #3

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206
    never mind its not the problem... i wont even draw with working calc...

  4. #4

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206
    i found where the problem is. the header.width and height wont change

    VB Code:
    1. Public Function Resize(Optional Width = -1, Optional Height = -1) As Boolean
    2.     #If APP_RELEASE Then
    3.         On Error GoTo Err:
    4.     #End If
    5.     Dim tTiles() As TileType
    6.     Dim L As Long
    7.     Dim X As Long
    8.     Dim Y As Long
    9.    
    10.     If Width < 0 Then
    11.         Let Width = Header.Width
    12.     End If
    13.    
    14.     If Height < 0 Then
    15.         Let Height = Header.Height
    16.     End If
    17.    
    18.     ReDim tTiles(LayerMax, Header.Width, Header.Height) As TileType
    19.     For L = 0 To LayerMax
    20.         For X = 0 To Header.Width
    21.             For Y = 0 To Header.Height
    22.                 Let tTiles(L, X, Y) = Tiles(L, X, Y)
    23.             Next Y
    24.         Next X
    25.     Next L
    26.    
    27.     ReDim Tiles(LayerMax, Width, Height) As TileType
    28.     For L = 0 To LayerMax
    29.         For X = 0 To Width
    30.             For Y = 0 To Height
    31.                 If X <= Header.Width And Y <= Header.Height Then
    32.                     Let Tiles(L, X, Y) = tTiles(L, X, Y)
    33.                 Else
    34.                     Let Tiles(L, X, Y).ResourceX = L * -1
    35.                     Let Tiles(L, X, Y).ResourceY = L * -1
    36.                 End If
    37.             Next Y
    38.         Next X
    39.     Next L
    40.    
    41.     Erase tTiles
    42.     Let Header.Width = Width
    43.     Let Header.Height = Height
    44.    
    45.     Let Resize = True
    46.     Exit Function
    47. Err:
    48.     ReDim Tiles(LayerMax, Header.Width, Header.Height) As TileType
    49.     For L = 0 To LayerMax
    50.         For X = 0 To Header.Width
    51.             For Y = 0 To Header.Height
    52.                 Let Tiles(L, X, Y) = tTiles(L, X, Y)
    53.             Next Y
    54.         Next X
    55.     Next L
    56.     Erase tTiles
    57. End Function

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Do you pass a Width and Height to the Resize procedure? The Header.Width and .Height won't change unless you do.

    What is Header anyway? Rect? Custom UDT or Class module?

    One more thing. Drop the LET statements, they are driving me crazy... Its not the 1980's.

  6. #6

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206
    why is let so bad?

    anyway. i found the problem. now i have problems with the calculations. it wont show the tile like an real iso map.

    like
    Code:
    /\
    \/

  7. #7

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206
    here more in detail what my problem is:

    http://www.gamingw.net/forums/index.php?showtopic=74971

  8. #8

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206
    bump?

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