Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Administrator
Administrator
Nachfolgend noch sicherheitshalber wie Dx8 initialisiert wird;Zitat
Public Sub RenderTiles(ByVal X As Byte, Y As Byte, Layer As Byte)
On Error Resume Next
Dim RecSource As RECT, t As Long
Dim i As Byte
' Jump Marks
Select Case Layer
Case 0: GoTo GroundMode
Case 1: GoTo MaskMode
Case 2: GoTo FringeMode
End Select
GroundMode:
t = Map.Tile(X, Y).Ground
If t <> 11 Then
If GameSeason <> SEASON_WINTER Then t = t + 1
With RecSource
.Top = Int(t \ 12) * PIC_Y
.bottom = .Top + PIC_Y
.Left = (t - (t \ 12) * 12) * PIC_X
.Right = .Left + PIC_X
End With
vecTranslation.X = X * PIC_X * ZoomFactor: vecTranslation.Y = Y * PIC_Y * ZoomFactor
Call gD3DX8Sprite.Draw(Tex_Tile, RecSource, vecScaling, vecRotationCenter, 0, vecTranslation, D3DColorARGB(255, 255, 255, 255))
End If
Exit Sub
MaskMode:
For i = 0 To 10
t = Map.Tile(X, Y).Mask(i)
If t <> 11 Then
With RecSource
.Top = Int(t \ 12) * 32
.bottom = .Top + 32
.Left = (t - (t \ 12) * 12) * 32
.Right = .Left + 32
End With
vecTranslation.X = (X * PIC_X * ZoomFactor): vecTranslation.Y = Y * PIC_Y * ZoomFactor
Call gD3DX8Sprite.Draw(Tex_Tile, RecSource, vecScaling, vecRotationCenter, 0, vecTranslation, D3DColorARGB(255, 255, 255, 255))
End If
Next
Exit Sub
FringeMode:
For i = 0 To 10
t = Map.Tile(X, Y).Fringe(i)
If t <> 11 Then
' Fringe
With RecSource
.Top = Int(t \ 12) * 32
.bottom = .Top + 32
.Left = (t - (t \ 12) * 12) * 32
.Right = .Left + 32
End With
vecTranslation.X = (X * PIC_X * ZoomFactor): vecTranslation.Y = Y * PIC_Y * ZoomFactor
Call gD3DX8Sprite.Draw(Tex_Tile, RecSource, vecScaling, vecRotationCenter, 0, vecTranslation, D3DColorARGB(255, 255, 255, 255))
End If
Next
Exit Sub
End Sub
Also das Ganze um 0,5 verschieben hatte nicht den Effekt, den es haben könnte... stattdessen bekam ich sogar noch ohne Zoom Streifen, als sich die tiles überlagerten. Was das Tileset angeht. Da scheint alles in Ordnung zu sein, der Tilecutter gab mir quasi perfekte Ausschnitte (zumal sonst ohne Zoom auch der Effekt aufträte, oder?)Zitat
Public Function Initialization(ByVal hWnd As Long) As Boolean
'on error resume next
Dim mode As D3DDISPLAYMODE
'holen wir uns Zugriff auf Direct3D
Set gD3D8 = gDX8.Direct3DCreate()
If gD3D8 Is Nothing Then Exit Function
gD3D8.GetAdapterDisplayMode D3DADAPTER_DEFAULT, mode
'festlegen der Darstellungs-Parameter (present)
Dim d3dpp As D3DPRESENT_PARAMETERS
d3dpp.Windowed = 1
d3dpp.SwapEffect = D3DSWAPEFFECT_COPY
d3dpp.BackBufferFormat = mode.Format
'Device erstellen
Set gD3DDevice8 = gD3D8.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, d3dpp)
If gD3DDevice8 Is Nothing Then Exit Function
'erstellen eines D3DX8 Objektes und Sprite
Set gD3DX8 = New D3DX8
Set gD3DX8Sprite = gD3DX8.CreateSprite(gD3DDevice
Initialization = True
'Initialisieren von DirectSound unter verwendung der Standardeinstellungen
Set DS = gDX8.DirectSoundCreate("")
'Cooperative Level setzen für unser Fenster und normalen Modus verwenden
DS.SetCooperativeLevel hWnd, DSSCL_NORMAL
'setzen der Eigenschaften
With DSBDesc
.lFlags = DSBCAPS_CTRLFREQUENCY
End With
' Sounds
Call InitSoundArrays
End Function
Werbeanzeige