From: Spacy <sp...@us...> - 2006-05-13 16:32:19
|
Update of /cvsroot/vba/VisualBoyAdvance/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6744/src/win32 Modified Files: AccelEditor.cpp CmdAccelOb.cpp Direct3D.cpp DirectDraw.cpp DirectInput.cpp Joypad.cpp MainWndFile.cpp VBA.cpp VideoMode.cpp resource.h vba.rc vba.rc2 Removed Files: UniVideoModeDlg.cpp UniVideoModeDlg.h Log Message: vs2005 compatibility Index: vba.rc2 =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/vba.rc2,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vba.rc2 15 May 2004 14:07:51 -0000 1.2 --- vba.rc2 13 May 2006 16:32:16 -0000 1.3 *************** *** 1,4 **** --- 1,15 ---- #ifndef _MAC #include "../AutoBuild.h" + + #if _MSC_VER >= 1400 + // use modern icon + IDI_ICON ICON DISCARDABLE "vbavista.ico" + #else + // use traditional icon + IDI_ICON ICON DISCARDABLE "gbadvance.ico" + #endif + + + ///////////////////////////////////////////////////////////////////////////// // --- UniVideoModeDlg.cpp DELETED --- Index: CmdAccelOb.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/CmdAccelOb.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CmdAccelOb.cpp 4 Nov 2003 14:09:52 -0000 1.2 --- CmdAccelOb.cpp 13 May 2006 16:32:16 -0000 1.3 *************** *** 265,269 **** // modifiers part ! for (int i = 0; i < sizetable(mapVirtSysKeys); i++) { if (m_cVirt & mapVirtSysKeys[i].wKey) { szBuffer += mapVirtSysKeys[i].szKey; --- 265,270 ---- // modifiers part ! int i; ! for (i = 0; i < sizetable(mapVirtSysKeys); i++) { if (m_cVirt & mapVirtSysKeys[i].wKey) { szBuffer += mapVirtSysKeys[i].szKey; Index: DirectInput.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/DirectInput.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DirectInput.cpp 30 Apr 2006 14:31:17 -0000 1.4 --- DirectInput.cpp 13 May 2006 16:32:16 -0000 1.5 *************** *** 723,727 **** if(dinputDLL) { ! AfxFreeLibrary(dinputDLL); dinputDLL = NULL; } --- 723,731 ---- if(dinputDLL) { ! #ifdef _AFXDLL ! AfxFreeLibrary( dinputDLL ); ! #else ! FreeLibrary( dinputDLL ); ! #endif dinputDLL = NULL; } *************** *** 734,738 **** 0, "VBA.ini"); ! dinputDLL = AfxLoadLibrary("DINPUT.DLL"); HRESULT (WINAPI *DInputCreate)(HINSTANCE,DWORD,LPDIRECTINPUT *,IUnknown *); if(dinputDLL != NULL) { --- 738,747 ---- 0, "VBA.ini"); ! #ifdef _AFXDLL ! dinputDLL = AfxLoadLibrary("dinput.dll"); ! #else ! dinputDLL = LoadLibrary( _T("dinput.dll") ); ! #endif ! HRESULT (WINAPI *DInputCreate)(HINSTANCE,DWORD,LPDIRECTINPUT *,IUnknown *); if(dinputDLL != NULL) { *************** *** 802,806 **** } ! for(int i = 1; i < numDevices; i++) { pDevices[i].device->SetDataFormat(&c_dfDIJoystick); pDevices[i].needed = false; --- 811,816 ---- } ! int i; ! for(i = 1; i < numDevices; i++) { pDevices[i].device->SetDataFormat(&c_dfDIJoystick); pDevices[i].needed = false; Index: MainWndFile.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MainWndFile.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MainWndFile.cpp 30 Apr 2006 14:32:53 -0000 1.12 --- MainWndFile.cpp 13 May 2006 16:32:16 -0000 1.13 *************** *** 738,742 **** CFileStatus status; CString str; ! unsigned long time = (unsigned long)-1; int found = 0; --- 738,742 ---- CFileStatus status; CString str; ! __time64_t time = -1; int found = 0; *************** *** 824,828 **** CFileStatus status; CString str; ! unsigned long time = 0; int found = -1; --- 824,828 ---- CFileStatus status; CString str; ! __time64_t time = 0; int found = -1; --- UniVideoModeDlg.h DELETED --- Index: AccelEditor.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/AccelEditor.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AccelEditor.cpp 13 May 2004 15:06:49 -0000 1.3 --- AccelEditor.cpp 13 May 2006 16:32:16 -0000 1.4 *************** *** 186,190 **** int count = m_commands.GetCount(); ! for (int index = 0; index < count; index++) { wIDCommand = LOWORD(m_commands.GetItemData(index)); --- 186,191 ---- int count = m_commands.GetCount(); ! int index; ! for (index = 0; index < count; index++) { wIDCommand = LOWORD(m_commands.GetItemData(index)); Index: Direct3D.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/Direct3D.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Direct3D.cpp 15 Sep 2004 22:11:19 -0000 1.7 --- Direct3D.cpp 13 May 2006 16:32:16 -0000 1.8 *************** *** 20,26 **** #include "vba.h" ! #define DIRECT3D_VERSION 0x0800 ! #include <d3d8.h> ! #include <d3dx8.h> #include "MainWnd.h" --- 20,26 ---- #include "vba.h" ! #define DIRECT3D_VERSION 0x0900 ! #include <d3d9.h> ! #include <d3dx9.h> #include "MainWnd.h" *************** *** 74,81 **** class Direct3DDisplay : public IDisplay { private: ! HINSTANCE d3dDLL; ! LPDIRECT3D8 pD3D; ! LPDIRECT3DDEVICE8 pDevice; ! LPDIRECT3DTEXTURE8 pTexture; D3DSURFACE_DESC dsdBackBuffer; D3DPRESENT_PARAMETERS dpp; --- 74,80 ---- class Direct3DDisplay : public IDisplay { private: ! LPDIRECT3D9 pD3D; ! LPDIRECT3DDEVICE9 pDevice; ! LPDIRECT3DTEXTURE9 pTexture; D3DSURFACE_DESC dsdBackBuffer; D3DPRESENT_PARAMETERS dpp; *************** *** 110,114 **** Direct3DDisplay::Direct3DDisplay() { - d3dDLL = NULL; pD3D = NULL; pDevice = NULL; --- 109,112 ---- *************** *** 147,155 **** pD3D->Release(); pD3D = NULL; - - if(d3dDLL != NULL) { - FreeLibrary(d3dDLL); - d3dDLL = NULL; - } } } --- 145,148 ---- *************** *** 262,282 **** theApp.adjustDestRect(); - - d3dDLL = LoadLibrary("D3D8.DLL"); - LPDIRECT3D8 (WINAPI *D3DCreate)(UINT); - if(d3dDLL != NULL) { - D3DCreate = (LPDIRECT3D8 (WINAPI *)(UINT)) - GetProcAddress(d3dDLL, "Direct3DCreate8"); ! if(D3DCreate == NULL) { ! theApp.directXMessage("Direct3DCreate8"); ! return FALSE; ! } ! } else { ! theApp.directXMessage("D3D8.DLL"); ! return FALSE; ! } ! ! pD3D = D3DCreate(120); if(pD3D == NULL) { --- 255,261 ---- theApp.adjustDestRect(); ! // load Direct3D v9 ! pD3D = Direct3DCreate9( D3D_SDK_VERSION ); if(pD3D == NULL) { *************** *** 417,429 **** case 0: // point filtering ! pDevice->SetTextureStageState( 0, D3DTSS_MINFILTER, D3DTEXF_POINT ); ! pDevice->SetTextureStageState( 0, D3DTSS_MAGFILTER, D3DTEXF_POINT ); ! pDevice->SetTextureStageState( 0, D3DTSS_MIPFILTER, D3DTEXF_POINT ); break; case 1: ! // bilinear ! pDevice->SetTextureStageState( 0, D3DTSS_MINFILTER, D3DTEXF_LINEAR ); ! pDevice->SetTextureStageState( 0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR ); ! pDevice->SetTextureStageState( 0, D3DTSS_MIPFILTER, D3DTEXF_POINT ); break; } --- 396,406 ---- case 0: // point filtering ! pDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_POINT ); ! pDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_POINT ); break; case 1: ! // bilinear filtering ! pDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR ); ! pDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR ); break; } *************** *** 433,439 **** { // Store render target surface desc ! LPDIRECT3DSURFACE8 pBackBuffer; HRESULT hr; ! if(SUCCEEDED(hr = pDevice->GetBackBuffer( 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer ))) { pBackBuffer->GetDesc( &dsdBackBuffer ); pBackBuffer->Release(); --- 410,416 ---- { // Store render target surface desc ! LPDIRECT3DSURFACE9 pBackBuffer; HRESULT hr; ! if(SUCCEEDED(hr = pDevice->GetBackBuffer( 0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer ))) { pBackBuffer->GetDesc( &dsdBackBuffer ); pBackBuffer->Release(); *************** *** 468,476 **** pFont = NULL; } // Create a D3D font using D3DX ! HFONT hFont = CreateFont( 14, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ! ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ! ANTIALIASED_QUALITY, FF_DONTCARE, "Arial" ); ! D3DXCreateFont( pDevice, hFont, &pFont ); } --- 445,451 ---- pFont = NULL; } + // Create a D3D font using D3DX ! D3DXCreateFont( pDevice, 24, 0, FW_BOLD, 1, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_DONTCARE, "Arial", &pFont ); } *************** *** 492,497 **** } ! static void BlitRect(LPDIRECT3DDEVICE8 lpDevice, ! LPDIRECT3DTEXTURE8 lpSrc, float left, float top, float right, float bottom, --- 467,472 ---- } ! static void BlitRect(LPDIRECT3DDEVICE9 lpDevice, ! LPDIRECT3DTEXTURE9 lpSrc, float left, float top, float right, float bottom, *************** *** 516,520 **** // configure shader for vertex type ! lpDevice->SetVertexShader(D3DFVF_TLVERTEX); // draw the rectangle --- 491,495 ---- // configure shader for vertex type ! lpDevice->SetFVF(D3DFVF_TLVERTEX); // draw the rectangle *************** *** 657,661 **** !theApp.disableStatusMessage && pFont) { D3DCOLOR color = D3DCOLOR_ARGB(255, 255, 0, 0); - pFont->Begin(); RECT r; r.left = 10; --- 632,635 ---- *************** *** 664,669 **** r.bottom = r.top + 20; ! pFont->DrawText(theApp.screenMessageBuffer, -1, &r, 0, color); ! pFont->End(); } else { theApp.screenMessage = false; --- 638,642 ---- r.bottom = r.top + 20; ! pFont->DrawText(NULL, theApp.screenMessageBuffer, -1, &r, 0, color); } else { theApp.screenMessage = false; Index: VideoMode.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/VideoMode.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** VideoMode.cpp 13 May 2004 15:06:55 -0000 1.5 --- VideoMode.cpp 13 May 2006 16:32:16 -0000 1.6 *************** *** 124,128 **** --- 124,132 ---- int winVideoModeSelect(CWnd *pWnd, GUID **guid) { + #ifdef _AFXDLL HINSTANCE h = AfxLoadLibrary("ddraw.dll"); + #else + HMODULE h = LoadLibrary( _T("ddraw.dll") ); + #endif // If ddraw.dll doesn't exist in the search path, *************** *** 184,190 **** if(selected == -1) { ! // If the library was loaded by calling LoadLibrary(), ! // then you must use FreeLibrary() to let go of it. ! AfxFreeLibrary(h); return -1; --- 188,196 ---- if(selected == -1) { ! #ifdef _AFXDLL ! AfxFreeLibrary( h ); ! #else ! FreeLibrary( h ); ! #endif return -1; *************** *** 204,208 **** if(hret != DD_OK) { systemMessage(0, "Error during DirectDrawCreateEx: %08x", hret); ! AfxFreeLibrary(h); return -1; } --- 210,218 ---- if(hret != DD_OK) { systemMessage(0, "Error during DirectDrawCreateEx: %08x", hret); ! #ifdef _AFXDLL ! AfxFreeLibrary( h ); ! #else ! FreeLibrary( h ); ! #endif return -1; } *************** *** 210,214 **** // should not happen.... systemMessage(0, "Error getting DirectDrawCreateEx"); ! AfxFreeLibrary(h); return -1; } --- 220,228 ---- // should not happen.... systemMessage(0, "Error getting DirectDrawCreateEx"); ! #ifdef _AFXDLL ! AfxFreeLibrary( h ); ! #else ! FreeLibrary( h ); ! #endif return -1; } *************** *** 226,230 **** // If the library was loaded by calling LoadLibrary(), // then you must use FreeLibrary() to let go of it. ! AfxFreeLibrary(h); return res; --- 240,248 ---- // If the library was loaded by calling LoadLibrary(), // then you must use FreeLibrary() to let go of it. ! #ifdef _AFXDLL ! AfxFreeLibrary( h ); ! #else ! FreeLibrary( h ); ! #endif return res; Index: VBA.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/VBA.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** VBA.cpp 4 Jan 2006 15:10:33 -0000 1.13 --- VBA.cpp 13 May 2006 16:32:16 -0000 1.14 *************** *** 21,24 **** --- 21,25 ---- #include "stdafx.h" #include <mmsystem.h> + #include <windows.h> #include "AVIWrite.h" *************** *** 415,418 **** --- 416,420 ---- // the specific initialization routines you do not need. + #if _MSC_VER < 1400 #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL *************** *** 420,423 **** --- 422,426 ---- Enable3dControlsStatic(); // Call this when linking to MFC statically #endif + #endif SetRegistryKey(_T("VBA")); *************** *** 1476,1488 **** DWORD dwVersion = 0; ! hinstDll = AfxLoadLibrary("USER32.DLL"); if(hinstDll) { ! GETMENUBARINFO func = (GETMENUBARINFO)GetProcAddress(hinstDll, ! "GetMenuBarInfo"); if(func) { MENUBARINFO info; ! info.cbSize = sizeof(info); func(AfxGetMainWnd()->GetSafeHwnd(), OBJID_MENU, 0, &info); --- 1479,1494 ---- DWORD dwVersion = 0; ! #ifdef _AFXDLL ! hinstDll = AfxLoadLibrary("user32.dll"); ! #else ! hinstDll = LoadLibrary( _T("user32.dll") ); ! #endif if(hinstDll) { ! GETMENUBARINFO func = (GETMENUBARINFO)GetProcAddress(hinstDll, "GetMenuBarInfo"); if(func) { MENUBARINFO info; ! info.cbSize = sizeof(MENUBARINFO); func(AfxGetMainWnd()->GetSafeHwnd(), OBJID_MENU, 0, &info); *************** *** 1501,1505 **** } } ! AfxFreeLibrary(hinstDll); } } --- 1507,1515 ---- } } ! #ifdef _AFXDLL ! AfxFreeLibrary( hinstDll ); ! #else ! FreeLibrary( hinstDll ); ! #endif } } *************** *** 1898,1902 **** AfxSetResourceHandle(l); if(languageModule != NULL) ! AfxFreeLibrary(languageModule); languageModule = l; } else { --- 1908,1916 ---- AfxSetResourceHandle(l); if(languageModule != NULL) ! #ifdef _AFXDLL ! AfxFreeLibrary( languageModule ); ! #else ! FreeLibrary( languageModule ); ! #endif languageModule = l; } else { *************** *** 1909,1913 **** case 1: if(languageModule != NULL) ! AfxFreeLibrary(languageModule); languageModule = NULL; AfxSetResourceHandle(AfxGetInstanceHandle()); --- 1923,1931 ---- case 1: if(languageModule != NULL) ! #ifdef _AFXDLL ! AfxFreeLibrary( languageModule ); ! #else ! FreeLibrary( languageModule ); ! #endif languageModule = NULL; AfxSetResourceHandle(AfxGetInstanceHandle()); *************** *** 1927,1931 **** AfxSetResourceHandle(l); if(languageModule != NULL) ! AfxFreeLibrary(languageModule); languageModule = l; } --- 1945,1955 ---- AfxSetResourceHandle(l); if(languageModule != NULL) ! { ! #ifdef _AFXDLL ! AfxFreeLibrary( languageModule ); ! #else ! FreeLibrary( languageModule ); ! #endif ! } languageModule = l; } *************** *** 1956,1962 **** CString buffer; ! buffer.Format("vba_%s.dll", name); ! HINSTANCE l = AfxLoadLibrary(buffer); if(l == NULL) { --- 1980,1990 ---- CString buffer; ! buffer.Format( _T("vba_%s.dll"), name); ! #ifdef _AFXDLL ! HINSTANCE l = AfxLoadLibrary( buffer ); ! #else ! HMODULE l = LoadLibrary( buffer ); ! #endif if(l == NULL) { *************** *** 1968,1972 **** buffer.Format("vba_%s.dll", buffer2); ! return AfxLoadLibrary(buffer); } } --- 1996,2004 ---- buffer.Format("vba_%s.dll", buffer2); ! #ifdef _AFXDLL ! return AfxLoadLibrary( buffer ); ! #else ! return LoadLibrary( buffer ); ! #endif } } Index: vba.rc =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/vba.rc,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** vba.rc 30 Apr 2006 14:34:24 -0000 1.52 --- vba.rc 13 May 2006 16:32:16 -0000 1.53 *************** *** 1,3 **** ! //Microsoft Developer Studio generated resource script. // #include "resource.h" --- 1,3 ---- ! // Microsoft Visual C++ generated resource script. // #include "resource.h" *************** *** 14,17 **** --- 14,71 ---- [...2431 lines suppressed...] IDS_ERROR_CREATING_SOCKET "Error creating socket." --- 2068,2072 ---- END ! STRINGTABLE BEGIN IDS_ERROR_CREATING_SOCKET "Error creating socket." *************** *** 2384,2388 **** END ! STRINGTABLE DISCARDABLE BEGIN IDS_INVALID_INTERVAL_VALUE --- 2089,2093 ---- END ! STRINGTABLE BEGIN IDS_INVALID_INTERVAL_VALUE Index: resource.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/resource.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** resource.h 4 Jan 2006 15:10:33 -0000 1.40 --- resource.h 13 May 2006 16:32:16 -0000 1.41 *************** *** 1,5 **** //{{NO_DEPENDENCIES}} ! // Microsoft Developer Studio generated include file. ! // Used by VBA.rc // #define IDS_UNSUPPORTED_VBA_SGM 1 --- 1,5 ---- //{{NO_DEPENDENCIES}} ! // Microsoft Visual C++ generated include file. ! // Used by vba.rc // #define IDS_UNSUPPORTED_VBA_SGM 1 *************** *** 758,762 **** #define _APS_NEXT_COMMAND_VALUE 40278 #define _APS_NEXT_CONTROL_VALUE 1256 ! #define _APS_NEXT_SYMED_VALUE 103 #endif #endif --- 758,762 ---- #define _APS_NEXT_COMMAND_VALUE 40278 #define _APS_NEXT_CONTROL_VALUE 1256 ! #define _APS_NEXT_SYMED_VALUE 104 #endif #endif Index: Joypad.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/Joypad.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Joypad.cpp 13 May 2004 15:06:50 -0000 1.4 --- Joypad.cpp 13 May 2006 16:32:16 -0000 1.5 *************** *** 164,168 **** CDialog::OnInitDialog(); ! timerId = SetTimer(0,200,NULL); SetWindowLong(up, GWL_USERDATA,joypad[which][KEY_UP]); --- 164,168 ---- CDialog::OnInitDialog(); ! timerId = SetTimer(0,50,NULL); SetWindowLong(up, GWL_USERDATA,joypad[which][KEY_UP]); Index: DirectDraw.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/DirectDraw.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DirectDraw.cpp 15 Sep 2004 22:08:53 -0000 1.7 --- DirectDraw.cpp 13 May 2006 16:32:16 -0000 1.8 *************** *** 154,158 **** if(ddrawDLL != NULL) { ! AfxFreeLibrary(ddrawDLL); ddrawDLL = NULL; } --- 154,162 ---- if(ddrawDLL != NULL) { ! #ifdef _AFXDLL ! AfxFreeLibrary( ddrawDLL ); ! #else ! FreeLibrary( ddrawDLL ); ! #endif ddrawDLL = NULL; } *************** *** 266,270 **** guid = theApp.pVideoDriverGUID; ! ddrawDLL = AfxLoadLibrary("DDRAW.DLL"); HRESULT (WINAPI *DDrawCreateEx)(GUID *,LPVOID *,REFIID,IUnknown *); if(ddrawDLL != NULL) { --- 270,279 ---- guid = theApp.pVideoDriverGUID; ! #ifdef _AFXDLL ! ddrawDLL = AfxLoadLibrary("ddraw.dll"); ! #else ! ddrawDLL = LoadLibrary( _T("ddraw.dll") ); ! #endif ! HRESULT (WINAPI *DDrawCreateEx)(GUID *,LPVOID *,REFIID,IUnknown *); if(ddrawDLL != NULL) { |