Let desmume build without libagg

libagg is used only by the HUD but the usage of it
outside windows is pretty small. So just in case it is
not available we can live without it.
This commit is contained in:
riccardom 2010-02-17 14:06:00 +00:00
parent 3573ce6248
commit 264b0987e8
8 changed files with 63 additions and 6 deletions

View File

@ -195,7 +195,7 @@ AM_CONDITIONAL([HAVE_LIBAGG], [test "${HAVE_LIBAGG}" = "yes"])
if test "x$HAVE_LIBAGG" = "xyes"; then
AC_DEFINE([HAVE_LIBAGG])
else
AC_MSG_ERROR([Antigrain library is required to build desmume])
AC_MSG_WARN([Antigrain library not found, HUD will be disabled])
fi
if test "x$FOUND_GLIB" = "xno"; then

View File

@ -24,9 +24,11 @@
#ifndef __GPU_OSD_
#define __GPU_OSD_
#include "types.h"
#ifdef HAVE_LIBAGG
#include <stdlib.h>
#include <time.h>
#include "types.h"
#include "aggdraw.h"
@ -125,4 +127,19 @@ public:
};
extern OSDCLASS *osd;
#else /* HAVE_LIBAGG */
void DrawHUD();
class OSDCLASS {
public:
OSDCLASS(u8 core);
~OSDCLASS();
void update();
void clear();
void setLineColor(u8 r, u8 b, u8 g);
void addLine(const char *fmt, ...);
};
extern OSDCLASS *osd;
#endif
#endif

View File

@ -0,0 +1,32 @@
/* Copyright (C) 2006-2010 DeSmumE team
This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "types.h"
#include "GPU_osd.h"
OSDCLASS *osd;
OSDCLASS::OSDCLASS(u8 core) {}
OSDCLASS::~OSDCLASS() {}
void OSDCLASS::update() {}
void OSDCLASS::clear() {}
void OSDCLASS::setLineColor(u8 r, u8 b, u8 g) {}
void OSDCLASS::addLine(const char *fmt, ...) {}
void DrawHUD() {}

View File

@ -1,6 +1,6 @@
include $(top_srcdir)/src/desmume.mk
AM_CPPFLAGS += $(SDL_CFLAGS) $(GTHREAD_CFLAGS) $(X_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS)
AM_CPPFLAGS += $(SDL_CFLAGS) $(GTHREAD_CFLAGS) $(X_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS)
EXTRA_DIST = build.bat instruction_tabdef.inc thumb_tabdef.inc fs-linux.cpp fs-windows.cpp
if HAVE_GDB_STUB
@ -14,7 +14,6 @@ libdesmume_a_SOURCES = \
armcpu.cpp armcpu.h \
arm_instructions.cpp arm_instructions.h \
agg2d.h agg2d.inl \
aggdraw.cpp aggdraw.h \
bios.cpp bios.h bits.h cp15.cpp cp15.h \
commandline.h commandline.cpp \
common.cpp common.h \
@ -22,7 +21,7 @@ libdesmume_a_SOURCES = \
Disassembler.cpp Disassembler.h \
emufile.h emufile.cpp fat.h FIFO.cpp FIFO.h \
firmware.cpp firmware.h GPU.cpp GPU.h \
GPU_osd.cpp GPU_osd.h \
GPU_osd.h \
mem.h mc.cpp mc.h \
path.h \
readwrite.cpp readwrite.h \
@ -66,7 +65,9 @@ endif
endif
if HAVE_LIBAGG
libdesmume_a_SOURCES += aggdraw.cpp
libdesmume_a_SOURCES += aggdraw.cpp aggdraw.h GPU_osd.cpp
else
libdesmume_a_SOURCES += GPU_osd_stub.cpp
endif
if HAVE_LUA
AM_CPPFLAGS += $(LUA_CFLAGS)

View File

@ -73,8 +73,10 @@ void Desmume_InitOnce()
if(initOnce) return;
initOnce = true;
#ifdef HAVE_LIBAGG
extern void Agg_init(); //no need to include just for this
Agg_init();
#endif
}
#ifdef GDB_STUB

View File

@ -825,9 +825,11 @@ int main(int argc, char ** argv) {
loadstate_slot(my_config.load_slot);
}
#ifdef HAVE_LIBAGG
Desmume_InitOnce();
Hud.reset();
aggDraw.hud->attach(GPU_screen, 256, 384, 512);
#endif
while(!sdl_quit) {
desmume_cycle(&sdl_quit, &boost, &my_config);

View File

@ -2043,9 +2043,11 @@ common_gtk_main( struct configured_features *my_config)
my_config->disable_sound);
/* Init the hud / osd stuff */
#ifdef HAVE_LIBAGG
Desmume_InitOnce();
Hud.reset();
aggDraw.hud->attach(GPU_screen, 256, 384, 512);
#endif
/*
* Activate the GDB stubs

View File

@ -34,6 +34,7 @@
#ifdef _MSC_VER
#define HAVE_WX
#define HAVE_LIBAGG
#define ENABLE_SSE
#define ENABLE_SSE2
#ifdef DEVELOPER