Todo sobre AO
 
ÍndiceFAQBuscarMiembrosGrupos de UsuariosRegistrarseConectarse

Comparte | 
 

 Invi, Techos, Noche con Alpha

Ver el tema anterior Ver el tema siguiente Ir abajo 
AutorMensaje
Agus
Admin


Mensajes : 69
Fecha de inscripción : 01/07/2008

MensajeTema: Invi, Techos, Noche con Alpha   Jue Ago 07, 2008 7:44 pm

Citación :

Sub RenderScreen(tilex As Integer, tiley As Integer, PixelOffsetX As Integer, PixelOffsetY As Integer)

On Error Resume Next

If UserCiego Then Exit Sub

Dim Y As Integer
Dim X As Integer
Dim minY As Integer
Dim maxY As Integer
Dim minX As Integer
Dim maxX As Integer
Dim ScreenX As Integer
Dim ScreenY As Integer
Dim Moved As Byte
Dim Grh As Grh
Dim TempChar As Char
Dim TextX As Integer
Dim TextY As Integer
Dim iPPx As Integer
Dim iPPy As Integer
Dim rSourceRect As RECT
Dim PP As RECT
Dim iGrhIndex As Integer
Dim PixelOffsetXTemp As Integer
Dim PixelOffsetYTemp As Integer
Dim nX As Integer
Dim nY As Integer
Dim lCenter As Long
Dim sClan As String
Dim bbarray() As Byte
Dim nnarray() As Byte
Dim ddsdBB As DDSURFACEDESC2
Dim r As RECT



minY = (TileY - (WindowTileHeight \ 2)) - TileBufferSize
maxY = (TileY + (WindowTileHeight \ 2)) + TileBufferSize
minX = (TileX - (WindowTileWidth \ 2)) - TileBufferSize
maxX = (TileX + (WindowTileWidth \ 2)) + TileBufferSize

ScreenY = 8
For Y = (minY + Cool To maxY - 8
ScreenX = 8
For X = minX + 8 To maxX - 8
If X > 100 Or Y < 1 Then Exit For
'Capa 1
With MapData(X, Y).Graphic(1)
If (.Started = 1) Then
If (.SpeedCounter > 0) Then
.SpeedCounter = .SpeedCounter - 1
If (.SpeedCounter = 0) Then
.SpeedCounter = GrhData(.GrhIndex).Speed
.FrameCounter = .FrameCounter + 1
If (.FrameCounter > GrhData(.GrhIndex).NumFrames) Then _
.FrameCounter = 1
End If
End If
End If


iGrhIndex = GrhData(.GrhIndex).Frames(.FrameCounter)
End With

With rSourceRect
.Left = GrhData(iGrhIndex).sX
.Top = GrhData(iGrhIndex).sY
.Right = .Left + GrhData(iGrhIndex).pixelWidth
.Bottom = .Top + GrhData(iGrhIndex).pixelHeight
End With

Call BackBufferSurface.BltFast(((32 * ScreenX) - 32) + PixelOffsetX, ((32 * ScreenY) - 32) + PixelOffsetY, SurfaceDB.Surface(GrhData(iGrhIndex).FileNum), rSourceRect, DDBLTFAST_WAIT)

If MapData(X, Y).Graphic(2).GrhIndex <> 0 Then
Call DDrawTransGrhtoSurface(BackBufferSurface, MapData(X, Y).Graphic(2), ((32 * ScreenX) - 32) + PixelOffsetX, ((32 * ScreenY) - 32) + PixelOffsetY, 1, 1)
End If

ScreenX = ScreenX + 1
Next X
ScreenY = ScreenY + 1
If Y > 100 Then Exit For
Next Y

Call ConvertCPtoTP(frmMain.MainViewShp.Left, frmMain.MainViewShp.Top, frmMain.MouseX, frmMain.MouseY, nX, nY)

ScreenY = 8
For Y = minY + 8 To maxY - 1
ScreenX = 5
For X = minX + 5 To maxX - 5
If X > 100 Or X < -3 Then Exit For
iPPx = 32 * ScreenX - 32 + PixelOffsetX
iPPy = 32 * ScreenY - 32 + PixelOffsetY

If MapData(X, Y).ObjGrh.GrhIndex <> 0 Then
Call DDrawTransGrhtoSurface(BackBufferSurface, MapData(X, Y).ObjGrh, iPPx, iPPy, 1, 1)
End If

If MapData(X, Y).CharIndex <> 0 Then
TempChar = charlist(MapData(X, Y).CharIndex)
PixelOffsetXTemp = PixelOffsetX
PixelOffsetYTemp = PixelOffsetY

Moved = 0
If TempChar.MoveOffset.X <> 0 Then
TempChar.Body.Walk(TempChar.Heading).Started = 1
TempChar.Arma.WeaponWalk(TempChar.Heading).Started = 1
TempChar.Escudo.ShieldWalk(TempChar.Heading).Started = 1
PixelOffsetXTemp = PixelOffsetXTemp + TempChar.MoveOffset.X
TempChar.MoveOffset.X = TempChar.MoveOffset.X - (8 * Sgn(TempChar.MoveOffset.X))
Moved = 1
End If
'If needed, move up And down
If TempChar.MoveOffset.Y <> 0 Then
TempChar.Body.Walk(TempChar.Heading).Started = 1
TempChar.Arma.WeaponWalk(TempChar.Heading).Started = 1
TempChar.Escudo.ShieldWalk(TempChar.Heading).Started = 1
PixelOffsetYTemp = PixelOffsetYTemp + TempChar.MoveOffset.Y
TempChar.MoveOffset.Y = TempChar.MoveOffset.Y - (8 * Sgn(TempChar.MoveOffset.Y))
Moved = 1
End If
'If done moving Stop animation
If Moved = 0 And TempChar.Moving = 1 Then
TempChar.Moving = 0
TempChar.Body.Walk(TempChar.Heading).FrameCounter = 1
TempChar.Body.Walk(TempChar.Heading).Started = 0
TempChar.Arma.WeaponWalk(TempChar.Heading).FrameCounter = 1
TempChar.Arma.WeaponWalk(TempChar.Heading).Started = 0
TempChar.Escudo.ShieldWalk(TempChar.Heading).FrameCounter = 1
TempChar.Escudo.ShieldWalk(TempChar.Heading).Started = 0
End If

If TempChar.Arma.WeaponAttack > 0 Then
TempChar.Arma.WeaponAttack = TempChar.Arma.WeaponAttack - 1
If TempChar.Arma.WeaponAttack = 0 Then
TempChar.Arma.WeaponWalk(TempChar.Heading).Started = 0
End If
End If

iPPx = ((32 * ScreenX) - 32) + PixelOffsetXTemp
iPPy = ((32 * ScreenY) - 32) + PixelOffsetYTemp

If TempChar.Head.Head(TempChar.Heading).GrhIndex <> 0 Then
If Not charlist(MapData(X, Y).CharIndex).invisible Then

Call DDrawTransGrhtoSurface(BackBufferSurface, TempChar.Body.Walk(TempChar.Heading), (((32 * ScreenX) - 32) + PixelOffsetXTemp), (((32 * ScreenY) - 32) + PixelOffsetYTemp), 1, 1)
Call DDrawTransGrhtoSurface(BackBufferSurface, TempChar.Head.Head(TempChar.Heading), iPPx + TempChar.Body.HeadOffset.X, iPPy + TempChar.Body.HeadOffset.Y, 1, 0)

If TempChar.Casco.Head(TempChar.Heading).GrhIndex <> 0 Then Call DDrawTransGrhtoSurface(BackBufferSurface, TempChar.Casco.Head(TempChar.Heading), iPPx + TempChar.Body.HeadOffset.X, iPPy + TempChar.Body.HeadOffset.Y, 1, 0)
If TempChar.Arma.WeaponWalk(TempChar.Heading).GrhIndex <> 0 Then Call DDrawTransGrhtoSurface(BackBufferSurface, TempChar.Arma.WeaponWalk(TempChar.Heading), iPPx, iPPy, 1, 1)
If TempChar.Escudo.ShieldWalk(TempChar.Heading).GrhIndex <> 0 Then Call DDrawTransGrhtoSurface(BackBufferSurface, TempChar.Escudo.ShieldWalk(TempChar.Heading), iPPx, iPPy, 1, 1)

#If ConAlfaB = 1 Then
ElseIf charlist(MapData(X, Y).CharIndex).invisible = True And UCase$(charlist(MapData(X, Y).CharIndex).Nombre) = UCase$(UserName) Then

Call DDrawTransGrhtoSurfaceAlpha(BackBufferSurface, TempChar.Body.Walk(TempChar.Heading), (((32 * ScreenX) - 32) + PixelOffsetXTemp), (((32 * ScreenY) - 32) + PixelOffsetYTemp), 1, 1)
Call DDrawTransGrhtoSurfaceAlpha(BackBufferSurface, TempChar.Head.Head(TempChar.Heading), iPPx + TempChar.Body.HeadOffset.X, iPPy + TempChar.Body.HeadOffset.Y, 1, 0)

If TempChar.Casco.Head(TempChar.Heading).GrhIndex <> 0 Then Call DDrawTransGrhtoSurfaceAlpha(BackBufferSurface, TempChar.Casco.Head(TempChar.Heading), iPPx + TempChar.Body.HeadOffset.X, iPPy + TempChar.Body.HeadOffset.Y, 1, 0)
If TempChar.Arma.WeaponWalk(TempChar.Heading).GrhIndex <> 0 Then Call DDrawTransGrhtoSurfaceAlpha(BackBufferSurface, TempChar.Arma.WeaponWalk(TempChar.Heading), iPPx, iPPy, 1, 1)
If TempChar.Escudo.ShieldWalk(TempChar.Heading).GrhIndex <> 0 Then Call DDrawTransGrhtoSurfaceAlpha(BackBufferSurface, TempChar.Escudo.ShieldWalk(TempChar.Heading), iPPx, iPPy, 1, 1)
#End If

End If

'***[Nombres]***
If Nombres Then
If TempChar.invisible = False Or (UCase$(TempChar.Nombre) = UCase$(UserName)) Then
If TempChar.Nombre <> "" Then
If InStr(TempChar.Nombre, "<") > 0 And InStr(TempChar.Nombre, ">") > 0 Then
lCenter = (frmMain.TextWidth(Left(TempChar.Nombre, InStr(TempChar.Nombre, "<") - 1)) / 2) - 16
sClan = mid(TempChar.Nombre, InStr(TempChar.Nombre, "<"))

Select Case TempChar.priv
Case 0
If TempChar.Criminal Then
Call Dialogos.DrawText(iPPx - lCenter, iPPy + 30, Left(TempChar.Nombre, InStr(TempChar.Nombre, "<") - 1), RGB(ColoresPJ(50).r, ColoresPJ(50).G, ColoresPJ(50).b))
lCenter = (frmMain.TextWidth(sClan) / 2) - 16
Call Dialogos.DrawText(iPPx - lCenter, iPPy + 45, sClan, RGB(ColoresPJ(50).r, ColoresPJ(50).G, ColoresPJ(50).b))
Else
Call Dialogos.DrawText(iPPx - lCenter, iPPy + 30, Left(TempChar.Nombre, InStr(TempChar.Nombre, "<") - 1), RGB(ColoresPJ(49).r, ColoresPJ(49).G, ColoresPJ(49).b))
lCenter = (frmMain.TextWidth(sClan) / 2) - 16
Call Dialogos.DrawText(iPPx - lCenter, iPPy + 45, sClan, RGB(ColoresPJ(49).r, ColoresPJ(49).G, ColoresPJ(49).b))
End If
Case 25 'admin
Call Dialogos.DrawTextBig(iPPx - lCenter, iPPy + 30, Left(TempChar.Nombre, InStr(TempChar.Nombre, "<") - 1), RGB(ColoresPJ(TempChar.priv).r, ColoresPJ(TempChar.priv).G, ColoresPJ(TempChar.priv).b))
lCenter = (frmMain.TextWidth(sClan) / 2) - 16
Call Dialogos.DrawTextBig(iPPx - lCenter, iPPy + 45, sClan, RGB(ColoresPJ(TempChar.priv).r, ColoresPJ(TempChar.priv).G, ColoresPJ(TempChar.priv).b))
Case Else 'el resto
Call Dialogos.DrawText(iPPx - lCenter, iPPy + 30, Left(TempChar.Nombre, InStr(TempChar.Nombre, "<") - 1), RGB(ColoresPJ(TempChar.priv).r, ColoresPJ(TempChar.priv).G, ColoresPJ(TempChar.priv).b))
lCenter = (frmMain.TextWidth(sClan) / 2) - 16
Call Dialogos.DrawText(iPPx - lCenter, iPPy + 45, sClan, RGB(ColoresPJ(TempChar.priv).r, ColoresPJ(TempChar.priv).G, ColoresPJ(TempChar.priv).b))
End Select
Else
lCenter = (frmMain.TextWidth(TempChar.Nombre) / 2) - 16
Select Case TempChar.priv
Case 0
If TempChar.Criminal Then
Call Dialogos.DrawText(iPPx - lCenter, iPPy + 30, TempChar.Nombre, RGB(ColoresPJ(50).r, ColoresPJ(50).G, ColoresPJ(50).b))
Else
Call Dialogos.DrawText(iPPx - lCenter, iPPy + 30, TempChar.Nombre, RGB(ColoresPJ(49).r, ColoresPJ(49).G, ColoresPJ(49).b))
End If
Case 7
Call Dialogos.DrawTextBig(iPPx - lCenter, iPPy + 30, TempChar.Nombre, RGB(ColoresPJ(TempChar.priv).r, ColoresPJ(TempChar.priv).G, ColoresPJ(TempChar.priv).b))
Case Else
Call Dialogos.DrawText(iPPx - lCenter, iPPy + 30, TempChar.Nombre, RGB(ColoresPJ(TempChar.priv).r, ColoresPJ(TempChar.priv).G, ColoresPJ(TempChar.priv).b))
End Select
End If
End If
End If
End If

If Dialogos.CantidadDialogos > 0 Then
Call Dialogos.Update_Dialog_Pos((iPPx + TempChar.Body.HeadOffset.X), (iPPy + TempChar.Body.HeadOffset.Y), MapData(X, Y).CharIndex)
End If

Else
If Dialogos.CantidadDialogos > 0 Then
Call Dialogos.Update_Dialog_Pos((iPPx + TempChar.Body.HeadOffset.X), (iPPy + TempChar.Body.HeadOffset.Y), MapData(X, Y).CharIndex)
End If

Call DDrawTransGrhtoSurface(BackBufferSurface, TempChar.Body.Walk(TempChar.Heading), iPPx, iPPy, 1, 1)
End If

charlist(MapData(X, Y).CharIndex) = TempChar

'Efectos
If charlist(MapData(X, Y).CharIndex).Fx <> 0 Then
#If ConAlfaB = 1 Then
Call DDrawTransGrhtoSurfaceAlpha(BackBufferSurface, FxData(TempChar.Fx).Fx, iPPx + FxData(TempChar.Fx).OffsetX, iPPy + FxData(TempChar.Fx).OffsetY, 1, 1, MapData(X, Y).CharIndex)
#Else
Call DDrawTransGrhtoSurface(BackBufferSurface, FxData(TempChar.Fx).Fx, iPPx + FxData(TempChar.Fx).OffsetX, iPPy + FxData(TempChar.Fx).OffsetY, 1, 1, MapData(X, Y).CharIndex)
#End If
End If
End If

'Capa 3
If MapData(X, Y).Graphic(3).GrhIndex <> 0 Then
Call DDrawTransGrhtoSurface(BackBufferSurface, MapData(X, Y).Graphic(3), ((32 * ScreenX) - 32) + PixelOffsetX, ((32 * ScreenY) - 32) + PixelOffsetY, 1, 1)
End If

ScreenX = ScreenX + 1
Next X
ScreenY = ScreenY + 1
If Y >= 100 Or Y < 1 Then Exit For
Next Y

'Techos
If Not bTecho Then
'Draw blocked tiles and grid
ScreenY = 5
For Y = minY + 5 To maxY - 1
If Y > 0 And Y < 101 Then 'In map bounds
ScreenX = 5
For X = minX + 5 To maxX
If Y > 0 And Y < 101 Then 'In map bounds
If MapData(X, Y).Graphic(4).GrhIndex <> 0 Then
'Draw
Call DDrawTransGrhtoSurface( _
BackBufferSurface, _
MapData(X, Y).Graphic(4), _
((32 * ScreenX) - 32) + PixelOffsetX, _
((32 * ScreenY) - 32) + PixelOffsetY, _
1, 1)
End If
End If
ScreenX = ScreenX + 1
Next X
End If
ScreenY = ScreenY + 1
Next Y

Else

ScreenY = 5
For Y = minY + 5 To maxY - 1
If Y > 0 And Y < 101 Then 'In map bounds
ScreenX = 5
For X = minX + 5 To maxX
If Y > 0 And Y < 101 Then 'In map bounds
If MapData(X, Y).Graphic(4).GrhIndex <> 0 Then
'Draw
Call DDrawTransGrhtoSurfaceAlpha( _
BackBufferSurface, _
MapData(X, Y).Graphic(4), _
((32 * ScreenX) - 32) + PixelOffsetX, _
((32 * ScreenY) - 32) + PixelOffsetY, _
1, 1)
End If
End If
ScreenX = ScreenX + 1
Next X
End If
ScreenY = ScreenY + 1
Next Y

End If

'LLuvia
If bLluvia(UserMap) = 1 And bRain Then
If llTick < DirectX.TickCount - 50 Then
iFrameIndex = iFrameIndex + 1
If iFrameIndex > 7 Then iFrameIndex = 0
llTick = DirectX.TickCount
End If

For Y = 0 To 4
For X = 0 To 4
Call BackBufferSurface.BltFast(LTLluvia(Y), LTLluvia(X), SurfaceDB.Surface(5556), RLluvia(iFrameIndex), DDBLTFAST_SRCCOLORKEY + DDBLTFAST_WAIT)
Next X
Next Y
End If

With PP
.Left = 0
.Top = 0
.Right = WindowTileWidth * TilePixelWidth
.Bottom = WindowTileHeight * TilePixelHeight
End With

'Noche

If Oscuro = 1 Then

Call BackBufferSurface.BltFast(LTLluvia(0) + TilePixelWidth, LTLluvia(0) + TilePixelHeight, SurfaceDB.Surface(10000), PP, DDBLTFAST_SRCCOLORKEY + DDBLTFAST_WAIT)

EfectoNoche BackBufferSurface

If bTecho Then
BackBufferSurface.GetSurfaceDesc ddsdBB
BackBufferSurface.Lock r, ddsdBB, DDLOCK_WRITEONLY + DDLOCK_WAIT, 0
BackBufferSurface.GetLockedArray bbarray()
BackBufferSurface.Unlock r

'If RetVal = -1 Then MsgBox "error!"
End If
End If

'Call BackBufferSurface.BltFast(LTLluvia(0) + TilePixelWidth, LTLluvia(0) + TilePixelHeight, SurfaceDB.surface(10000), PP, DDBLTFAST_SRCCOLORKEY + DDBLTFAST_WAIT)

'EfectoNoche BackBufferSurface

'[USELESS]:El codigo para llamar a la noche, nublado, etc.
'If bTecho Then
'Dim bbarray() As Byte, nnarray() As Byte
'Dim ddsdBB As DDSURFACEDESC2 'backbuffer
'Dim ddsdNN As DDSURFACEDESC2 'nnublado
'Dim r As RECT, r2 As RECT
'Dim retVal As Long
'[LOCK]:BackBufferSurface
'BackBufferSurface.GetSurfaceDesc ddsdBB
'BackBufferSurface.Lock r, ddsdBB, DDLOCK_NOSYSLOCK + DDLOCK_WRITEONLY + DDLOCK_WAIT, 0
'BackBufferSurface.Lock r, ddsdBB, DDLOCK_WRITEONLY + DDLOCK_WAIT, 0
'BackBufferSurface.GetLockedArray bbarray()
'[LOCK]:BBMask
'SurfaceXU(2).GetSurfaceDesc ddsdNN
'SurfaceXU(2).Lock r2, ddsdNN, DDLOCK_READONLY + DDLOCK_NOSYSLOCK + DDLOCK_WAIT, 0
'SurfaceXU(2).Lock r2, ddsdNN, DDLOCK_READONLY + DDLOCK_WAIT, 0
'SurfaceXU(2).GetLockedArray nnarray()
'[BLIT]
'retVal = BlitNoche(bbarray(0, 0), ddsdBB.lHeight, ddsdBB.lWidth, 0)
'retval = BlitNublar(bbarray(0, 0), ddsdBB.lHeight, ddsdBB.lWidth)
'retVal = BlitNublarMMX(bbarray(0, 0), nnarray(0, 0), ddsdBB.lHeight, ddsdBB.lWidth, ddsdBB.lPitch, ddsdNN.lHeight, ddsdNN.lWidth, ddsdNN.lPitch)
'[UNLOCK]
'BackBufferSurface.Unlock r
'SurfaceXU(2).Unlock r2
'[END]'
'If retVal = -1 Then MsgBox "error!"
'End If
'[END]'
End Sub


Última edición por Agus el Vie Ago 08, 2008 6:48 pm, editado 1 vez
Volver arriba Ir abajo
Ver perfil de usuario http://recompilacionao.forosactivos.com
Agus
Admin


Mensajes : 69
Fecha de inscripción : 01/07/2008

MensajeTema: Re: Invi, Techos, Noche con Alpha   Vie Ago 08, 2008 6:48 pm

Servidor
Buscamos
Citación :

If UCase$(Left$(rdata, 9)) = "/SHOW INT" Then
If UserList(UserIndex).flags.EsRolesMaster Then Exit Sub
Call LogGM(UserList(UserIndex).Name, rdata, False)
Call frmMain.mnuMostrar_Click
Exit Sub
End If
y abajo ponemos
Citación :

If UCase(rdata) = "/ANOCHECER" Then
If Anochecer = 0 Then
Call SendData(ToAll, 0, 0, "NUB" & 1)
Call SendData(ToAll, 0, 0, "TW" & 81)
Anochecer = 1
Exit Sub
End If
If Anochecer = 1 Then
Call SendData(ToAll, 0, 0, "NUB" & 0)
Call SendData(ToAll, 0, 0, "TW" & 67)
Anochecer = 0
Exit Sub
End If
Exit Sub
End If
Buscamos
Citación :

If Lloviendo Then Call SendData(SendTarget.ToIndex, UserIndex, 0, "LLU")
Ponemos
Citación :

If anochecer = 1 Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "NUB" & 1)
Call SendData(SendTarget.ToIndex, UserIndex, 0, "TW" & 81)
End If
Buscamos
Citación :

Public Lloviendo As Boolean
y abajo ponemos
Citación :

Public Anochecer As Byte
Cliente
Buscamos
Citación :

Public ServersRecibidos As Boolean
y abajo ponemos
Citación :

Public Nublado As Byte
Buscamos
Citación :

Case "QDL"
y arriba ponemos
Citación :

Case "NUB"
Rdata = Right$(Rdata, Len(Rdata) - 3)
If Rdata = 1 Then
Nublado = 1
Exit Sub
End If
If Rdata = 0 Then
Nublado = 0
Exit Sub
End If
Exit Sub
Listo ^^
Volver arriba Ir abajo
Ver perfil de usuario http://recompilacionao.forosactivos.com
 
Invi, Techos, Noche con Alpha
Ver el tema anterior Ver el tema siguiente Volver arriba 
Página 1 de 1.
 Temas similares
-
» Noche Enferma
» La Noche Más Corta Más Larga 2011 (SAB 25 de JUNIO) CLUB MECATOL REX
» Bolero de noche [2011]
» ¿Que dan esta noche en la tele? (ESTO ARRIBA)
» Noche de ensueño

Permisos de este foro:No puedes responder a temas en este foro.
 :: Argentum Online :: Programación :: 0.11.5-
Cambiar a: