Commit 02503e95 authored by Dino Bollinger's avatar Dino Bollinger
Browse files

KenBuild: Fix building on Linux with GTK Startup Window

Also changes the case of the hardcoded strings "STUFF.DAT" and
"NUKELAND.MAP" to match the file case in the download on Ken's website.
parent cb6f5158
......@@ -90,6 +90,12 @@ typedef void (*gtk_container_set_border_width_ptr) (GtkContainer *container, gui
typedef GType (*gtk_dialog_get_type_ptr) (void) G_GNUC_CONST;
typedef gint (*gtk_dialog_run_ptr) (GtkDialog *dialog);
// gtkfixed.h
// TODO: Only needed to fix compilation for Kenbuild. Bring Kenbuild GTK window to parity with other windows, then remove this again.
typedef GType (*gtk_fixed_get_type_ptr) (void) G_GNUC_CONST;
typedef GtkWidget* (*gtk_fixed_new_ptr) (void);
typedef void (*gtk_fixed_put_ptr) (GtkFixed *fixed, GtkWidget *widget, gint x, gint y);
// gtkhbox.h
typedef GtkWidget* (*gtk_hbox_new_ptr) (gboolean homogeneous, gint spacing);
......@@ -223,6 +229,7 @@ typedef GtkWidget* (*gtk_widget_ref_ptr) (GtkWidget *widget);
typedef void (*gtk_widget_set_sensitive_ptr) (GtkWidget *widget, gboolean sensitive);
typedef void (*gtk_widget_set_size_request_ptr) (GtkWidget *widget, gint width, gint height);
typedef void (*gtk_widget_show_all_ptr) (GtkWidget *widget);
typedef void (*gtk_widget_show_ptr) (GtkWidget *widget);
typedef void (*gtk_widget_unref_ptr) (GtkWidget *widget);
// gtkwindow.h
......@@ -279,6 +286,9 @@ struct _dynamicgtksyms {
gtk_container_set_border_width_ptr gtk_container_set_border_width;
gtk_dialog_get_type_ptr gtk_dialog_get_type;
gtk_dialog_run_ptr gtk_dialog_run;
gtk_fixed_get_type_ptr gtk_fixed_get_type;
gtk_fixed_new_ptr gtk_fixed_new;
gtk_fixed_put_ptr gtk_fixed_put;
gtk_hbox_new_ptr gtk_hbox_new;
gtk_hbutton_box_new_ptr gtk_hbutton_box_new;
gtk_image_new_from_pixbuf_ptr gtk_image_new_from_pixbuf;
......@@ -365,6 +375,7 @@ struct _dynamicgtksyms {
gtk_widget_set_sensitive_ptr gtk_widget_set_sensitive;
gtk_widget_set_size_request_ptr gtk_widget_set_size_request;
gtk_widget_show_all_ptr gtk_widget_show_all;
gtk_widget_show_ptr gtk_widget_show;
gtk_widget_unref_ptr gtk_widget_unref;
gtk_window_add_accel_group_ptr gtk_window_add_accel_group;
gtk_window_get_type_ptr gtk_window_get_type;
......@@ -457,6 +468,12 @@ void dynamicgtk_uninit(void);
#define gtk_dialog_get_type dynamicgtksyms.gtk_dialog_get_type
#define gtk_dialog_run dynamicgtksyms.gtk_dialog_run
// gtkfixed.h
// TODO: Only needed to fix compilation for Kenbuild. Bring Kenbuild GTK window to parity with other windows, then remove this again.
#define gtk_fixed_get_type dynamicgtksyms.gtk_fixed_get_type
#define gtk_fixed_new dynamicgtksyms.gtk_fixed_new
#define gtk_fixed_put dynamicgtksyms.gtk_fixed_put
// gtkhbox.h
#define gtk_hbox_new dynamicgtksyms.gtk_hbox_new
......@@ -588,6 +605,7 @@ void dynamicgtk_uninit(void);
#define gtk_widget_set_sensitive dynamicgtksyms.gtk_widget_set_sensitive
#define gtk_widget_set_size_request dynamicgtksyms.gtk_widget_set_size_request
#define gtk_widget_show_all dynamicgtksyms.gtk_widget_show_all
#define gtk_widget_show dynamicgtksyms.gtk_widget_show
#define gtk_widget_unref dynamicgtksyms.gtk_widget_unref
// gtkwindow.h
......
......@@ -71,6 +71,9 @@ int32_t dynamicgtk_init(void)
GETDLSYM(gtk_container_set_border_width)
GETDLSYM(gtk_dialog_get_type)
GETDLSYM(gtk_dialog_run)
GETDLSYM(gtk_fixed_get_type)
GETDLSYM(gtk_fixed_new)
GETDLSYM(gtk_fixed_put)
GETDLSYM(gtk_hbox_new)
GETDLSYM(gtk_hbutton_box_new)
GETDLSYM(gtk_image_new_from_pixbuf)
......@@ -157,6 +160,7 @@ int32_t dynamicgtk_init(void)
GETDLSYM(gtk_widget_set_sensitive)
GETDLSYM(gtk_widget_set_size_request)
GETDLSYM(gtk_widget_show_all)
GETDLSYM(gtk_widget_show)
GETDLSYM(gtk_widget_unref)
GETDLSYM(gtk_window_add_accel_group)
GETDLSYM(gtk_window_get_type)
......
......@@ -5,7 +5,7 @@
#include "names.h"
#include "common_game.h"
static const char *defaultgrpfilename = "stuff.dat";
static const char *defaultgrpfilename = "STUFF.DAT";
static const char *defaultdeffilename = "kenbuild.def";
int g_useCwd;
......
......@@ -477,7 +477,7 @@ int32_t app_main(int32_t argc, char const * const * argv)
wm_setapptitle(AppProperName);
Bstrcpy(boardfilename, "nukeland.map");
Bstrcpy(boardfilename, "NUKELAND.MAP");
netparm = argc;
for (i=1; i<argc; i++)
{
......@@ -6432,7 +6432,7 @@ void drawtilebackground(/*int thex, int they,*/ short tilenum,
rotatesprite(x*xsiz<<16,y*ysiz<<16,65536L,0,tilenum,shade,dapalnum,8+16+64+128,cx1,cy1,cx2,cy2);
}
void M32RunScript(const char *s) { UNREFERENCED_PARAMETER(s); }
extern "C" void M32RunScript(const char *s) { UNREFERENCED_PARAMETER(s); }
void G_Polymer_UnInit(void) { }
void app_crashhandler(void) { }
......
......@@ -103,9 +103,9 @@ static void PopulateForm(void)
gtk_list_store_set(modes3d, &iter, 0,buf, 1,i, -1);
if (i == mode3d)
{
g_signal_handlers_block_by_func(box3d, on_vmode3dcombo_changed, NULL);
g_signal_handlers_block_by_func(box3d, (gpointer) on_vmode3dcombo_changed, NULL);
gtk_combo_box_set_active_iter(box3d, &iter);
g_signal_handlers_unblock_by_func(box3d, on_vmode3dcombo_changed, NULL);
g_signal_handlers_unblock_by_func(box3d, (gpointer) on_vmode3dcombo_changed, NULL);
}
}
}
......@@ -316,7 +316,7 @@ static GtkWidget *create_window(void)
GDK_C, GDK_MOD1_MASK,
GTK_ACCEL_VISIBLE);
gtk_widget_add_accelerator(cancelbutton, "clicked", accel_group,
GDK_Escape, 0,
GDK_Escape, (GdkModifierType)0,
GTK_ACCEL_VISIBLE);
cancelbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
......@@ -344,7 +344,7 @@ static GtkWidget *create_window(void)
GDK_S, GDK_MOD1_MASK,
GTK_ACCEL_VISIBLE);
gtk_widget_add_accelerator(startbutton, "clicked", accel_group,
GDK_Return, 0,
GDK_Return, (GdkModifierType)0,
GTK_ACCEL_VISIBLE);
startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
......@@ -422,7 +422,7 @@ static GtkWidget *create_window(void)
// -- BUILD ENTRY POINTS ------------------------------------------------------
bool startwin_isopen(void)
{
return gtkenabled && stwidgets.startwin;
return gtkenabled && startwin;
}
int startwin_open(void)
......@@ -527,8 +527,8 @@ int startwin_run(void)
SetPage(TAB_CONFIG);
settings.fullscreen = fullscreen;
settings.xdim3d = xdimgame;
settings.ydim3d = ydimgame;
settings.xdim3d = xdim;
settings.ydim3d = ydim;
settings.bpp3d = bppgame;
settings.forcesetup = forcesetup;
PopulateForm();
......@@ -539,8 +539,8 @@ int startwin_run(void)
if (retval)
{
fullscreen = settings.fullscreen;
xdimgame = settings.xdim3d;
ydimgame = settings.ydim3d;
xdim = settings.xdim3d;
ydim = settings.ydim3d;
bppgame = settings.bpp3d;
forcesetup = settings.forcesetup;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment