fix linux compiling and add hud to gtk. wont display anything until someone adds menu items for CommonOptions toggles, but it will eventually.

This commit is contained in:
zeromus 2009-07-12 03:43:28 +00:00
parent 2802c9a16f
commit dd05ece216
7 changed files with 22 additions and 6 deletions

View File

@ -50,7 +50,7 @@ bool IsHudDummy (HudCoordinates *hud)
void EditHud(s32 x, s32 y, HudStruct *hudstruct) {
UINT i = 0;
u32 i = 0;
while (!IsHudDummy(&hudstruct->hud(i))) {
HudCoordinates &hud = hudstruct->hud(i);
@ -89,7 +89,7 @@ void EditHud(s32 x, s32 y, HudStruct *hudstruct) {
void HudClickRelease(HudStruct *hudstruct) {
UINT i = 0;
u32 i = 0;
while (!IsHudDummy(&hudstruct->hud(i))) {
HudCoordinates &hud = hudstruct->hud(i);
@ -238,10 +238,12 @@ void DrawHUD()
osd->addFixed(Hud.LagFrameCounter.x, Hud.LagFrameCounter.y, "%d",TotalLagFrames);
}
#ifdef WIN32
if (CommonSettings.hud.ShowMicrophone)
{
osd->addFixed(Hud.Microphone.x, Hud.Microphone.y, "%d",MicDisplay);
}
#endif
DrawStateSlots();
}

View File

@ -478,6 +478,15 @@ copy_firmware_user_data( u8 *dest_buffer, const u8 *fw_data) {
return copy_good;
}
void Desmume_InitOnce()
{
static bool initOnce = false;
if(initOnce) return;
initOnce = true;
extern void Agg_init(); //no need to include just for this
Agg_init();
}
#ifdef GDB_STUB
int NDS_Init( struct armcpu_memory_iface *arm9_mem_if,

View File

@ -267,6 +267,8 @@ int NDS_Init( struct armcpu_memory_iface *arm9_mem_if,
int NDS_Init ( void);
#endif
void Desmume_InitOnce();
void NDS_DeInit(void);
void
NDS_FillDefaultFirmwareConfigData( struct NDS_fw_config_data *fw_config);

View File

@ -1,7 +1,7 @@
SUBDIRS = doc
include $(top_srcdir)/src/desmume.mk
AM_CPPFLAGS += $(SDL_CFLAGS) $(GTK_CFLAGS) $(GTHREAD_CFLAGS) $(ALSA_CFLAGS)
AM_CPPFLAGS += $(SDL_CFLAGS) $(GTK_CFLAGS) $(GTHREAD_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS)
Applicationsdir = $(datadir)/applications
Applications_DATA = desmume.desktop

View File

@ -46,6 +46,7 @@
#include "dTool.h"
#include "desmume_config.h"
#include "cheatsGTK.h"
#include "GPU_osd.h"
#include "commandline.h"
@ -1088,6 +1089,7 @@ static int ExposeDrawingArea (GtkWidget *widget, GdkEventExpose *event, gpointer
yd = yoff;
}
DrawHUD();
gpu_screen_to_rgb(rgb, SCREENS_PIXEL_SIZE*SCREEN_BYTES_PER_PIXEL);
origPixbuf = gdk_pixbuf_new_from_data(rgb, GDK_COLORSPACE_RGB,
0, 8, imgW, imgH, imgW*SCREEN_BYTES_PER_PIXEL, NULL, NULL);
@ -1742,6 +1744,7 @@ static gboolean timeout_exit_cb(gpointer data)
static int
common_gtk_main( struct configured_features *my_config)
{
Desmume_InitOnce();
SDL_TimerID limiter_timer = NULL;
GtkAccelGroup * accel_group;

View File

@ -6,9 +6,10 @@ extern int MicButtonPressed;
#ifdef WIN32
static char MicSampleName[256];
char* LoadSample(const char *name);
extern int MicDisplay;
#endif
extern int MicDisplay;
#ifdef FAKE_MIC
void Mic_DoNoise(BOOL);
#endif

View File

@ -1342,8 +1342,7 @@ std::string GetPrivateProfileStdString(LPCSTR lpAppName,LPCSTR lpKeyName,LPCSTR
int _main()
{
extern void Agg_init();
Agg_init();
Desmume_InitOnce();
InitDecoder();
#ifdef WX_STUB