mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-02-12 03:30:48 +00:00
Small changes to improve compatibility with GCC. (PR #902)
* Fix GCC build. 1) do not fwd declare enums 2) include only base class header file IPropertySheet. * DSInit(): make sure sound devices are cleaned before the 2nd call. And use std::string to avoid need of memory management.
This commit is contained in:
parent
6cf907f303
commit
b226bdfd53
@ -11,7 +11,7 @@
|
|||||||
#include "Video.h"
|
#include "Video.h"
|
||||||
Video& GetVideo(void);
|
Video& GetVideo(void);
|
||||||
|
|
||||||
#include "Configuration/PropertySheet.h"
|
#include "Configuration/IPropertySheet.h"
|
||||||
IPropertySheet& GetPropertySheet(void);
|
IPropertySheet& GetPropertySheet(void);
|
||||||
|
|
||||||
#include "FrameBase.h"
|
#include "FrameBase.h"
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "Video.h"
|
||||||
|
|
||||||
// Globals (Public)
|
// Globals (Public)
|
||||||
extern uint16_t g_nVideoClockVert;
|
extern uint16_t g_nVideoClockVert;
|
||||||
extern uint16_t g_nVideoClockHorz;
|
extern uint16_t g_nVideoClockHorz;
|
||||||
@ -21,7 +23,6 @@
|
|||||||
extern void NTSC_VideoUpdateCycles( UINT cycles6502 );
|
extern void NTSC_VideoUpdateCycles( UINT cycles6502 );
|
||||||
extern void NTSC_VideoRedrawWholeScreen( void );
|
extern void NTSC_VideoRedrawWholeScreen( void );
|
||||||
|
|
||||||
enum VideoRefreshRate_e;
|
|
||||||
void NTSC_SetRefreshRate(VideoRefreshRate_e rate);
|
void NTSC_SetRefreshRate(VideoRefreshRate_e rate);
|
||||||
UINT NTSC_GetCyclesPerFrame(void);
|
UINT NTSC_GetCyclesPerFrame(void);
|
||||||
UINT NTSC_GetCyclesPerLine(void);
|
UINT NTSC_GetCyclesPerLine(void);
|
||||||
|
@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
|
|
||||||
#define MAX_SOUND_DEVICES 10
|
#define MAX_SOUND_DEVICES 10
|
||||||
|
|
||||||
static char *sound_devices[MAX_SOUND_DEVICES];
|
static std::string sound_devices[MAX_SOUND_DEVICES];
|
||||||
static GUID sound_device_guid[MAX_SOUND_DEVICES];
|
static GUID sound_device_guid[MAX_SOUND_DEVICES];
|
||||||
static int num_sound_devices = 0;
|
static int num_sound_devices = 0;
|
||||||
|
|
||||||
@ -67,7 +67,9 @@ static BOOL CALLBACK DSEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrv
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
if(lpGUID != NULL)
|
if(lpGUID != NULL)
|
||||||
memcpy(&sound_device_guid[i], lpGUID, sizeof (GUID));
|
memcpy(&sound_device_guid[i], lpGUID, sizeof (GUID));
|
||||||
sound_devices[i] = _strdup(lpszDesc);
|
else
|
||||||
|
memset(&sound_device_guid[i], 0, sizeof(GUID));
|
||||||
|
sound_devices[i] = lpszDesc;
|
||||||
|
|
||||||
if(g_fh) fprintf(g_fh, "%d: %s - %s\n",i,lpszDesc,lpszDrvName);
|
if(g_fh) fprintf(g_fh, "%d: %s - %s\n",i,lpszDesc,lpszDrvName);
|
||||||
|
|
||||||
@ -491,6 +493,7 @@ bool DSInit()
|
|||||||
return true; // Already initialised successfully
|
return true; // Already initialised successfully
|
||||||
}
|
}
|
||||||
|
|
||||||
|
num_sound_devices = 0;
|
||||||
HRESULT hr = DirectSoundEnumerate((LPDSENUMCALLBACK)DSEnumProc, NULL);
|
HRESULT hr = DirectSoundEnumerate((LPDSENUMCALLBACK)DSEnumProc, NULL);
|
||||||
if(FAILED(hr))
|
if(FAILED(hr))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user