GTK: Fix warnings and errors related to the banners. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4770 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2014-11-28 23:47:46 +00:00
parent 32df15a254
commit e29e5bfbcb
8 changed files with 44 additions and 4973 deletions

View file

@ -183,7 +183,7 @@ TESTEDITOR_OBJS=bstub common
ifeq ($(RENDERTYPE),SDL) ifeq ($(RENDERTYPE),SDL)
ifeq (1,$(HAVE_GTK2)) ifeq (1,$(HAVE_GTK2))
TESTGAME_OBJS+= game_banner startgtk.game TESTGAME_OBJS+= game_banner startgtk.game
TESTEDITOR_OBJS+= editor_banner TESTEDITOR_OBJS+= build_banner
endif endif
TESTGAME_OBJS+= game_icon TESTGAME_OBJS+= game_icon
@ -321,7 +321,7 @@ endif
ifeq ($(RENDERTYPE),SDL) ifeq ($(RENDERTYPE),SDL)
ifeq (1,$(HAVE_GTK2)) ifeq (1,$(HAVE_GTK2))
DUKE3D_OBJS+= game_banner startgtk.game DUKE3D_OBJS+= game_banner startgtk.game
DUKE3D_EDITOR_OBJS+= editor_banner DUKE3D_EDITOR_OBJS+= build_banner
endif endif
DUKE3D_OBJS+= game_icon DUKE3D_OBJS+= game_icon
@ -590,13 +590,12 @@ $(DUKE3D_OBJ)/%.$o: $(DUKE3D_RSRC)/%.c | $(DUKE3D_OBJ)
$(COMPILE_STATUS) $(COMPILE_STATUS)
$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE) $(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
$(DUKE3D_RSRC)/game_banner.c: $(DUKE3D_RSRC)/game.bmp $(DUKE3D_RSRC)/%_banner.c: $(DUKE3D_RSRC)/%.bmp
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@ echo "#include \"gtkpixdata_shim.h\"" > $@
echo "extern const GdkPixdata startbanner_pixdata;" >> $@
gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@ gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
$(DUKE3D_RSRC)/editor_banner.c: $(DUKE3D_RSRC)/build.bmp
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@ $(TESTGAME_RSRC)/%_banner.c: $(TESTGAME_RSRC)/%.bmp
echo "extern const GdkPixdata startbanner_pixdata;" >> $@ echo "#include \"gtkpixdata_shim.h\"" > $@
gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@ gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
$(ENGINE_OBJ) $(AUDIOLIB_OBJ) $(ENET_OBJ) $(DUKE3D_OBJ) $(TESTGAME_OBJ): $(ENGINE_OBJ) $(AUDIOLIB_OBJ) $(ENET_OBJ) $(DUKE3D_OBJ) $(TESTGAME_OBJ):

View file

@ -0,0 +1,24 @@
#include <gdk-pixbuf/gdk-pixdata.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _EDuke32_GdkPixdata EDuke32_GdkPixdata;
struct _EDuke32_GdkPixdata
{
guint32 magic;
gint32 length;
guint32 pixdata_type;
guint32 rowstride;
guint32 width;
guint32 height;
const char *pixel_data;
};
extern const EDuke32_GdkPixdata startbanner_pixdata;
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,4 @@
#include "gtkpixdata.h"
#define GdkPixdata EDuke32_GdkPixdata

View file

@ -1,3 +1,6 @@
#include "gtkpixdata.h"
#if defined(LINKED_GTK) #if defined(LINKED_GTK)
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixdata.h> #include <gdk-pixbuf/gdk-pixdata.h>
@ -133,8 +136,7 @@ static gboolean on_startwin_delete_event(GtkWidget *widget, GdkEvent *event, gpo
static GdkPixbuf *load_banner(void) static GdkPixbuf *load_banner(void)
{ {
extern const GdkPixdata startbanner_pixdata; return gdk_pixbuf_from_pixdata((GdkPixdata*)&startbanner_pixdata, FALSE, NULL);
return gdk_pixbuf_from_pixdata(&startbanner_pixdata, FALSE, NULL);
} }
static void SetPage(int32_t n) static void SetPage(int32_t n)

View file

@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "gtkpixdata.h"
#if defined(LINKED_GTK) #if defined(LINKED_GTK)
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixdata.h> #include <gdk-pixbuf/gdk-pixdata.h>
@ -257,12 +259,10 @@ static gboolean on_startwin_delete_event(GtkWidget *widget, GdkEvent *event, gpo
// -- SUPPORT FUNCTIONS ------------------------------------------------------- // -- SUPPORT FUNCTIONS -------------------------------------------------------
extern const GdkPixdata startbanner_pixdata;
static GdkPixbuf *load_banner(void) static GdkPixbuf *load_banner(void)
{ {
extern const GdkPixdata startbanner_pixdata; return gdk_pixbuf_from_pixdata((GdkPixdata*)&startbanner_pixdata, FALSE, NULL);
return gdk_pixbuf_from_pixdata(&startbanner_pixdata, FALSE, NULL);
} }
static void SetPage(int32_t n) static void SetPage(int32_t n)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -10,6 +10,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "gtkpixdata.h"
#include <gdk-pixbuf/gdk-pixdata.h> #include <gdk-pixbuf/gdk-pixdata.h>
#include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
@ -51,8 +52,7 @@ static int retval = -1, mode = TAB_MESSAGES;
static GdkPixbuf *load_banner(void) static GdkPixbuf *load_banner(void)
{ {
extern const GdkPixdata startbanner_pixdata; return gdk_pixbuf_from_pixdata((GdkPixdata*)&startbanner_pixdata, FALSE, NULL);
return gdk_pixbuf_from_pixdata(&startbanner_pixdata, FALSE, NULL);
} }
static void SetPage(int n) static void SetPage(int n)