|
-
Sep 17th, 2004, 05:20 PM
#1
Thread Starter
Banned
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.
-
Sep 17th, 2004, 05:25 PM
#2
Bummer.
So what is your Visual Basic question?
-
Sep 17th, 2004, 05:27 PM
#3
Thread Starter
Banned
never mind its not the problem... i wont even draw with working calc...
-
Sep 17th, 2004, 05:37 PM
#4
Thread Starter
Banned
i found where the problem is. the header.width and height wont change
VB Code:
Public Function Resize(Optional Width = -1, Optional Height = -1) As Boolean
#If APP_RELEASE Then
On Error GoTo Err:
#End If
Dim tTiles() As TileType
Dim L As Long
Dim X As Long
Dim Y As Long
If Width < 0 Then
Let Width = Header.Width
End If
If Height < 0 Then
Let Height = Header.Height
End If
ReDim tTiles(LayerMax, Header.Width, Header.Height) As TileType
For L = 0 To LayerMax
For X = 0 To Header.Width
For Y = 0 To Header.Height
Let tTiles(L, X, Y) = Tiles(L, X, Y)
Next Y
Next X
Next L
ReDim Tiles(LayerMax, Width, Height) As TileType
For L = 0 To LayerMax
For X = 0 To Width
For Y = 0 To Height
If X <= Header.Width And Y <= Header.Height Then
Let Tiles(L, X, Y) = tTiles(L, X, Y)
Else
Let Tiles(L, X, Y).ResourceX = L * -1
Let Tiles(L, X, Y).ResourceY = L * -1
End If
Next Y
Next X
Next L
Erase tTiles
Let Header.Width = Width
Let Header.Height = Height
Let Resize = True
Exit Function
Err:
ReDim Tiles(LayerMax, Header.Width, Header.Height) As TileType
For L = 0 To LayerMax
For X = 0 To Header.Width
For Y = 0 To Header.Height
Let Tiles(L, X, Y) = tTiles(L, X, Y)
Next Y
Next X
Next L
Erase tTiles
End Function
-
Sep 17th, 2004, 06:04 PM
#5
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.
-
Sep 18th, 2004, 06:43 AM
#6
Thread Starter
Banned
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
-
Sep 18th, 2004, 09:32 AM
#7
Thread Starter
Banned
-
Sep 18th, 2004, 04:21 PM
#8
Thread Starter
Banned
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|