From 2c9aeac2d5e40cf1f704e016a26bff88066a6427 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 14 Nov 2009 02:30:47 +0000 Subject: [PATCH] A bunch of crap I meant to commit days ago... gtk startup window patch from bioman, nedmalloc REPLACE_SYSTEM_ALLOCATOR fix (related code uses #ifdef REPLACE_SYSTEM_ALLOCATOR so defining it to 0 was still satisfying the condition), slightly lower CPU usage in Mapster 2D mode, fix an ancient bug causing the player to not make vent footstep sounds on sprite based vents, fix map save state cvars, add "skill" cvar to console, fix saving the game while CON_SHOWVIEW is in use git-svn-id: https://svn.eduke32.com/eduke32@1540 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile | 4 +- polymer/eduke32/build/Makefile | 4 +- polymer/eduke32/build/include/build.h | 6 +- polymer/eduke32/build/include/compat.h | 2 +- polymer/eduke32/build/include/dynamicgtk.h | 40 +- polymer/eduke32/build/src/build.c | 414 +++++----- polymer/eduke32/build/src/cache1d.c | 2 +- polymer/eduke32/build/src/dynamicgtk.c | 10 +- polymer/eduke32/build/src/kplib.c | 2 +- polymer/eduke32/build/src/nedmalloc.c | 2 +- polymer/eduke32/build/src/polymer.c | 3 +- polymer/eduke32/build/src/startgtk.editor.c | 579 ++++++-------- polymer/eduke32/build/src/winlayer.c | 7 +- polymer/eduke32/eduke32.vcproj | 8 - polymer/eduke32/source/actors.c | 2 +- polymer/eduke32/source/astub.c | 62 +- polymer/eduke32/source/game.c | 4 +- polymer/eduke32/source/gameexec.c | 8 +- polymer/eduke32/source/gamevars.c | 10 +- polymer/eduke32/source/global.c | 2 +- polymer/eduke32/source/m32def.c | 4 +- polymer/eduke32/source/osdcmds.c | 9 + polymer/eduke32/source/player.c | 15 +- polymer/eduke32/source/premap.c | 4 +- polymer/eduke32/source/startgtk.game.c | 828 +++++++++----------- 25 files changed, 914 insertions(+), 1117 deletions(-) diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 03bc7eac1..67b5e184a 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -136,7 +136,7 @@ EDITOROBJS=$(OBJ)/astub.$o \ ifeq ($(PLATFORM),LINUX) OURCFLAGS += -fno-pic NASMFLAGS += -f elf - LIBS += -lvorbisfile -lvorbis -logg + LIBS += -lvorbisfile -lvorbis -logg endif ifeq ($(PLATFORM),DARWIN) @@ -312,4 +312,4 @@ clean: -rm -f $(OBJ)/* eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) core* duke3d_w32$(EXESUFFIX) && $(MAKE) -C $(JAUDIOLIBDIR) clean veryclean: clean - -rm -f $(EOBJ)/* + -rm -f $(EOBJ)/* $(RSRC)/*banner* diff --git a/polymer/eduke32/build/Makefile b/polymer/eduke32/build/Makefile index 2f8fec3a9..73c7a2c6e 100644 --- a/polymer/eduke32/build/Makefile +++ b/polymer/eduke32/build/Makefile @@ -97,8 +97,8 @@ ifeq (4,$(GCC_MAJOR)) endif endif -OURCFLAGS=$(debug) -W -Wall -Wimplicit -Wno-char-subscripts \ - -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS \ +OURCFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \ + -Wno-char-subscripts -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS \ -DKSFORBUILD -I$(INC) -D_FORTIFY_SOURCE=2 \ -fjump-tables -fno-stack-protector # -march=pentium3 -mtune=generic -mmmx -m3dnow -msse -mfpmath=sse diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index c94764c69..9531ab9a6 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -322,13 +322,13 @@ SPRITE VARIABLES: EXTERN short nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES]; Example: if the linked lists look like the following: - ???????????????????????????????? + ???????????????? Sector lists: Status lists: - ???????????????????????????????J + ????????????????J Sector0: 4, 5, 8 Status0: 2, 0, 8 Sector1: 16, 2, 0, 7 Status1: 4, 5, 16, 7, 3, 9 Sector2: 3, 9 - ???????????????????????????????? + ???????????????? Notice that each number listed above is shown exactly once on both the left and right side. This is because any sprite that exists must be in some sector, and must have some kind of status that you define. diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index b241374d7..318ed8543 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -36,7 +36,7 @@ #endif #define USE_ALLOCATOR 1 -#define REPLACE_SYSTEM_ALLOCATOR 0 +// #define REPLACE_SYSTEM_ALLOCATOR #define USE_MAGIC_HEADERS 0 #include "nedmalloc.h" diff --git a/polymer/eduke32/build/include/dynamicgtk.h b/polymer/eduke32/build/include/dynamicgtk.h index f606dd50a..009b68da7 100644 --- a/polymer/eduke32/build/include/dynamicgtk.h +++ b/polymer/eduke32/build/include/dynamicgtk.h @@ -140,14 +140,6 @@ void (*gtk_container_set_border_width) (GtkContainer *container, GType (*gtk_dialog_get_type) (void) G_GNUC_CONST; gint (*gtk_dialog_run) (GtkDialog *dialog); - // gtkfixed.h -GType (*gtk_fixed_get_type) (void) G_GNUC_CONST; -GtkWidget* (*gtk_fixed_new) (void); -void (*gtk_fixed_put) (GtkFixed *fixed, - GtkWidget *widget, - gint x, - gint y); - // gtkhbox.h GtkWidget* (*gtk_hbox_new) (gboolean homogeneous, gint spacing); @@ -224,6 +216,22 @@ void (*gtk_scrolled_window_set_policy) (GtkScrolledWindow *scro GtkPolicyType vscrollbar_policy); void (*gtk_scrolled_window_set_shadow_type) (GtkScrolledWindow *scrolled_window, GtkShadowType type); + // gtktable.h +GType (*gtk_table_get_type) (void) G_GNUC_CONST; +GtkWidget* (*gtk_table_new) (guint rows, + guint columns, + gboolean homogeneous); +void (*gtk_table_attach) (GtkTable *table, + GtkWidget *child, + guint left_attach, + guint right_attach, + guint top_attach, + guint bottom_attach, + GtkAttachOptions xoptions, + GtkAttachOptions yoptions, + guint xpadding, + guint ypadding); + // gtktextbuffer.h gboolean (*gtk_text_buffer_backspace) (GtkTextBuffer *buffer, @@ -245,7 +253,7 @@ void (*gtk_text_buffer_insert) (GtkTextBuffer *buffer, // gtktextiter.h // FIXME: should I put a #if !GTK_CHECK_VERSION(2,6,0) - // around these three, or should I not care?? + // around these three, or should I not care? gboolean (*gtk_text_iter_backward_cursor_position) (GtkTextIter *iter); gboolean (*gtk_text_iter_equal) (const GtkTextIter *lhs, const GtkTextIter *rhs); @@ -352,7 +360,7 @@ void (*gtk_widget_set_sensitive) (GtkWidget *widget void (*gtk_widget_set_size_request) (GtkWidget *widget, gint width, gint height); -void (*gtk_widget_show) (GtkWidget *widget); +void (*gtk_widget_show_all) (GtkWidget *widget); void (*gtk_widget_unref) (GtkWidget *widget); // gtkwindow.h @@ -451,11 +459,6 @@ void dynamicgtk_uninit(void); #define gtk_dialog_get_type dynamicgtksyms.gtk_dialog_get_type #define gtk_dialog_run dynamicgtksyms.gtk_dialog_run -// gtkfixed.h -#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 @@ -510,6 +513,11 @@ void dynamicgtk_uninit(void); #define gtk_scrolled_window_set_policy dynamicgtksyms.gtk_scrolled_window_set_policy #define gtk_scrolled_window_set_shadow_type dynamicgtksyms.gtk_scrolled_window_set_shadow_type +// gtktable.h +#define gtk_table_get_type dynamicgtksyms.gtk_table_get_type +#define gtk_table_new dynamicgtksyms.gtk_table_new +#define gtk_table_attach dynamicgtksyms.gtk_table_attach + // gtktextbuffer.h #define gtk_text_buffer_backspace dynamicgtksyms.gtk_text_buffer_backspace #define gtk_text_buffer_create_mark dynamicgtksyms.gtk_text_buffer_create_mark @@ -576,7 +584,7 @@ void dynamicgtk_uninit(void); #define gtk_widget_ref dynamicgtksyms.gtk_widget_ref #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 dynamicgtksyms.gtk_widget_show +#define gtk_widget_show_all dynamicgtksyms.gtk_widget_show_all #define gtk_widget_unref dynamicgtksyms.gtk_widget_unref // gtkwindow.h diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index ce48bfc17..1481c2c4c 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -1198,7 +1198,7 @@ void overheadeditor(void) char buffer[80], *dabuffer, ch; int32_t i, j, k, m=0, mousxplc, mousyplc, firstx=0, firsty=0, oposz, col; int32_t tempint, tempint1, tempint2, doubvel; - int32_t startwall=0, endwall, dax, day, daz, x1, y1, x2, y2, x3, y3, x4, y4; + int32_t startwall=0, endwall, dax, day, x1, y1, x2, y2, x3, y3, x4, y4; int32_t highlightx1, highlighty1, highlightx2, highlighty2, xvect, yvect; int16_t pag, suckwall=0, sucksect, newnumwalls, newnumsectors, split=0, bad; int16_t splitsect=0, danumwalls, secondstartwall, joinsector[2], joinsectnum; @@ -1294,8 +1294,7 @@ void overheadeditor(void) } } - if (!graphicsmode) - idle(); + idle(); OSD_DispatchQueued(); if (totalclock < 120*3) @@ -1380,240 +1379,243 @@ void overheadeditor(void) numwalls = newnumwalls; if (numwalls < 0) numwalls = tempint; - clear2dscreen(); + if (keystatus[buildkeys[BK_MOVEUP]] || keystatus[buildkeys[BK_MOVEDOWN]] || mousx || mousy || bstatus || (totalclock & 8) == 0) + { + clear2dscreen(); - if (graphicsmode) - { - int32_t ii = xyaspect; + if (graphicsmode) + { + int32_t ii = xyaspect; - i = yxaspect; - Bmemset(show2dsector, 255, sizeof(show2dsector)); - setview(0, 0, xdim-1, ydim16-1); - yxaspect = xyaspect = 65536; + i = yxaspect; + Bmemset(show2dsector, 255, sizeof(show2dsector)); + setview(0, 0, xdim-1, ydim16-1); + yxaspect = xyaspect = 65536; - if (graphicsmode == 2) - totalclocklock = totalclock; + if (graphicsmode == 2) + totalclocklock = totalclock; - drawmapview(pos.x, pos.y + scale((65536/zoom), ydim, 240), zoom, 1536); - yxaspect = i; - xyaspect = ii; - } + drawmapview(pos.x, pos.y + scale((65536/zoom), ydim, 240), zoom, 1536); + yxaspect = i; + xyaspect = ii; + } - draw2dgrid(pos.x,pos.y,ang,zoom,grid); + draw2dgrid(pos.x,pos.y,ang,zoom,grid); - ExtPreCheckKeys(); + ExtPreCheckKeys(); - x2 = mulscale14(startposx-pos.x,zoom); //Draw brown arrow (start) - y2 = mulscale14(startposy-pos.y,zoom); - if (((halfxdim16+x2) >= 2) && ((halfxdim16+x2) <= xdim-3)) - if (((midydim16+y2) >= 2) && ((midydim16+y2) <= ydim16-3)) - { - x1 = mulscale11(sintable[(startang+2560)&2047],zoom) / 768; - y1 = mulscale11(sintable[(startang+2048)&2047],zoom) / 768; - begindrawing(); //{{{ - drawline16((halfxdim16+x2)+x1,(midydim16+y2)+y1,(halfxdim16+x2)-x1,(midydim16+y2)-y1,editorcolors[2]); - drawline16((halfxdim16+x2)+x1,(midydim16+y2)+y1,(halfxdim16+x2)+y1,(midydim16+y2)-x1,editorcolors[2]); - drawline16((halfxdim16+x2)+x1,(midydim16+y2)+y1,(halfxdim16+x2)-y1,(midydim16+y2)+x1,editorcolors[2]); - enddrawing(); //}}} - } + x2 = mulscale14(startposx-pos.x,zoom); //Draw brown arrow (start) + y2 = mulscale14(startposy-pos.y,zoom); + if (((halfxdim16+x2) >= 2) && ((halfxdim16+x2) <= xdim-3)) + if (((midydim16+y2) >= 2) && ((midydim16+y2) <= ydim16-3)) + { + x1 = mulscale11(sintable[(startang+2560)&2047],zoom) / 768; + y1 = mulscale11(sintable[(startang+2048)&2047],zoom) / 768; + begindrawing(); //{{{ + drawline16((halfxdim16+x2)+x1,(midydim16+y2)+y1,(halfxdim16+x2)-x1,(midydim16+y2)-y1,editorcolors[2]); + drawline16((halfxdim16+x2)+x1,(midydim16+y2)+y1,(halfxdim16+x2)+y1,(midydim16+y2)-x1,editorcolors[2]); + drawline16((halfxdim16+x2)+x1,(midydim16+y2)+y1,(halfxdim16+x2)-y1,(midydim16+y2)+x1,editorcolors[2]); + enddrawing(); //}}} + } - draw2dscreen(pos.x,pos.y,ang,zoom,grid); - X_OnEvent(EVENT_DRAW2DSCREEN, -1); + draw2dscreen(pos.x,pos.y,ang,zoom,grid); + X_OnEvent(EVENT_DRAW2DSCREEN, -1); - begindrawing(); //{{{ - if (showtags == 1) - { - if (zoom >= 768) - for (i=0; i startwall) - { - dax /= (endwall-startwall+1); - day /= (endwall-startwall+1); - } + begindrawing(); //{{{ + if (showtags == 1) + { + if (zoom >= 768) + for (i=0; i startwall) + { + dax /= (endwall-startwall+1); + day /= (endwall-startwall+1); + } - dax = mulscale14(dax-pos.x,zoom); - day = mulscale14(day-pos.y,zoom); + dax = mulscale14(dax-pos.x,zoom); + day = mulscale14(day-pos.y,zoom); - x1 = halfxdim16+dax-(Bstrlen(dabuffer)<<1); - y1 = midydim16+day-4; - x2 = x1 + (Bstrlen(dabuffer)<<2)+2; - y2 = y1 + 7; - if ((x1 > 3) && (x2 < xdim) && (y1 > 1) && (y2 < ydim16)) - { - printext16(x1,y1,editorcolors[0],editorcolors[7],dabuffer,1); - drawline16(x1-1,y1-1,x2-3,y1-1,editorcolors[7]); - drawline16(x1-1,y2+1,x2-3,y2+1,editorcolors[7]); + x1 = halfxdim16+dax-(Bstrlen(dabuffer)<<1); + y1 = midydim16+day-4; + x2 = x1 + (Bstrlen(dabuffer)<<2)+2; + y2 = y1 + 7; + if ((x1 > 3) && (x2 < xdim) && (y1 > 1) && (y2 < ydim16)) + { + printext16(x1,y1,editorcolors[0],editorcolors[7],dabuffer,1); + drawline16(x1-1,y1-1,x2-3,y1-1,editorcolors[7]); + drawline16(x1-1,y2+1,x2-3,y2+1,editorcolors[7]); - drawline16(x1-2,y1,x1-2,y2,editorcolors[7]); - drawline16(x2-2,y1,x2-2,y2,editorcolors[7]); - drawline16(x2-3,y1,x2-3,y2,editorcolors[7]); - } - } - } + drawline16(x1-2,y1,x1-2,y2,editorcolors[7]); + drawline16(x2-2,y1,x2-2,y2,editorcolors[7]); + drawline16(x2-3,y1,x2-3,y2,editorcolors[7]); + } + } + } - x3 = divscale14(-halfxdim16,zoom)+pos.x; - y3 = divscale14(-(midydim16-4),zoom)+pos.y; - x4 = divscale14(halfxdim16,zoom)+pos.x; - y4 = divscale14(ydim16-(midydim16-4),zoom)+pos.y; + x3 = divscale14(-halfxdim16,zoom)+pos.x; + y3 = divscale14(-(midydim16-4),zoom)+pos.y; + x4 = divscale14(halfxdim16,zoom)+pos.x; + y4 = divscale14(ydim16-(midydim16-4),zoom)+pos.y; - if (newnumwalls >= 0) - { - for (i=newnumwalls; i>=tempint; i--) - wall[i].cstat |= (1<<14); - } + if (newnumwalls >= 0) + { + for (i=newnumwalls; i>=tempint; i--) + wall[i].cstat |= (1<<14); + } - i = numwalls-1; - if (newnumwalls >= 0) i = newnumwalls-1; - for (wal=&wall[i]; i>=0; i--,wal--) - { - if (zoom < 768 && !(wal->cstat & (1<<14))) continue; - //Get average point of wall - dax = ((wal->x+wall[wal->point2].x)>>1); - day = ((wal->y+wall[wal->point2].y)>>1); - if ((dax > x3) && (dax < x4) && (day > y3) && (day < y4)) - { - dabuffer = (char *)ExtGetWallCaption(i); - if (dabuffer[0] != 0) - { - dax = mulscale14(dax-pos.x,zoom); - day = mulscale14(day-pos.y,zoom); - x1 = halfxdim16+dax-(Bstrlen(dabuffer)<<1); - y1 = midydim16+day-4; - x2 = x1 + (Bstrlen(dabuffer)<<2)+2; - y2 = y1 + 7; - if ((x1 > 3) && (x2 < xdim) && (y1 > 1) && (y2 < ydim16)) - { - printext16(x1,y1,editorcolors[0],editorcolors[31],dabuffer,1); - drawline16(x1-1,y1-1,x2-3,y1-1,editorcolors[31]); - drawline16(x1-1,y2+1,x2-3,y2+1,editorcolors[31]); + i = numwalls-1; + if (newnumwalls >= 0) i = newnumwalls-1; + for (wal=&wall[i]; i>=0; i--,wal--) + { + if (zoom < 768 && !(wal->cstat & (1<<14))) continue; + //Get average point of wall + dax = ((wal->x+wall[wal->point2].x)>>1); + day = ((wal->y+wall[wal->point2].y)>>1); + if ((dax > x3) && (dax < x4) && (day > y3) && (day < y4)) + { + dabuffer = (char *)ExtGetWallCaption(i); + if (dabuffer[0] != 0) + { + dax = mulscale14(dax-pos.x,zoom); + day = mulscale14(day-pos.y,zoom); + x1 = halfxdim16+dax-(Bstrlen(dabuffer)<<1); + y1 = midydim16+day-4; + x2 = x1 + (Bstrlen(dabuffer)<<2)+2; + y2 = y1 + 7; + if ((x1 > 3) && (x2 < xdim) && (y1 > 1) && (y2 < ydim16)) + { + printext16(x1,y1,editorcolors[0],editorcolors[31],dabuffer,1); + drawline16(x1-1,y1-1,x2-3,y1-1,editorcolors[31]); + drawline16(x1-1,y2+1,x2-3,y2+1,editorcolors[31]); - drawline16(x1-2,y1,x1-2,y2,editorcolors[31]); - drawline16(x2-2,y1,x2-2,y2,editorcolors[31]); - drawline16(x2-3,y1,x2-3,y2,editorcolors[31]); - } - } - } - } + drawline16(x1-2,y1,x1-2,y2,editorcolors[31]); + drawline16(x2-2,y1,x2-2,y2,editorcolors[31]); + drawline16(x2-3,y1,x2-3,y2,editorcolors[31]); + } + } + } + } - i = 0; j = numsprites; - if (zoom >= 768) - while ((j > 0) && (i < MAXSPRITES)) - { - if (sprite[i].statnum < MAXSTATUS) - { - dabuffer = (char *)ExtGetSpriteCaption(i); - if (dabuffer[0] != 0) - { - //Get average point of sprite - dax = sprite[i].x; - day = sprite[i].y; + i = 0; j = numsprites; + if (zoom >= 768) + while ((j > 0) && (i < MAXSPRITES)) + { + if (sprite[i].statnum < MAXSTATUS) + { + dabuffer = (char *)ExtGetSpriteCaption(i); + if (dabuffer[0] != 0) + { + //Get average point of sprite + dax = sprite[i].x; + day = sprite[i].y; - dax = mulscale14(dax-pos.x,zoom); - day = mulscale14(day-pos.y,zoom); - x1 = halfxdim16+dax-(Bstrlen(dabuffer)<<1); - y1 = midydim16+day-4; - x2 = x1 + (Bstrlen(dabuffer)<<2)+2; - y2 = y1 + 7; - if ((x1 > 3) && (x2 < xdim) && (y1 > 1) && (y2 < ydim16)) - { - col = 3; - if (spritecol2d[sprite[i].picnum][0]) - col = spritecol2d[sprite[i].picnum][0]; - if ((sprite[i].cstat&1) > 0) - { - col = 5; - if (spritecol2d[sprite[i].picnum][1]) - col = spritecol2d[sprite[i].picnum][1]; - } + dax = mulscale14(dax-pos.x,zoom); + day = mulscale14(day-pos.y,zoom); + x1 = halfxdim16+dax-(Bstrlen(dabuffer)<<1); + y1 = midydim16+day-4; + x2 = x1 + (Bstrlen(dabuffer)<<2)+2; + y2 = y1 + 7; + if ((x1 > 3) && (x2 < xdim) && (y1 > 1) && (y2 < ydim16)) + { + col = 3; + if (spritecol2d[sprite[i].picnum][0]) + col = spritecol2d[sprite[i].picnum][0]; + if ((sprite[i].cstat&1) > 0) + { + col = 5; + if (spritecol2d[sprite[i].picnum][1]) + col = spritecol2d[sprite[i].picnum][1]; + } - if ((i == pointhighlight-16384) && (totalclock & 32)) col += (2<<2); + if ((i == pointhighlight-16384) && (totalclock & 32)) col += (2<<2); - printext16(x1,y1,editorcolors[0],editorcolors[col],dabuffer,1); + printext16(x1,y1,editorcolors[0],editorcolors[col],dabuffer,1); - drawline16(x1-1,y1-1,x2-3,y1-1,editorcolors[col]); - drawline16(x1-1,y2+1,x2-3,y2+1,editorcolors[col]); + drawline16(x1-1,y1-1,x2-3,y1-1,editorcolors[col]); + drawline16(x1-1,y2+1,x2-3,y2+1,editorcolors[col]); - drawline16(x1-2,y1,x1-2,y2,editorcolors[col]); - drawline16(x2-2,y1,x2-2,y2,editorcolors[col]); - drawline16(x2-3,y1,x2-3,y2,editorcolors[col]); - } - } - j--; - } - i++; - } - } + drawline16(x1-2,y1,x1-2,y2,editorcolors[col]); + drawline16(x2-2,y1,x2-2,y2,editorcolors[col]); + drawline16(x2-3,y1,x2-3,y2,editorcolors[col]); + } + } + j--; + } + i++; + } + } - printcoords16(pos.x,pos.y,ang); + printcoords16(pos.x,pos.y,ang); - numwalls = tempint; + numwalls = tempint; - if (highlightsectorcnt > 0) - for (i=0; i 0) + for (i=0; i= 0)col = 11; + col = 15-((gridlock<<1)+gridlock); + if (joinsector[0] >= 0)col = 11; - drawline16(searchx,searchy-8,searchx,searchy-1,editorcolors[col]); - drawline16(searchx+1,searchy-8,searchx+1,searchy-1,editorcolors[col]); - drawline16(searchx,searchy+2,searchx,searchy+9,editorcolors[col]); - drawline16(searchx+1,searchy+2,searchx+1,searchy+9,editorcolors[col]); - drawline16(searchx-8,searchy,searchx-1,searchy,editorcolors[col]); - drawline16(searchx-8,searchy+1,searchx-1,searchy+1,editorcolors[col]); - drawline16(searchx+2,searchy,searchx+9,searchy,editorcolors[col]); - drawline16(searchx+2,searchy+1,searchx+9,searchy+1,editorcolors[col]); + drawline16(searchx,searchy-8,searchx,searchy-1,editorcolors[col]); + drawline16(searchx+1,searchy-8,searchx+1,searchy-1,editorcolors[col]); + drawline16(searchx,searchy+2,searchx,searchy+9,editorcolors[col]); + drawline16(searchx+1,searchy+2,searchx+1,searchy+9,editorcolors[col]); + drawline16(searchx-8,searchy,searchx-1,searchy,editorcolors[col]); + drawline16(searchx-8,searchy+1,searchx-1,searchy+1,editorcolors[col]); + drawline16(searchx+2,searchy,searchx+9,searchy,editorcolors[col]); + drawline16(searchx+2,searchy+1,searchx+9,searchy+1,editorcolors[col]); - //Draw the white pixel closest to mouse cursor on linehighlight - if (linehighlight>=0) - { - getclosestpointonwall(mousxplc,mousyplc,(int32_t)linehighlight,&dax,&day); - x2 = mulscale14(dax-pos.x,zoom); - y2 = mulscale14(day-pos.y,zoom); - if (wall[linehighlight].nextsector >= 0) - drawline16(halfxdim16+x2,midydim16+y2,halfxdim16+x2,midydim16+y2,editorcolors[15]); - else - drawline16(halfxdim16+x2,midydim16+y2,halfxdim16+x2,midydim16+y2,editorcolors[5]); - } - enddrawing(); //}}} + //Draw the white pixel closest to mouse cursor on linehighlight + if (linehighlight>=0) + { + getclosestpointonwall(mousxplc,mousyplc,(int32_t)linehighlight,&dax,&day); + x2 = mulscale14(dax-pos.x,zoom); + y2 = mulscale14(day-pos.y,zoom); + if (wall[linehighlight].nextsector >= 0) + drawline16(halfxdim16+x2,midydim16+y2,halfxdim16+x2,midydim16+y2,editorcolors[15]); + else + drawline16(halfxdim16+x2,midydim16+y2,halfxdim16+x2,midydim16+y2,editorcolors[5]); + } + enddrawing(); //}}} - OSD_Draw(); + OSD_Draw(); + } X_OnEvent(EVENT_PREKEYS2D, -1); ExtCheckKeys(); // TX 20050101, it makes more sense to have this here so keys can be overwritten with new functions in bstub.c diff --git a/polymer/eduke32/build/src/cache1d.c b/polymer/eduke32/build/src/cache1d.c index 516ce1d21..d4d83453b 100644 --- a/polymer/eduke32/build/src/cache1d.c +++ b/polymer/eduke32/build/src/cache1d.c @@ -93,7 +93,7 @@ void initcache(intptr_t dacachestart, int32_t dacachesize) // initcache((FP_OFF(pic)+15)&0xfffffff0,(cachesize-((-FP_OFF(pic))&15))&0xfffffff0); // // I'm not sure why it's necessary, but the code is making sure the - // cache starts on a multiple of 16 bytes?? -- SA + // cache starts on a multiple of 16 bytes? -- SA //printf("BEFORE: cachestart = %x, cachesize = %d\n", dacachestart, dacachesize); cachestart = ((uintptr_t)dacachestart+15)&~(uintptr_t)0xf; diff --git a/polymer/eduke32/build/src/dynamicgtk.c b/polymer/eduke32/build/src/dynamicgtk.c index 73a49abf3..393698e65 100644 --- a/polymer/eduke32/build/src/dynamicgtk.c +++ b/polymer/eduke32/build/src/dynamicgtk.c @@ -62,9 +62,6 @@ 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) @@ -95,13 +92,16 @@ int32_t dynamicgtk_init(void) GETDLSYM(gtk_scrolled_window_new) GETDLSYM(gtk_scrolled_window_set_policy) GETDLSYM(gtk_scrolled_window_set_shadow_type) + GETDLSYM(gtk_table_get_type) + GETDLSYM(gtk_table_new) + GETDLSYM(gtk_table_attach) GETDLSYM(gtk_text_buffer_backspace) GETDLSYM(gtk_text_buffer_create_mark) GETDLSYM(gtk_text_buffer_delete_mark) GETDLSYM(gtk_text_buffer_get_end_iter) GETDLSYM(gtk_text_buffer_insert) // FIXME: should I put a #if !GTK_CHECK_VERSION(2,6,0) - // around these three, or should I not care?? + // around these three, or should I not care? GETDLSYM(gtk_text_iter_backward_cursor_position) GETDLSYM(gtk_text_iter_equal) GETDLSYM(gtk_text_buffer_delete_interactive) @@ -142,7 +142,7 @@ int32_t dynamicgtk_init(void) GETDLSYM(gtk_widget_ref) GETDLSYM(gtk_widget_set_sensitive) GETDLSYM(gtk_widget_set_size_request) - GETDLSYM(gtk_widget_show) + GETDLSYM(gtk_widget_show_all) GETDLSYM(gtk_widget_unref) GETDLSYM(gtk_window_add_accel_group) GETDLSYM(gtk_window_get_type) diff --git a/polymer/eduke32/build/src/kplib.c b/polymer/eduke32/build/src/kplib.c index dcead14e4..d30f1ad71 100644 --- a/polymer/eduke32/build/src/kplib.c +++ b/polymer/eduke32/build/src/kplib.c @@ -1824,7 +1824,7 @@ static int32_t kgifrend(const char *kfilebuf, int32_t kfilelength, if (kfilebuf[10]&128) { cptr = ptr; ptr += paleng*3; } transcol = -1; while ((chunkind = *ptr++) == '!') - { //! 0xf9 leng flags ?? ?? transcol + { //! 0xf9 leng flags ? ? transcol if (ptr[0] == 0xf9) { if (ptr[2]&1) transcol = (int32_t)(((uint8_t)ptr[5])); } ptr++; do { i = *ptr++; ptr += i; } diff --git a/polymer/eduke32/build/src/nedmalloc.c b/polymer/eduke32/build/src/nedmalloc.c index ff8187c4a..d8b8738b5 100644 --- a/polymer/eduke32/build/src/nedmalloc.c +++ b/polymer/eduke32/build/src/nedmalloc.c @@ -37,7 +37,7 @@ DEALINGS IN THE SOFTWARE. /*#define FULLSANITYCHECKS*/ #define USE_ALLOCATOR 1 -#define REPLACE_SYSTEM_ALLOCATOR 0 +// #define REPLACE_SYSTEM_ALLOCATOR #define USE_MAGIC_HEADERS 0 #define MAXTHREADSINPOOL 1 #define FINEGRAINEDBINS 1 diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index a8086f33e..e6344b8ba 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -892,9 +892,8 @@ void polymer_drawmasks(void) bglEnable(GL_BLEND); bglEnable(GL_POLYGON_OFFSET_FILL); - while (spritesortcnt) + while (--spritesortcnt) { - spritesortcnt--; tspriteptr[spritesortcnt] = &tsprite[spritesortcnt]; polymer_drawsprite(spritesortcnt); } diff --git a/polymer/eduke32/build/src/startgtk.editor.c b/polymer/eduke32/build/src/startgtk.editor.c index ff8a5e3ff..9b3098e64 100644 --- a/polymer/eduke32/build/src/startgtk.editor.c +++ b/polymer/eduke32/build/src/startgtk.editor.c @@ -1,25 +1,50 @@ -/* NOTE: Glade will generate code for a dialogue box which you should - * then patch into this file whenever you make a change to the Glade - * template. - */ +#if defined(LINKED_GTK) + #include + #include +#else + #include "dynamicgtk.h" +#endif -#include -#include -#include -#include -#include -#include - -#include "dynamicgtk.h" - -#include "baselayer.h" -#include "compat.h" #include "build.h" #include "editor.h" #define TAB_CONFIG 0 #define TAB_MESSAGES 1 +static struct +{ + GtkWidget *startwin; + GtkWidget *hlayout; + GtkWidget *banner; + GtkWidget *vlayout; + GtkWidget *tabs; + GtkWidget *configvlayout; + GtkWidget *configtlayout; + GtkWidget *vmode2dlabel; + GtkWidget *vmode3dlabel; + GtkWidget *vmode2dcombo; + GtkWidget *vmode3dcombo; + GtkWidget *fullscreencheck; + GtkWidget *emptyhlayout; + GtkWidget *alwaysshowcheck; + GtkWidget *configtab; + GtkWidget *messagesscroll; + GtkWidget *messagestext; + GtkWidget *messagestab; + GtkWidget *buttons; + GtkWidget *cancelbutton; + GtkWidget *cancelbuttonalign; + GtkWidget *cancelbuttonlayout; + GtkWidget *cancelbuttonicon; + GtkWidget *cancelbuttonlabel; + GtkWidget *startbutton; + GtkWidget *startbuttonalign; + GtkWidget *startbuttonlayout; + GtkWidget *startbuttonicon; + GtkWidget *startbuttonlabel; + GtkAccelGroup *accel_group; +} stwidgets; + static struct { int32_t fullscreen; @@ -28,106 +53,9 @@ static struct int32_t forcesetup; } settings; -extern int32_t gtkenabled; - -static GtkWidget *startwin = NULL; static int32_t retval = -1, mode = TAB_MESSAGES; - -// -- SUPPORT FUNCTIONS ------------------------------------------------------- - -#define GLADE_HOOKUP_OBJECT(component,widget,name) \ - g_object_set_data_full (G_OBJECT (component), name, \ - gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) - -#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ - g_object_set_data (G_OBJECT (component), name, widget) - -#define lookup_widget(x,w) \ - (GtkWidget*) g_object_get_data(G_OBJECT(x), w) - -static GdkPixbuf *load_banner(void) -{ - extern const GdkPixdata startbanner_pixdata; - return gdk_pixbuf_from_pixdata(&startbanner_pixdata, FALSE, NULL); -} - -static void SetPage(int32_t n) -{ - if (!gtkenabled || !startwin) return; - mode = n; - gtk_notebook_set_current_page(GTK_NOTEBOOK(lookup_widget(startwin,"tabs")), n); - - // each control in the config page vertical layout plus the start button should be made (in)sensitive - if (n == TAB_CONFIG) n = TRUE; else n = FALSE; - gtk_widget_set_sensitive(lookup_widget(startwin,"startbutton"), n); - gtk_container_foreach(GTK_CONTAINER(lookup_widget(startwin,"configvlayout")), - (GtkCallback)gtk_widget_set_sensitive, (gpointer)n); -} - -static void on_vmode2dcombo_changed(GtkComboBox *, gpointer); -static void on_vmode3dcombo_changed(GtkComboBox *, gpointer); -static void PopulateForm(void) -{ - int32_t mode2d, mode3d, i; - GtkListStore *modes2d, *modes3d; - GtkTreeIter iter; - GtkComboBox *box2d, *box3d; - char buf[64]; - - mode2d = checkvideomode(&settings.xdim2d, &settings.ydim2d, 8, settings.fullscreen, 1); - mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, settings.bpp3d, settings.fullscreen, 1); - if (mode2d < 0) mode2d = 0; - if (mode3d < 0) - { - int32_t i, cd[] = { 32, 24, 16, 15, 8, 0 }; - for (i=0; cd[i];) { if (cd[i] >= settings.bpp3d) i++; else break; } - for (; cd[i]; i++) - { - mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1); - if (mode3d < 0) continue; - settings.bpp3d = cd[i]; - break; - } - } - - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lookup_widget(startwin,"fullscreencheck")), settings.fullscreen); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lookup_widget(startwin,"alwaysshowcheck")), settings.forcesetup); - - box2d = GTK_COMBO_BOX(lookup_widget(startwin,"vmode2dcombo")); - box3d = GTK_COMBO_BOX(lookup_widget(startwin,"vmode3dcombo")); - modes2d = GTK_LIST_STORE(gtk_combo_box_get_model(box2d)); - modes3d = GTK_LIST_STORE(gtk_combo_box_get_model(box3d)); - gtk_list_store_clear(modes2d); - gtk_list_store_clear(modes3d); - - for (i=0; i= settings.bpp3d) i++; else break; } + for (; cd[i]; i++) + { + mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1); + if (mode3d < 0) continue; + settings.bpp3d = cd[i]; + break; + } + } + + box2d = GTK_COMBO_BOX(stwidgets.vmode2dcombo); + box3d = GTK_COMBO_BOX(stwidgets.vmode3dcombo); + modes2d = GTK_LIST_STORE(gtk_combo_box_get_model(box2d)); + modes3d = GTK_LIST_STORE(gtk_combo_box_get_model(box3d)); + gtk_list_store_clear(modes2d); + gtk_list_store_clear(modes3d); + + for (i=0; i - - - - diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 17c11c648..97011658e 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -100,7 +100,7 @@ inline int32_t G_CheckForSpaceCeiling(int32_t sectnum) inline int32_t G_CheckForSpaceFloor(int32_t sectnum) { - return ((sector[sectnum].floorstat&1) && sector[sectnum].ceilingpal == 0 && ((sector[sectnum].floorpicnum==MOONSKY1)||(sector[sectnum].floorpicnum==BIGORBIT1))?1:0); + return ((sector[sectnum].floorstat&1) && sector[sectnum].floorpal == 0 && ((sector[sectnum].floorpicnum==MOONSKY1)||(sector[sectnum].floorpicnum==BIGORBIT1))?1:0); } void A_RadiusDamage(int32_t i, int32_t r, int32_t hp1, int32_t hp2, int32_t hp3, int32_t hp4) diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 614e5b44d..d0a2c9b96 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -491,66 +491,10 @@ void ExtLoadMap(const char *mapname) { int32_t i; int32_t sky=0; - int32_t j; getmessageleng = 0; getmessagetimeoff = 0; - // PreCache Wall Tiles - /* - for(j=0;j=0; j--) - { - / * if (tilesizx[sprite[j].picnum]==0 || tilesizy[sprite[j].picnum]==0) - sprite[j].picnum=0; * / - - if (sprite[j].picnum>=20 && sprite[j].picnum<=59) - { - if (sprite[j].picnum==26) - { - sprite[j].xrepeat = 8; - sprite[j].yrepeat = 8; - } - else - { - sprite[j].xrepeat = 32; - sprite[j].yrepeat = 32; - } - } - - } -*/ - Bstrcpy(levelname,mapname); pskyoff[0]=0; for (i=0; i<8; i++) pskyoff[i]=0; @@ -3165,7 +3109,7 @@ static int32_t m32gettile(int32_t idInitialTile) // Start of key handling code // //////////////////////////////// - while ((keystatus[KEYSC_ENTER]|keystatus[KEYSC_ESC]|(bstatus&1)) == 0) // <- Presumably one of these is escape key ??? + while ((keystatus[KEYSC_ENTER]|keystatus[KEYSC_ESC]|(bstatus&1)) == 0) // <- Presumably one of these is escape key ?? { DrawTiles(iTopLeftTile, (iTile >= localartlookupnum)?localartlookupnum-1:iTile, nXTiles, nYTiles, ZoomToThumbSize[s_Zoom],moffset); @@ -3330,7 +3274,7 @@ static int32_t m32gettile(int32_t idInitialTile) iTile = 0; } - if (iTile >= MAXTILES) // shouldn't this be the count of num tiles ??? + if (iTile >= MAXTILES) // shouldn't this be the count of num tiles ?? { iTile = MAXTILES-1; } @@ -8653,8 +8597,6 @@ static int32_t osdcmd_quit(const osdfuncparm_t *parm) uninitengine(); exit(0); - - return OSDCMD_OK; } static int32_t osdcmd_editorgridextent(const osdfuncparm_t *parm) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 50702ff38..6f893a899 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -103,7 +103,7 @@ static FILE *frecfilep = (FILE *)NULL; static int32_t demo_goalreccnt=0, demo_startreccnt=0, demo_oldsoundtoggle, demo_showstats=1; static int32_t demo_paused=0; -int32_t g_restorePalette, g_screenCapture; +int32_t g_restorePalette = 0, g_screenCapture = 0; static int32_t g_noLogoAnim = 0; static int32_t g_noLogo = 0; static int32_t g_chatPlayer = -1; @@ -3172,7 +3172,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 if ((spr->cstat&257) != 0) switch (spr->cstat&48) { case 0: - break; +// break; ox = sprx-cposx; oy = spry-cposy; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index b2e3023f2..723d5bbd7 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -874,7 +874,7 @@ skip_check: vm.g_t[4] = *(intptr_t *)(vm.g_t[5]); // Action if (vm.g_t[5]) vm.g_t[1] = *(((intptr_t *)vm.g_t[5])+1); // move vm.g_sp->hitag = *(((intptr_t *)vm.g_t[5])+2); // move flags - vm.g_t[0] = vm.g_t[2] = vm.g_t[3] = 0; // count, actioncount... vm.g_t[3] = ??? + vm.g_t[0] = vm.g_t[2] = vm.g_t[3] = 0; // count, actioncount... vm.g_t[3] = ?? if (A_CheckEnemySprite(vm.g_sp) && vm.g_sp->extra <= 0) // hack continue; if (vm.g_sp->hitag&random_angle) @@ -2256,6 +2256,8 @@ nullquote: int32_t j; #endif + if (g_screenCapture) continue; + if (x1 > x2) swaplong(&x1,&x2); if (y1 > y2) swaplong(&y1,&y2); @@ -4670,7 +4672,7 @@ void A_LoadActor(int32_t iActor) { vm.g_i = iActor; // Sprite ID vm.g_p = -1; // iPlayer; // Player ID - vm.g_x = -1; // lDist; // ?? + vm.g_x = -1; // lDist; // ? vm.g_sp = &sprite[vm.g_i]; // Pointer to sprite structure vm.g_t = &ActorExtra[vm.g_i].temp_data[0]; // Sprite's 'extra' data vm.g_returnFlag = 0; @@ -4703,7 +4705,7 @@ void A_Execute(int32_t iActor,int32_t iPlayer,int32_t lDist) vm.g_i = iActor; // Sprite ID vm.g_p = iPlayer; // Player ID - vm.g_x = lDist; // ?? + vm.g_x = lDist; // ? vm.g_sp = &sprite[vm.g_i]; // Pointer to sprite structure vm.g_t = &ActorExtra[vm.g_i].temp_data[0]; // Sprite's 'extra' data vm.g_returnFlag = 0; diff --git a/polymer/eduke32/source/gamevars.c b/polymer/eduke32/source/gamevars.c index 3503565e3..a46524e60 100644 --- a/polymer/eduke32/source/gamevars.c +++ b/polymer/eduke32/source/gamevars.c @@ -40,7 +40,7 @@ static void Gv_Free(void) /* called from Gv_ReadSave() and Gv_ResetVars() */ // AddLog("Gv_Free"); for (; i>=0; i--) { - if (aGameVars[i].dwFlags & (GAMEVAR_USER_MASK) && aGameVars[i].val.plValues) + if ((aGameVars[i].dwFlags & GAMEVAR_USER_MASK) && aGameVars[i].val.plValues) { Bfree(aGameVars[i].val.plValues); aGameVars[i].val.plValues=NULL; @@ -73,7 +73,7 @@ static void Gv_Clear(void) aGameVars[i].szLabel=NULL; aGameVars[i].dwFlags=0; - if (aGameVars[i].dwFlags & (GAMEVAR_USER_MASK) && aGameVars[i].val.plValues) + if ((aGameVars[i].dwFlags & GAMEVAR_USER_MASK) && aGameVars[i].val.plValues) { Bfree(aGameVars[i].val.plValues); aGameVars[i].val.plValues=NULL; @@ -292,7 +292,7 @@ void Gv_WriteSave(FILE *fil) } else if (aGameVars[j].dwFlags & GAMEVAR_PERACTOR) { - dfwrite(&MapInfo[i].savedstate->vars[j][0],sizeof(intptr_t) * MAXSPRITES, 1, fil); + dfwrite(&MapInfo[i].savedstate->vars[j][0],sizeof(intptr_t), MAXSPRITES, fil); } } } @@ -587,7 +587,7 @@ int32_t __fastcall Gv_GetVar(register int32_t id, register int32_t iActor, regis case 2: //else if (id == g_iWallVarID) return ((X_AccessWallX(index, *insptr++) ^ -negateResult) + negateResult); default: - OSD_Printf(CON_ERROR "Gv_GetVar(): WTF??\n",g_errorLineNum,keyw[g_tw]); + OSD_Printf(CON_ERROR "Gv_GetVar(): WTF?\n",g_errorLineNum,keyw[g_tw]); return -1; } } @@ -732,7 +732,7 @@ int32_t __fastcall Gv_GetVarX(register int32_t id) case 2: //else if (id == g_iWallVarID) return ((X_AccessWallX(index, *insptr++) ^ -negateResult) + negateResult); default: - OSD_Printf(CON_ERROR "Gv_GetVar(): WTF??\n",g_errorLineNum,keyw[g_tw]); + OSD_Printf(CON_ERROR "Gv_GetVar(): WTF?\n",g_errorLineNum,keyw[g_tw]); return -1; } } diff --git a/polymer/eduke32/source/global.c b/polymer/eduke32/source/global.c index e5f42e895..cb6f3bcef 100644 --- a/polymer/eduke32/source/global.c +++ b/polymer/eduke32/source/global.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //------------------------------------------------------------------------- #include "duke3d.h" -const char *s_buildDate = "20091017"; +const char *s_buildDate = "20091106"; char *MusicPtr = NULL; int32_t g_musicSize; diff --git a/polymer/eduke32/source/m32def.c b/polymer/eduke32/source/m32def.c index 4d0090444..0d96865cc 100644 --- a/polymer/eduke32/source/m32def.c +++ b/polymer/eduke32/source/m32def.c @@ -1605,7 +1605,7 @@ static int32_t C_ParseCommand(void) if (nsize == osize) { - int ii, equal=2, linedif, ow, nw; + int ii, equal=2, linedif = 0, ow, nw; for (ii=0; iiname, "skill")) + { + if (numplayers > 1) + return r; + ud.m_player_skill = ud.player_skill; + return r; + } } #endif @@ -1290,6 +1297,8 @@ int32_t registerosdcommands(void) { "sensitivity","sensitivity : changes the mouse sensitivity", (void*)&CONTROL_MouseSensitivity, CVAR_FLOAT|CVAR_FUNCPTR, 0, 0, 25 }, + { "skill","skill : changes the game skill setting", (void*)&ud.player_skill, CVAR_INT|CVAR_FUNCPTR|CVAR_NOMULTI, 0, 0, 5 }, + { "snd_ambience", "snd_ambience: enables/disables ambient sounds", (void*)&ud.config.AmbienceToggle, CVAR_BOOL, 0, 0, 1 }, { "snd_duketalk", "snd_duketalk: enables/disables Duke's speech", (void*)&ud.config.VoiceToggle, CVAR_INT, 0, 0, 5 }, { "snd_fxvolume", "snd_fxvolume: volume of sound effects", (void*)&ud.config.FXVolume, CVAR_INT, 0, 0, 255 }, diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 3b79fcc16..c950012d7 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -4831,13 +4831,12 @@ void P_ProcessInput(int32_t snum) if ((truefdist < PHEIGHT+(8<<8)) && (k == 1 || k == 3)) { - if (p->spritebridge == 0 && p->walking_snd_toggle == 0 && p->on_ground) + if (p->walking_snd_toggle == 0 && p->on_ground) { switch (psectlotag) { case 0: - - if (lz >= 0 && (lz&(MAXSPRITES-1))==49152) + if (lz >= 0 && (lz&49152) == 49152) j = sprite[lz&(MAXSPRITES-1)].picnum; else j = sector[psect].floorpicnum; @@ -4850,10 +4849,14 @@ void P_ProcessInput(int32_t snum) break; } break; + case 1: - if ((krand()&1) == 0) - A_PlaySound(DUKE_ONWATER,pi); - p->walking_snd_toggle = 1; + if (!p->spritebridge) + { + if ((krand()&1) == 0) + A_PlaySound(DUKE_ONWATER,pi); + p->walking_snd_toggle = 1; + } break; } } diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 29907f0e3..6f5db5c2d 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -453,7 +453,7 @@ void G_CacheMapData(void) { tloadtile(sector[i].floorpicnum, 0); tloadtile(sector[i].ceilingpicnum, 0); - if (sector[i].ceilingpicnum == LA) // JBF 20040509: if( waloff[sector[i].ceilingpicnum] == LA) WTF??!??!?!? + if (sector[i].ceilingpicnum == LA) // JBF 20040509: if( waloff[sector[i].ceilingpicnum] == LA) WTF?!?!?!? { tloadtile(LA+1, 0); tloadtile(LA+2, 0); @@ -1211,7 +1211,7 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk) DukePlayer_t *p = g_player[0].ps; int32_t i; - if (!premap_quickenterlevel) + if (premap_quickenterlevel) goto quick; handleevents(); diff --git a/polymer/eduke32/source/startgtk.game.c b/polymer/eduke32/source/startgtk.game.c index b345a9fc2..9ca56289e 100644 --- a/polymer/eduke32/source/startgtk.game.c +++ b/polymer/eduke32/source/startgtk.game.c @@ -1,158 +1,80 @@ -/* NOTE: Glade will generate code for a dialogue box which you should - * then patch into this file whenever you make a change to the Glade - * template. - */ - -#include -#include -#include -#include -#include -#include - -#include "dynamicgtk.h" +#if defined(LINKED_GTK) + #include + #include +#else + #include "dynamicgtk.h" +#endif #include "duke3d.h" -#include "build.h" -#include "compat.h" -#include "baselayer.h" - #include "grpscan.h" +#include "build.h" #define TAB_CONFIG 0 #define TAB_GAME 1 #define TAB_MESSAGES 2 +#define Polymost 3 +#define Polymer 4 +static struct +{ + GtkWidget *startwin; + GtkWidget *hlayout; + GtkWidget *banner; + GtkWidget *vlayout; + GtkWidget *tabs; + GtkWidget *configvlayout; + GtkWidget *configtlayout; + GtkWidget *displayvlayout; + GtkWidget *vmode3dlabel; + GtkWidget *vmode3dcombo; + GtkWidget *fullscreencheck; + GtkWidget *polymercheck; + GtkWidget *emptyhlayout; + GtkWidget *inputdevlabel; + GtkWidget *inputhlayout; + GtkWidget *inputmousecheck; + GtkWidget *inputjoycheck; + GtkWidget *autoloadcheck; + GtkWidget *alwaysshowcheck; + GtkWidget *configtab; + GtkWidget *gamevlayout; + GtkWidget *gamelabel; + GtkWidget *gamescroll; + GtkWidget *gamelist; + GtkWidget *gametab; + GtkWidget *messagesscroll; + GtkWidget *messagestext; + GtkWidget *messagestab; + GtkWidget *buttons; + GtkWidget *cancelbutton; + GtkWidget *cancelbuttonalign; + GtkWidget *cancelbuttonlayout; + GtkWidget *cancelbuttonicon; + GtkWidget *cancelbuttonlabel; + GtkWidget *startbutton; + GtkWidget *startbuttonalign; + GtkWidget *startbuttonlayout; + GtkWidget *startbuttonicon; + GtkWidget *startbuttonlabel; +} stwidgets; + static struct { int32_t fullscreen; + int32_t polymer; int32_t xdim3d, ydim3d, bpp3d; int32_t forcesetup; + int32_t autoload; int32_t usemouse, usejoy; int32_t game; int32_t crcval; char selectedgrp[BMAX_PATH]; } settings; -extern int32_t gtkenabled; - -static GtkWidget *startwin = NULL; static int32_t retval = -1, mode = TAB_MESSAGES; +extern int32_t gtkenabled; +static void PopulateForm(int32_t pgs); -// -- SUPPORT FUNCTIONS ------------------------------------------------------- - -#define GLADE_HOOKUP_OBJECT(component,widget,name) \ - g_object_set_data_full (G_OBJECT (component), name, \ - gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) - -#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ - g_object_set_data (G_OBJECT (component), name, widget) - -#define lookup_widget(x,w) \ - (GtkWidget*) g_object_get_data(G_OBJECT(x), w) - -static GdkPixbuf *load_banner(void) -{ - extern const GdkPixdata startbanner_pixdata; - return gdk_pixbuf_from_pixdata(&startbanner_pixdata, FALSE, NULL); -} - -static void SetPage(int32_t n) -{ - if (!gtkenabled || !startwin) return; - mode = n; - gtk_notebook_set_current_page(GTK_NOTEBOOK(lookup_widget(startwin,"tabs")), n); - - // each control in the config page vertical layout plus the start button should be made (in)sensitive - if (n == TAB_CONFIG) n = TRUE; else n = FALSE; - gtk_widget_set_sensitive(lookup_widget(startwin,"startbutton"), n); - gtk_container_foreach(GTK_CONTAINER(lookup_widget(startwin,"configvlayout")), - (GtkCallback)gtk_widget_set_sensitive, (gpointer)n); -} - -static void on_vmode3dcombo_changed(GtkComboBox *, gpointer); -static void on_gamelist_selection_changed(GtkTreeSelection *, gpointer); -static void PopulateForm(int32_t pgs) -{ - if (pgs & (1<= settings.bpp3d) i++; else break; } - for (; cd[i]; i++) - { - mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1); - if (mode3d < 0) continue; - settings.bpp3d = cd[i]; - break; - } - } - - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lookup_widget(startwin,"fullscreencheck")), settings.fullscreen); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lookup_widget(startwin,"alwaysshowcheck")), settings.forcesetup); - - box3d = GTK_COMBO_BOX(lookup_widget(startwin,"vmode3dcombo")); - modes3d = GTK_LIST_STORE(gtk_combo_box_get_model(box3d)); - gtk_list_store_clear(modes3d); - - for (i=0; inext) - { - for (i = 0; icrcval == grpfiles[i].crcval) break; - if (i == numgrpfiles) continue; // unrecognised grp file - - gtk_list_store_append(list, &iter); - gtk_list_store_set(list, &iter, 0, grpfiles[i].name, 1, fg->name, 2, (gpointer)fg, -1); - if (!Bstrcasecmp(fg->name, settings.selectedgrp)) - { - GtkTreeSelection *sel = gtk_tree_view_get_selection(gamelist); - g_signal_handlers_block_by_func(sel, on_gamelist_selection_changed, NULL); - gtk_tree_selection_select_iter(sel, &iter); - g_signal_handlers_unblock_by_func(sel, on_gamelist_selection_changed, NULL); - } - } - } -} // -- EVENT CALLBACKS AND CREATION STUFF -------------------------------------- @@ -172,14 +94,52 @@ static void on_vmode3dcombo_changed(GtkComboBox *combobox, gpointer user_data) static void on_fullscreencheck_toggled(GtkToggleButton *togglebutton, gpointer user_data) { UNREFERENCED_PARAMETER(user_data); - settings.fullscreen = (gtk_toggle_button_get_active(togglebutton) == TRUE); + settings.fullscreen = gtk_toggle_button_get_active(togglebutton); PopulateForm(1<= settings.bpp3d) i++; else break; } + for (; cd[i]; i++) + { + mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1); + if (mode3d < 0) continue; + settings.bpp3d = cd[i]; + break; + } + } + + box3d = GTK_COMBO_BOX(stwidgets.vmode3dcombo); + modes3d = GTK_LIST_STORE(gtk_combo_box_get_model(box3d)); + gtk_list_store_clear(modes3d); + + for (i=0; inext) + { + for (i = 0; icrcval == grpfiles[i].crcval) break; + if (i == numgrpfiles) continue; // unrecognised grp file + + gtk_list_store_append(list, &iter); + gtk_list_store_set(list, &iter, 0, grpfiles[i].name, 1, fg->name, 2, (gpointer)fg, -1); + if (!Bstrcasecmp(fg->name, settings.selectedgrp)) + { + GtkTreeSelection *sel = gtk_tree_view_get_selection(gamelist); + g_signal_handlers_block_by_func(sel, on_gamelist_selection_changed, NULL); + gtk_tree_selection_select_iter(sel, &iter); + g_signal_handlers_unblock_by_func(sel, on_gamelist_selection_changed, NULL); + } + } + } +} + static gint name_sorter(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data) { gchar *as, *bs; @@ -258,192 +307,118 @@ static gint name_sorter(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpo static GtkWidget *create_window(void) { - GtkWidget *startwin; - GtkWidget *hlayout; - GtkWidget *banner; - GtkWidget *vlayout; - GtkWidget *tabs; - GtkWidget *configvlayout; - GtkWidget *configlayout; - GtkWidget *fullscreencheck; - GtkWidget *vmode3dlabel; - GtkWidget *inputdevlabel; - /* GtkWidget *sounddrvlabel; - GtkWidget *sounddrvcombo; */ - GtkWidget *inputmousecheck; - GtkWidget *inputjoycheck; - GtkWidget *vmode3dcombo; - GtkWidget *alwaysshowcheck; - GtkWidget *configtab; - GtkWidget *gamevlayout; - GtkWidget *gamelabel; - GtkWidget *gamescroll; - GtkWidget *gamelist; - GtkWidget *gametab; - GtkWidget *messagesscroll; - GtkWidget *messagestext; - GtkWidget *messagestab; - GtkWidget *buttons; - GtkWidget *cancelbutton; - GtkWidget *cancelbuttonalign; - GtkWidget *cancelbuttonlayout; - GtkWidget *cancelbuttonicon; - GtkWidget *cancelbuttonlabel; - GtkWidget *startbutton; - GtkWidget *startbuttonalign; - GtkWidget *startbuttonlayout; - GtkWidget *startbuttonicon; - GtkWidget *startbuttonlabel; - GtkAccelGroup *accel_group; - - accel_group = gtk_accel_group_new(); - // Basic window - startwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_title(GTK_WINDOW(startwin), apptitle); // NOTE: use global app title - gtk_window_set_position(GTK_WINDOW(startwin), GTK_WIN_POS_CENTER); - gtk_window_set_resizable(GTK_WINDOW(startwin), FALSE); - gtk_window_set_type_hint(GTK_WINDOW(startwin), GDK_WINDOW_TYPE_HINT_DIALOG); + stwidgets.startwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_title(GTK_WINDOW(stwidgets.startwin), apptitle); // NOTE: use global app title + gtk_window_set_position(GTK_WINDOW(stwidgets.startwin), GTK_WIN_POS_CENTER); + gtk_window_set_resizable(GTK_WINDOW(stwidgets.startwin), FALSE); + gtk_window_set_type_hint(GTK_WINDOW(stwidgets.startwin), GDK_WINDOW_TYPE_HINT_DIALOG); // Horizontal layout of banner and controls - hlayout = gtk_hbox_new(FALSE, 0); - gtk_widget_show(hlayout); - gtk_container_add(GTK_CONTAINER(startwin), hlayout); + stwidgets.hlayout = gtk_hbox_new(FALSE, 0); + gtk_container_add(GTK_CONTAINER(stwidgets.startwin), stwidgets.hlayout); - // Banner + // banner { GdkPixbuf *pixbuf = load_banner(); - banner = gtk_image_new_from_pixbuf(pixbuf); + stwidgets.banner = gtk_image_new_from_pixbuf(pixbuf); g_object_unref((gpointer)pixbuf); } - gtk_widget_show(banner); - gtk_box_pack_start(GTK_BOX(hlayout), banner, FALSE, FALSE, 0); - gtk_misc_set_alignment(GTK_MISC(banner), 0.5, 0); + gtk_box_pack_start(GTK_BOX(stwidgets.hlayout), stwidgets.banner, FALSE, FALSE, 0); + gtk_misc_set_alignment(GTK_MISC(stwidgets.banner), 0.5, 0); // Vertical layout of tab control and start+cancel buttons - vlayout = gtk_vbox_new(FALSE, 0); - gtk_widget_show(vlayout); - gtk_box_pack_start(GTK_BOX(hlayout), vlayout, TRUE, TRUE, 0); + stwidgets.vlayout = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(stwidgets.hlayout), stwidgets.vlayout, TRUE, TRUE, 0); // Tab control - tabs = gtk_notebook_new(); - gtk_widget_show(tabs); - gtk_box_pack_start(GTK_BOX(vlayout), tabs, TRUE, TRUE, 0); - gtk_container_set_border_width(GTK_CONTAINER(tabs), 4); + stwidgets.tabs = gtk_notebook_new(); + gtk_box_pack_start(GTK_BOX(stwidgets.vlayout), stwidgets.tabs, TRUE, TRUE, 0); + gtk_container_set_border_width(GTK_CONTAINER(stwidgets.tabs), 4); + + // Vertical layout of config page + stwidgets.configvlayout = gtk_vbox_new(FALSE, 12); + gtk_container_add (GTK_CONTAINER (stwidgets.tabs), stwidgets.configvlayout); - // Vertical layout of config page main body - configvlayout = gtk_vbox_new(FALSE, 0); - gtk_widget_show(configvlayout); - gtk_container_add(GTK_CONTAINER(tabs), configvlayout); - - // Fixed-position layout of config page controls - configlayout = gtk_fixed_new(); - gtk_widget_show(configlayout); - gtk_box_pack_start(GTK_BOX(configvlayout), configlayout, TRUE, TRUE, 0); - gtk_container_set_border_width(GTK_CONTAINER(configlayout), 6); - - // Fullscreen checkbox - fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen"); - gtk_widget_show(fullscreencheck); - gtk_fixed_put(GTK_FIXED(configlayout), fullscreencheck, 248, 0); - gtk_widget_set_size_request(fullscreencheck, 85, 29); - gtk_widget_add_accelerator(fullscreencheck, "grab_focus", accel_group, - GDK_F, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); - - // 3D video mode LabelText - vmode3dlabel = gtk_label_new_with_mnemonic("_Video mode:"); - gtk_widget_show(vmode3dlabel); - gtk_fixed_put(GTK_FIXED(configlayout), vmode3dlabel, 0, 0); - gtk_widget_set_size_request(vmode3dlabel, 88, 29); - gtk_misc_set_alignment(GTK_MISC(vmode3dlabel), 0, 0.5); - - inputdevlabel = gtk_label_new("Input devices:"); - gtk_widget_show(inputdevlabel); - gtk_fixed_put(GTK_FIXED(configlayout), inputdevlabel, 0, 120); - gtk_widget_set_size_request(inputdevlabel, 88, 20); - gtk_misc_set_alignment(GTK_MISC(inputdevlabel), 0, 0.5); - /* - sounddrvlabel = gtk_label_new_with_mnemonic("S_ound driver:"); - gtk_widget_show(sounddrvlabel); - gtk_fixed_put(GTK_FIXED(configlayout), sounddrvlabel, 0, 40); - gtk_widget_set_size_request(sounddrvlabel, 88, 29); - gtk_misc_set_alignment(GTK_MISC(sounddrvlabel), 0, 0.5); - - sounddrvcombo = gtk_combo_box_new_text(); - gtk_widget_show(sounddrvcombo); - gtk_fixed_put(GTK_FIXED(configlayout), sounddrvcombo, 88, 40); - gtk_widget_set_size_request(sounddrvcombo, 31, 30); - gtk_widget_add_accelerator(sounddrvcombo, "grab_focus", accel_group, - GDK_O, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); - */ - inputmousecheck = gtk_check_button_new_with_mnemonic("Mo_use"); - gtk_widget_show(inputmousecheck); - gtk_fixed_put(GTK_FIXED(configlayout), inputmousecheck, 88, 120); - gtk_widget_set_size_request(inputmousecheck, 80, 20); - gtk_widget_add_accelerator(inputmousecheck, "grab_focus", accel_group, - GDK_U, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); - - inputjoycheck = gtk_check_button_new_with_mnemonic("_Joystick"); - gtk_widget_show(inputjoycheck); - gtk_fixed_put(GTK_FIXED(configlayout), inputjoycheck, 168, 120); - gtk_widget_set_size_request(inputjoycheck, 80, 20); - gtk_widget_add_accelerator(inputjoycheck, "grab_focus", accel_group, - GDK_J, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); - - // 3D video mode combo + // layout table of config page + stwidgets.configtlayout = gtk_table_new(3, 3, FALSE); + gtk_box_pack_start(GTK_BOX(stwidgets.configvlayout), stwidgets.configtlayout, TRUE, TRUE, 0); + + // 3D video mode LabelText + stwidgets.vmode3dlabel = gtk_label_new_with_mnemonic("_Video mode:"); + gtk_misc_set_alignment (GTK_MISC(stwidgets.vmode3dlabel), 0.3, 0); + gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 0,1, GTK_FILL, 0, 4, 6); + + // 3D video mode combo { GtkListStore *list = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); GtkCellRenderer *cell; - vmode3dcombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(list)); + stwidgets.vmode3dcombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(list)); g_object_unref(G_OBJECT(list)); cell = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(vmode3dcombo), cell, FALSE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(vmode3dcombo), cell, "text", 0, NULL); + gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, FALSE); + gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, "text", 0, NULL); } - gtk_widget_show(vmode3dcombo); - gtk_fixed_put(GTK_FIXED(configlayout), vmode3dcombo, 88, 0); - gtk_widget_set_size_request(vmode3dcombo, 150, 29); - gtk_widget_add_accelerator(vmode3dcombo, "grab_focus", accel_group, - GDK_V, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); + gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 0,1, GTK_EXPAND | GTK_FILL, 0, 4, 6); - // Always show config checkbox - alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show configuration on start"); - gtk_widget_show(alwaysshowcheck); - gtk_box_pack_start(GTK_BOX(configvlayout), alwaysshowcheck, FALSE, FALSE, 0); - gtk_widget_add_accelerator(alwaysshowcheck, "grab_focus", accel_group, - GDK_A, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); + // Fullscreen checkbox + stwidgets.displayvlayout = gtk_vbox_new(TRUE, 0); + gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.displayvlayout, 2,3, 0,1, GTK_FILL, 0, 4, 6); + stwidgets.fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen"); + gtk_box_pack_start(GTK_BOX(stwidgets.displayvlayout), stwidgets.fullscreencheck, FALSE, FALSE, 0); + + // Polymer checkbox + stwidgets.polymercheck = gtk_check_button_new_with_mnemonic("_Polymer"); + gtk_box_pack_start(GTK_BOX(stwidgets.displayvlayout), stwidgets.polymercheck, FALSE, FALSE, 0); + + // Empty horizontal layout + stwidgets.emptyhlayout = gtk_hbox_new(TRUE, 0); + gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,1, 2,3, 0, GTK_EXPAND | GTK_FILL, 0, 0); + + // Input devices LabelText + stwidgets.inputdevlabel = gtk_label_new("Input devices:"); + gtk_misc_set_alignment(GTK_MISC(stwidgets.inputdevlabel), 0.3, 0); + gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevlabel, 0,1, 3,4, GTK_FILL, 0, 4, 0); + + // Input devices checkbox + stwidgets.inputhlayout = gtk_hbox_new(FALSE, 4); + gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.inputhlayout, 1,2, 3,4, GTK_EXPAND | GTK_FILL, 0, 4, 0); + + stwidgets.inputmousecheck = gtk_check_button_new_with_mnemonic("Mo_use"); + stwidgets.inputjoycheck = gtk_check_button_new_with_mnemonic("_Joystick"); + + gtk_box_pack_start (GTK_BOX(stwidgets.inputhlayout), stwidgets.inputmousecheck, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX(stwidgets.inputhlayout), stwidgets.inputjoycheck, FALSE, FALSE, 0); + + // Autoload checkbox + stwidgets.autoloadcheck = gtk_check_button_new_with_mnemonic("_Enable \"autoload\" folder"); + gtk_box_pack_start(GTK_BOX(stwidgets.configvlayout), stwidgets.autoloadcheck, FALSE, FALSE, 0); + + // Always show config checkbox + stwidgets.alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show configuration on start"); + gtk_box_pack_start(GTK_BOX(stwidgets.configvlayout), stwidgets.alwaysshowcheck, FALSE, FALSE, 0); // Configuration tab - configtab = gtk_label_new("Configuration"); - gtk_widget_show(configtab); - gtk_notebook_set_tab_label(GTK_NOTEBOOK(tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(tabs), 0), configtab); + stwidgets.configtab = gtk_label_new("Configuration"); + gtk_notebook_set_tab_label(GTK_NOTEBOOK(stwidgets.tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(stwidgets.tabs), 0), stwidgets.configtab); // Game data layout - gamevlayout = gtk_vbox_new(FALSE, 0); - gtk_widget_show(gamevlayout); - gtk_container_add(GTK_CONTAINER(tabs), gamevlayout); - gtk_container_set_border_width(GTK_CONTAINER(gamevlayout), 4); + stwidgets.gamevlayout = gtk_vbox_new(FALSE, 0); + gtk_container_add(GTK_CONTAINER(stwidgets.tabs), stwidgets.gamevlayout); + gtk_container_set_border_width(GTK_CONTAINER(stwidgets.gamevlayout), 4); // Game data field LabelText - gamelabel = gtk_label_new_with_mnemonic("_Game or addon:"); - gtk_widget_show(gamelabel); - gtk_box_pack_start(GTK_BOX(gamevlayout), gamelabel, FALSE, FALSE, 0); - gtk_misc_set_alignment(GTK_MISC(gamelabel), 0, 0.5); + stwidgets.gamelabel = gtk_label_new_with_mnemonic("_Game or addon:"); + gtk_box_pack_start(GTK_BOX(stwidgets.gamevlayout), stwidgets.gamelabel, FALSE, FALSE, 0); + gtk_misc_set_alignment(GTK_MISC(stwidgets.gamelabel), 0, 0.5); // Game data scrollable area - gamescroll = gtk_scrolled_window_new(NULL, NULL); - gtk_widget_show(gamescroll); - gtk_box_pack_start(GTK_BOX(gamevlayout), gamescroll, TRUE, TRUE, 0); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gamescroll), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(gamescroll), GTK_SHADOW_IN); + stwidgets.gamescroll = gtk_scrolled_window_new(NULL, NULL); + gtk_box_pack_start(GTK_BOX(stwidgets.gamevlayout), stwidgets.gamescroll, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(stwidgets.gamescroll), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(stwidgets.gamescroll), GTK_SHADOW_IN); // Game data list { @@ -454,144 +429,117 @@ static GtkWidget *create_window(void) gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(list), 0, name_sorter, NULL, NULL); gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(list), 0, GTK_SORT_ASCENDING); - gamelist = gtk_tree_view_new_with_model(GTK_TREE_MODEL(list)); + stwidgets.gamelist = gtk_tree_view_new_with_model(GTK_TREE_MODEL(list)); g_object_unref(G_OBJECT(list)); cell = gtk_cell_renderer_text_new(); col = gtk_tree_view_column_new_with_attributes("Game", cell, "text", 0, NULL); gtk_tree_view_column_set_expand(col, TRUE); - gtk_tree_view_append_column(GTK_TREE_VIEW(gamelist), col); + gtk_tree_view_append_column(GTK_TREE_VIEW(stwidgets.gamelist), col); col = gtk_tree_view_column_new_with_attributes("GRP file", cell, "text", 1, NULL); gtk_tree_view_column_set_min_width(col, 64); - gtk_tree_view_append_column(GTK_TREE_VIEW(gamelist), col); + gtk_tree_view_append_column(GTK_TREE_VIEW(stwidgets.gamelist), col); } - gtk_widget_show(gamelist); - gtk_container_add(GTK_CONTAINER(gamescroll), gamelist); - gtk_widget_add_accelerator(gamelist, "grab_focus", accel_group, - GDK_G, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(gamelist), FALSE); - gtk_tree_view_set_enable_search(GTK_TREE_VIEW(gamelist), FALSE); + gtk_container_add(GTK_CONTAINER(stwidgets.gamescroll), stwidgets.gamelist); + + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(stwidgets.gamelist), FALSE); + gtk_tree_view_set_enable_search(GTK_TREE_VIEW(stwidgets.gamelist), FALSE); // Game tab - gametab = gtk_label_new("Game"); - gtk_widget_show(gametab); - gtk_notebook_set_tab_label(GTK_NOTEBOOK(tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(tabs), 1), gametab); + stwidgets.gametab = gtk_label_new("Game"); + gtk_notebook_set_tab_label(GTK_NOTEBOOK(stwidgets.tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(stwidgets.tabs), 1), stwidgets.gametab); // Messages scrollable area - messagesscroll = gtk_scrolled_window_new(NULL, NULL); - gtk_widget_show(messagesscroll); - gtk_container_add(GTK_CONTAINER(tabs), messagesscroll); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(messagesscroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); + stwidgets.messagesscroll = gtk_scrolled_window_new(NULL, NULL); + gtk_container_add(GTK_CONTAINER(stwidgets.tabs), stwidgets.messagesscroll); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(stwidgets.messagesscroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); // Messages text area - messagestext = gtk_text_view_new(); - gtk_widget_show(messagestext); - gtk_container_add(GTK_CONTAINER(messagesscroll), messagestext); - gtk_text_view_set_editable(GTK_TEXT_VIEW(messagestext), FALSE); - gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(messagestext), GTK_WRAP_WORD); - gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(messagestext), FALSE); - gtk_text_view_set_left_margin(GTK_TEXT_VIEW(messagestext), 2); - gtk_text_view_set_right_margin(GTK_TEXT_VIEW(messagestext), 2); + stwidgets.messagestext = gtk_text_view_new(); + gtk_container_add(GTK_CONTAINER(stwidgets.messagesscroll), stwidgets.messagestext); + gtk_text_view_set_editable(GTK_TEXT_VIEW(stwidgets.messagestext), FALSE); + gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(stwidgets.messagestext), GTK_WRAP_WORD); + gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(stwidgets.messagestext), FALSE); + gtk_text_view_set_left_margin(GTK_TEXT_VIEW(stwidgets.messagestext), 2); + gtk_text_view_set_right_margin(GTK_TEXT_VIEW(stwidgets.messagestext), 2); // Messages tab - messagestab = gtk_label_new("Messages"); - gtk_widget_show(messagestab); - gtk_notebook_set_tab_label(GTK_NOTEBOOK(tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(tabs), 2), messagestab); + stwidgets.messagestab = gtk_label_new("Messages"); + gtk_notebook_set_tab_label(GTK_NOTEBOOK(stwidgets.tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(stwidgets.tabs), 2), stwidgets.messagestab); // Dialogue box buttons layout - buttons = gtk_hbutton_box_new(); - gtk_widget_show(buttons); - gtk_box_pack_start(GTK_BOX(vlayout), buttons, FALSE, TRUE, 0); - gtk_container_set_border_width(GTK_CONTAINER(buttons), 3); - gtk_button_box_set_layout(GTK_BUTTON_BOX(buttons), GTK_BUTTONBOX_END); + stwidgets.buttons = gtk_hbutton_box_new(); + gtk_box_pack_start(GTK_BOX(stwidgets.vlayout), stwidgets.buttons, FALSE, TRUE, 0); + gtk_container_set_border_width(GTK_CONTAINER(stwidgets.buttons), 3); + gtk_button_box_set_layout(GTK_BUTTON_BOX(stwidgets.buttons), GTK_BUTTONBOX_END); // Cancel button - cancelbutton = gtk_button_new(); - gtk_widget_show(cancelbutton); - gtk_container_add(GTK_CONTAINER(buttons), cancelbutton); - GTK_WIDGET_SET_FLAGS(cancelbutton, GTK_CAN_DEFAULT); - gtk_widget_add_accelerator(cancelbutton, "grab_focus", accel_group, - GDK_C, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); - gtk_widget_add_accelerator(cancelbutton, "clicked", accel_group, - GDK_Escape, 0, - GTK_ACCEL_VISIBLE); + stwidgets.cancelbutton = gtk_button_new(); + gtk_container_add(GTK_CONTAINER(stwidgets.buttons), stwidgets.cancelbutton); + GTK_WIDGET_SET_FLAGS(stwidgets.cancelbutton, GTK_CAN_DEFAULT); - cancelbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0); - gtk_widget_show(cancelbuttonalign); - gtk_container_add(GTK_CONTAINER(cancelbutton), cancelbuttonalign); + stwidgets.cancelbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0); + gtk_container_add(GTK_CONTAINER(stwidgets.cancelbutton), stwidgets.cancelbuttonalign); - cancelbuttonlayout = gtk_hbox_new(FALSE, 2); - gtk_widget_show(cancelbuttonlayout); - gtk_container_add(GTK_CONTAINER(cancelbuttonalign), cancelbuttonlayout); + stwidgets.cancelbuttonlayout = gtk_hbox_new(FALSE, 2); + gtk_container_add(GTK_CONTAINER(stwidgets.cancelbuttonalign), stwidgets.cancelbuttonlayout); - cancelbuttonicon = gtk_image_new_from_stock("gtk-cancel", GTK_ICON_SIZE_BUTTON); - gtk_widget_show(cancelbuttonicon); - gtk_box_pack_start(GTK_BOX(cancelbuttonlayout), cancelbuttonicon, FALSE, FALSE, 0); + stwidgets.cancelbuttonicon = gtk_image_new_from_stock("gtk-cancel", GTK_ICON_SIZE_BUTTON); + gtk_box_pack_start(GTK_BOX(stwidgets.cancelbuttonlayout), stwidgets.cancelbuttonicon, FALSE, FALSE, 0); - cancelbuttonlabel = gtk_label_new_with_mnemonic("_Cancel"); - gtk_widget_show(cancelbuttonlabel); - gtk_box_pack_start(GTK_BOX(cancelbuttonlayout), cancelbuttonlabel, FALSE, FALSE, 0); + stwidgets.cancelbuttonlabel = gtk_label_new_with_mnemonic("_Cancel"); + gtk_box_pack_start(GTK_BOX(stwidgets.cancelbuttonlayout), stwidgets.cancelbuttonlabel, FALSE, FALSE, 0); // Start button - startbutton = gtk_button_new(); - gtk_widget_show(startbutton); - gtk_container_add(GTK_CONTAINER(buttons), startbutton); - GTK_WIDGET_SET_FLAGS(startbutton, GTK_CAN_DEFAULT); - gtk_widget_add_accelerator(startbutton, "grab_focus", accel_group, - GDK_S, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); - gtk_widget_add_accelerator(startbutton, "clicked", accel_group, - GDK_Return, 0, - GTK_ACCEL_VISIBLE); + stwidgets.startbutton = gtk_button_new(); + gtk_container_add(GTK_CONTAINER(stwidgets.buttons), stwidgets.startbutton); + GTK_WIDGET_SET_FLAGS(stwidgets.startbutton, GTK_CAN_DEFAULT); - startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0); - gtk_widget_show(startbuttonalign); - gtk_container_add(GTK_CONTAINER(startbutton), startbuttonalign); + stwidgets.startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0); + gtk_container_add(GTK_CONTAINER(stwidgets.startbutton), stwidgets.startbuttonalign); - startbuttonlayout = gtk_hbox_new(FALSE, 2); - gtk_widget_show(startbuttonlayout); - gtk_container_add(GTK_CONTAINER(startbuttonalign), startbuttonlayout); + stwidgets.startbuttonlayout = gtk_hbox_new(FALSE, 2); + gtk_container_add(GTK_CONTAINER(stwidgets.startbuttonalign), stwidgets.startbuttonlayout); - startbuttonicon = gtk_image_new_from_stock("gtk-execute", GTK_ICON_SIZE_BUTTON); - gtk_widget_show(startbuttonicon); - gtk_box_pack_start(GTK_BOX(startbuttonlayout), startbuttonicon, FALSE, FALSE, 0); + stwidgets.startbuttonicon = gtk_image_new_from_stock("gtk-execute", GTK_ICON_SIZE_BUTTON); + gtk_box_pack_start(GTK_BOX(stwidgets.startbuttonlayout), stwidgets.startbuttonicon, FALSE, FALSE, 0); - startbuttonlabel = gtk_label_new_with_mnemonic("_Start"); - gtk_widget_show(startbuttonlabel); - gtk_box_pack_start(GTK_BOX(startbuttonlayout), startbuttonlabel, FALSE, FALSE, 0); + stwidgets.startbuttonlabel = gtk_label_new_with_mnemonic("_Start"); + gtk_box_pack_start(GTK_BOX(stwidgets.startbuttonlayout), stwidgets.startbuttonlabel, FALSE, FALSE, 0); // Wire up the signals - g_signal_connect((gpointer) startwin, "delete_event", + g_signal_connect((gpointer) stwidgets.startwin, "delete_event", G_CALLBACK(on_startwin_delete_event), NULL); - g_signal_connect((gpointer) fullscreencheck, "toggled", + g_signal_connect((gpointer) stwidgets.fullscreencheck, "toggled", G_CALLBACK(on_fullscreencheck_toggled), NULL); - /* g_signal_connect((gpointer) sounddrvcombo, "changed", - G_CALLBACK(on_sounddrvcombo_changed), - NULL);*/ - g_signal_connect((gpointer) inputmousecheck, "toggled", + g_signal_connect((gpointer) stwidgets.polymercheck, "toggled", + G_CALLBACK(on_polymercheck_toggled), + NULL); + g_signal_connect((gpointer) stwidgets.autoloadcheck, "toggled", + G_CALLBACK(on_autoloadcheck_toggled), + NULL); + g_signal_connect((gpointer) stwidgets.inputmousecheck, "toggled", G_CALLBACK(on_inputmousecheck_toggled), NULL); - g_signal_connect((gpointer) inputjoycheck, "toggled", + g_signal_connect((gpointer) stwidgets.inputjoycheck, "toggled", G_CALLBACK(on_inputjoycheck_toggled), NULL); - g_signal_connect((gpointer) vmode3dcombo, "changed", + g_signal_connect((gpointer) stwidgets.vmode3dcombo, "changed", G_CALLBACK(on_vmode3dcombo_changed), NULL); - g_signal_connect((gpointer) alwaysshowcheck, "toggled", + g_signal_connect((gpointer) stwidgets.alwaysshowcheck, "toggled", G_CALLBACK(on_alwaysshowcheck_toggled), NULL); - g_signal_connect((gpointer) cancelbutton, "clicked", + g_signal_connect((gpointer) stwidgets.cancelbutton, "clicked", G_CALLBACK(on_cancelbutton_clicked), NULL); - g_signal_connect((gpointer) startbutton, "clicked", + g_signal_connect((gpointer) stwidgets.startbutton, "clicked", G_CALLBACK(on_startbutton_clicked), NULL); { - GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(gamelist)); + GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(stwidgets.gamelist)); gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE); g_signal_connect((gpointer) sel, "changed", G_CALLBACK(on_gamelist_selection_changed), @@ -599,65 +547,25 @@ static GtkWidget *create_window(void) } // Associate labels with their controls - gtk_label_set_mnemonic_widget(GTK_LABEL(vmode3dlabel), vmode3dcombo); -// gtk_label_set_mnemonic_widget(GTK_LABEL(sounddrvlabel), sounddrvcombo); - gtk_label_set_mnemonic_widget(GTK_LABEL(gamelabel), gamelist); + gtk_label_set_mnemonic_widget(GTK_LABEL(stwidgets.vmode3dlabel), stwidgets.vmode3dcombo); + gtk_label_set_mnemonic_widget(GTK_LABEL(stwidgets.gamelabel), stwidgets.gamelist); - /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF(startwin, startwin, "startwin"); - GLADE_HOOKUP_OBJECT(startwin, hlayout, "hlayout"); - GLADE_HOOKUP_OBJECT(startwin, banner, "banner"); - GLADE_HOOKUP_OBJECT(startwin, vlayout, "vlayout"); - GLADE_HOOKUP_OBJECT(startwin, tabs, "tabs"); - GLADE_HOOKUP_OBJECT(startwin, configvlayout, "configvlayout"); - GLADE_HOOKUP_OBJECT(startwin, configlayout, "configlayout"); - GLADE_HOOKUP_OBJECT(startwin, fullscreencheck, "fullscreencheck"); - GLADE_HOOKUP_OBJECT(startwin, vmode3dlabel, "vmode3dlabel"); - GLADE_HOOKUP_OBJECT(startwin, inputdevlabel, "inputdevlabel"); - /* GLADE_HOOKUP_OBJECT(startwin, sounddrvlabel, "sounddrvlabel"); - GLADE_HOOKUP_OBJECT(startwin, sounddrvcombo, "sounddrvcombo"); */ - GLADE_HOOKUP_OBJECT(startwin, inputmousecheck, "inputmousecheck"); - GLADE_HOOKUP_OBJECT(startwin, inputjoycheck, "inputjoycheck"); - GLADE_HOOKUP_OBJECT(startwin, vmode3dcombo, "vmode3dcombo"); - GLADE_HOOKUP_OBJECT(startwin, alwaysshowcheck, "alwaysshowcheck"); - GLADE_HOOKUP_OBJECT(startwin, configtab, "configtab"); - GLADE_HOOKUP_OBJECT(startwin, gamevlayout, "gamevlayout"); - GLADE_HOOKUP_OBJECT(startwin, gamelabel, "gamelabel"); - GLADE_HOOKUP_OBJECT(startwin, gamescroll, "gamescroll"); - GLADE_HOOKUP_OBJECT(startwin, gamelist, "gamelist"); - GLADE_HOOKUP_OBJECT(startwin, gametab, "gametab"); - GLADE_HOOKUP_OBJECT(startwin, messagesscroll, "messagesscroll"); - GLADE_HOOKUP_OBJECT(startwin, messagestext, "messagestext"); - GLADE_HOOKUP_OBJECT(startwin, messagestab, "messagestab"); - GLADE_HOOKUP_OBJECT(startwin, buttons, "buttons"); - GLADE_HOOKUP_OBJECT(startwin, cancelbutton, "cancelbutton"); - GLADE_HOOKUP_OBJECT(startwin, cancelbuttonalign, "cancelbuttonalign"); - GLADE_HOOKUP_OBJECT(startwin, cancelbuttonlayout, "cancelbuttonlayout"); - GLADE_HOOKUP_OBJECT(startwin, cancelbuttonicon, "cancelbuttonicon"); - GLADE_HOOKUP_OBJECT(startwin, cancelbuttonlabel, "cancelbuttonlabel"); - GLADE_HOOKUP_OBJECT(startwin, startbutton, "startbutton"); - GLADE_HOOKUP_OBJECT(startwin, startbuttonalign, "startbuttonalign"); - GLADE_HOOKUP_OBJECT(startwin, startbuttonlayout, "startbuttonlayout"); - GLADE_HOOKUP_OBJECT(startwin, startbuttonicon, "startbuttonicon"); - GLADE_HOOKUP_OBJECT(startwin, startbuttonlabel, "startbuttonlabel"); - - gtk_window_add_accel_group(GTK_WINDOW(startwin), accel_group); - - return startwin; + return stwidgets.startwin; } + // -- BUILD ENTRY POINTS ------------------------------------------------------ int32_t startwin_open(void) { if (!gtkenabled) return 0; - if (startwin) return 1; + if (stwidgets.startwin) return 1; - startwin = create_window(); - if (startwin) + stwidgets.startwin = create_window(); + if (stwidgets.startwin) { SetPage(TAB_MESSAGES); - gtk_widget_show(startwin); + gtk_widget_show_all(stwidgets.startwin); gtk_main_iteration_do(FALSE); return 0; } @@ -667,9 +575,9 @@ int32_t startwin_open(void) int32_t startwin_close(void) { if (!gtkenabled) return 0; - if (!startwin) return 1; - gtk_widget_destroy(startwin); - startwin = NULL; + if (!stwidgets.startwin) return 1; + gtk_widget_destroy(stwidgets.startwin); + stwidgets.startwin = NULL; return 0; } @@ -682,8 +590,8 @@ int32_t startwin_puts(const char *str) const char *aptr, *bptr; if (!gtkenabled || !str) return 0; - if (!startwin) return 1; - if (!(textview = lookup_widget(startwin, "messagestext"))) return -1; + if (!stwidgets.startwin) return 1; + if (!(textview = stwidgets.messagestext)) return -1; textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)); gtk_text_buffer_get_end_iter(textbuffer, &enditer); @@ -729,8 +637,8 @@ int32_t startwin_puts(const char *str) int32_t startwin_settitle(const char *title) { if (!gtkenabled) return 0; - if (!startwin) return 1; - gtk_window_set_title(GTK_WINDOW(startwin), title); + if (!stwidgets.startwin) return 1; + gtk_window_set_title(GTK_WINDOW(stwidgets.startwin), title); return 0; } @@ -738,7 +646,7 @@ int32_t startwin_idle(void *s) { UNREFERENCED_PARAMETER(s); if (!gtkenabled) return 0; - //if (!startwin) return 1; + //if (!stwidgets.startwin) return 1; gtk_main_iteration_do(FALSE); return 0; } @@ -748,7 +656,7 @@ extern char *duke3dgrp, *duke3dgrpstring; int32_t startwin_run(void) { if (!gtkenabled) return 1; - if (!startwin) return 1; + if (!stwidgets.startwin) return 1; SetPage(TAB_CONFIG); @@ -761,12 +669,19 @@ int32_t startwin_run(void) settings.usejoy = ud.config.UseJoystick; settings.game = g_gameType; Bstrncpy(settings.selectedgrp, duke3dgrp, BMAX_PATH); + if (ud.config.NoAutoLoad) settings.autoload = FALSE; + else settings.autoload = TRUE; + if (glrendmode == Polymer) + { + if (settings.bpp3d == 8) settings.bpp3d = 32; + settings.polymer = TRUE; + } PopulateForm(-1); gtk_main(); SetPage(TAB_MESSAGES); - if (retval) + if (retval) // launch the game with these parameters { int32_t i; @@ -779,6 +694,8 @@ int32_t startwin_run(void) ud.config.UseJoystick = settings.usejoy; duke3dgrp = settings.selectedgrp; g_gameType = settings.game; + if (settings.autoload) ud.config.NoAutoLoad = FALSE; + else ud.config.NoAutoLoad = TRUE; for (i = 0; i