[Aporte]Graficos Via .bmp sin Compresion
2 participantes
Página 1 de 1.
[Aporte]Graficos Via .bmp sin Compresion
Clinte
- Código:
Private Function LoadSurface(ByVal fileIndex As Long) As Direct3DTexture8
- Código:
Private Function LoadSurface(ByVal fileIndex As Long) As Direct3DTexture8
'**************************************************************
'Author: Nicolas Matias Gonzalez (NIGO)
'Last Modify Date: 05/11/2009
'Loads the surface named fileIndex + ".bmp" and inserts it to the
'surface list in the listIndex position
'**************************************************************
On Error GoTo ErrHandler
Dim newSurface As SURFACE_ENTRY_DYN
Dim surface_desc As D3DSURFACE_DESC
Dim texture_info As D3DXIMAGE_INFO
'get Bitmap
'Call Get_Bitmap(ResourcePath, CStr(fileIndex) & ".BMP", bmpInfo, data)
Dim fileNumber As String
fileNumber = App.path & "\Graficos\" & CStr(fileIndex) & ".bmp"
With newSurface
.fileIndex = fileIndex
'Set last access time (if we didn't we would reckon this texture as the one lru)
.lastAccess = GetTickCount
Set .Surface = DirectD3D.CreateTextureFromFileEx(DirectDevice, fileNumber, _
D3DX_DEFAULT, D3DX_DEFAULT, 3, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_FILTER_NONE, _
D3DX_FILTER_NONE, &HFF000000, texture_info, ByVal 0)
newSurface.Surface.GetLevelDesc 0, surface_desc
End With
'Insert surface to the list
With surfaceList(fileIndex Mod HASH_TABLE_SIZE)
.surfaceCount = .surfaceCount + 1
ReDim Preserve .SurfaceEntry(1 To .surfaceCount) As SURFACE_ENTRY_DYN
.SurfaceEntry(.surfaceCount) = newSurface
Set LoadSurface = newSurface.Surface
End With
'Update used bytes
usedBytes = usedBytes + surface_desc.Size
'Check if we have exceeded our allowed share of memory usage
Do While usedBytes > maxBytesToUse
'Remove a file. If no file could be removed we continue, if the file was previous to our surface we update the index
If Not RemoveLRU() Then
Exit Do
End If
Loop
Exit Function
ErrHandler:
End Function
- Fuente:
- Gs Zone
Re: [Aporte]Graficos Via .bmp sin Compresion
esto es para que lea los graficos desde uan carpeta ?)
Felipiño- Mensajes : 25
Puntos : 27
Temas similares
» [ APORTE ] Gráficos Tierras Del Sur
» [ APORTE ] Algunos Graficos
» [Aporte] Sistema e Cursores Gráficos
» [Aporte]Obj de IAO 1.4.9
» [ APORTE ] Ciudad 1
» [ APORTE ] Algunos Graficos
» [Aporte] Sistema e Cursores Gráficos
» [Aporte]Obj de IAO 1.4.9
» [ APORTE ] Ciudad 1
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.