powerid Inicial
Cantidad de envíos : 18 Fecha de inscripción : 14/08/2013 Edad : 24 Localización : Pehuajo
| Tema: Graficos Via .Bmp 13.0 Dx8 Miér Ago 14, 2013 2:19 pm | |
| Es algo básico, y simple de realizar, perfecto para aquellos que desean trabajar de manera más fluida y más organizada a la hora de desarrollar sus Cliente/Servior en la parte visual. (Ahorran bastante tiempo)
En el cliente buscan: - Código:
-
Private Function LoadSurface(ByVal fileIndex As Long) As Direct3DTexture8 Y lo reemplazan todo por: - Código:
-
Private Function LoadSurface(ByVal fileIndex As Long) As Direct3DTexture8 '************************************************************** '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 Abren el siguiente archivo (en la carpeta de juego), para que les descomprima los gráficos y les elimine los anteriores Graphics.AO creados y listo: https://mega.co.nz/#!EZE1DZ7J!HblANmrkD ... K7D2g-7KJg | |
|