From 0473785f65be2bdb4d121bc225acd135d000dea5 Mon Sep 17 00:00:00 2001 From: TwinAphex51224 Date: Tue, 29 May 2012 04:54:45 +0200 Subject: [PATCH] (360) Small cleanups --- 360/fonts.cpp | 4 ++-- 360/xdk360_video.cpp | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/360/fonts.cpp b/360/fonts.cpp index 67448d8884..5b6b4468b5 100644 --- a/360/fonts.cpp +++ b/360/fonts.cpp @@ -547,7 +547,7 @@ HRESULT xdk360_console_init( LPCSTR strFontFileName, unsigned long colBackColor, video_console.m_fLineHeight = fCharHeight; // Allocate memory to hold the lines - video_console.m_Buffer = new wchar_t[ video_console.m_cScreenHeightVirtual * ( video_console.m_cScreenWidth + 1 ) ]; + video_console.m_Buffer = (wchar_t*)malloc(sizeof(wchar_t*) * video_console.m_cScreenHeightVirtual * ( video_console.m_cScreenWidth + 1 )); video_console.m_Lines = new wchar_t *[ video_console.m_cScreenHeightVirtual ]; // Set the line pointers as indexes into the buffer @@ -597,7 +597,7 @@ void xdk360_console_deinit() if(video_console.m_Buffer) { - delete[] video_console.m_Buffer; + free(video_console.m_Buffer); video_console.m_Buffer = NULL; } diff --git a/360/xdk360_video.cpp b/360/xdk360_video.cpp index fec1db6fd9..e329dff198 100644 --- a/360/xdk360_video.cpp +++ b/360/xdk360_video.cpp @@ -150,7 +150,7 @@ void * PackedResource::GetData( const char * strName ) const HRESULT PackedResource::Create( const char * strFilename ) { unsigned long dwNumBytesRead; - HANDLE hFile = CreateFile( strFilename, GENERIC_READ, FILE_SHARE_READ, NULL, + void * hFile = CreateFile( strFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL ); if( hFile == INVALID_HANDLE_VALUE ) { @@ -179,14 +179,14 @@ HRESULT PackedResource::Create( const char * strFilename ) m_dwVidMemDataSize = xprh.dwDataSize; // Allocate memory - m_pSysMemData = (BYTE*)malloc(m_dwSysMemDataSize); + m_pSysMemData = (unsigned char*)malloc(m_dwSysMemDataSize); if( m_pSysMemData == NULL ) { RARCH_ERR( "Could not allocate system memory.\n" ); m_dwSysMemDataSize = 0; return E_FAIL; } - m_pVidMemData = ( BYTE* )XMemAlloc( m_dwVidMemDataSize, MAKE_XALLOC_ATTRIBUTES( 0, 0, 0, 0, eXALLOCAllocatorId_GameMax, + m_pVidMemData = ( unsigned char* )XMemAlloc( m_dwVidMemDataSize, MAKE_XALLOC_ATTRIBUTES( 0, 0, 0, 0, eXALLOCAllocatorId_GameMax, XALLOC_PHYSICAL_ALIGNMENT_4K, XALLOC_MEMPROTECT_WRITECOMBINE, 0, XALLOC_MEMTYPE_PHYSICAL ) ); if( m_pVidMemData == NULL ) @@ -231,12 +231,12 @@ HRESULT PackedResource::Create( const char * strFilename ) m_bInitialized = TRUE; - return S_OK; + return 0; } void PackedResource::Destroy() { - delete[] m_pSysMemData; + free(m_pSysMemData); m_pSysMemData = NULL; m_dwSysMemDataSize = 0L; @@ -388,15 +388,15 @@ static void xdk360_set_rotation(void * data, unsigned orientation) static void xdk360_convert_texture_to_as16_srgb( D3DTexture *pTexture ) { - pTexture->Format.SignX = GPUSIGN_GAMMA; - pTexture->Format.SignY = GPUSIGN_GAMMA; - pTexture->Format.SignZ = GPUSIGN_GAMMA; + pTexture->Format.SignX = GPUSIGN_GAMMA; + pTexture->Format.SignY = GPUSIGN_GAMMA; + pTexture->Format.SignZ = GPUSIGN_GAMMA; - XGTEXTURE_DESC desc; - XGGetTextureDesc( pTexture, 0, &desc ); + XGTEXTURE_DESC desc; + XGGetTextureDesc( pTexture, 0, &desc ); - //convert to AS_16_16_16_16 format - pTexture->Format.DataFormat = g_MapLinearToSrgbGpuFormat[ (desc.Format & D3DFORMAT_TEXTUREFORMAT_MASK) >> D3DFORMAT_TEXTUREFORMAT_SHIFT ]; + //convert to AS_16_16_16_16 format + pTexture->Format.DataFormat = g_MapLinearToSrgbGpuFormat[ (desc.Format & D3DFORMAT_TEXTUREFORMAT_MASK) >> D3DFORMAT_TEXTUREFORMAT_SHIFT ]; } static void xdk360_init_fbo(xdk360_video_t *d3d9)