[Aporte]Graficos Via .bmp sin Compresion

Ir abajo

[Aporte]Graficos Via .bmp sin Compresion

Mensaje por Shermie80 el Vie Ago 23, 2013 10:55 am

Clinte
Código:
Private Function LoadSurface(ByVal fileIndex As Long) As Direct3DTexture8
Reemplazan por
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
Shermie80
Shermie80



CoverAOStaff
Aportes : 55
Mensajes : 139
Puntos : 822
Edad : 22

Ver perfil de usuario http://todo-argentum.foroargentina.net

Volver arriba Ir abajo

Re: [Aporte]Graficos Via .bmp sin Compresion

Mensaje por Felipiño el Jue Ago 29, 2013 10:37 pm

esto es para que lea los graficos desde uan carpeta ?)
Felipiño
Felipiño



Mensajes : 25
Puntos : 27

Ver perfil de usuario

Volver arriba Ir abajo

Re: [Aporte]Graficos Via .bmp sin Compresion

Mensaje por Shermie80 el Lun Mar 03, 2014 9:53 pm

si
Shermie80
Shermie80



CoverAOStaff
Aportes : 55
Mensajes : 139
Puntos : 822
Edad : 22

Ver perfil de usuario http://todo-argentum.foroargentina.net

Volver arriba Ir abajo

Re: [Aporte]Graficos Via .bmp sin Compresion

Mensaje por Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.