downgraded default profile to core2
[k8sbuild.git] / xoptz / xscorch.xopt
blobddb79ccc289c3aaf21ac8abba3c1cc02e31f1a28
1 profile=empty
3   --enable-network        Enable network gameplay yes
4   --disable-sound          Enable sound/music yes
5   --without-readline
6   --without-gtk-12
9 [postconfig-patch]
10 diff --git a/sgame/sconfig.c b/sgame/sconfig.c
11 index a11f816..ec1e91f 100644
12 --- a/sgame/sconfig.c
13 +++ b/sgame/sconfig.c
14 @@ -408,21 +408,28 @@ void sc_config_init_round(sc_config *c) {
18 -void sc_config_init_turn(sc_config *c) {
20 -   int i;
22 -   c->componly = true;
23 -   i = c->numplayers;
24 -   while(--i >= 0) {
25 -      if(c->players[i]->aitype == SC_AI_HUMAN && SC_PLAYER_IS_ALIVE(c->players[i])) c->componly = false;
26 -      if(SC_PLAYER_IS_ALIVE(c->players[i])) sc_player_init_turn(c, c->players[i]);
27 -   }
28 -   sc_physics_update_wind(c->physics);
29 +int sc_config_fix_humans_flag_only_comps (sc_config *c) {
30 +  int f;
31 +  c->componly = true;
32 +  for (f = c->numplayers-1; f >= 0; --f) {
33 +     if (c->players[f]->aitype == SC_AI_HUMAN && SC_PLAYER_IS_ALIVE(c->players[f])) {
34 +       c->componly = false;
35 +       break;
36 +     }
37 +  }
38 +  return c->componly == true;
41 -   /* Update the status bar and display */
42 -   sc_window_paint(c->window, 0, 0, 0, 0, SC_CLEAR_WIND_ARROW | SC_REDRAW_WIND_ARROW);
44 +void sc_config_init_turn (sc_config *c) {
45 +  int f;
46 +  c->componly = sc_config_fix_humans_flag_only_comps(c);
47 +  for (f = c->numplayers-1; f >= 0; --f) {
48 +     if (SC_PLAYER_IS_ALIVE(c->players[f])) sc_player_init_turn(c, c->players[f]);
49 +  }
50 +  sc_physics_update_wind(c->physics);
51 +  /* Update the status bar and display */
52 +  sc_window_paint(c->window, 0, 0, 0, 0, SC_CLEAR_WIND_ARROW | SC_REDRAW_WIND_ARROW);
53  }
56 diff --git a/sgame/sconfig.h b/sgame/sconfig.h
57 index 1aa7b2b..4e4b79e 100644
58 --- a/sgame/sconfig.h
59 +++ b/sgame/sconfig.h
60 @@ -213,5 +213,7 @@ void sc_config_init_game(sc_config *c);
61  void sc_config_init_round(sc_config *c);
62  void sc_config_init_turn(sc_config *c);
64 +extern int sc_config_fix_humans_flag_only_comps (sc_config *c);
67  #endif /* __sconfig_h_included */
68 diff --git a/sgame/sland.c b/sgame/sland.c
69 index 041ac1a..c25bde7 100644
70 --- a/sgame/sland.c
71 +++ b/sgame/sland.c
72 @@ -827,6 +827,7 @@ void sc_land_level_around(const sc_config *c, sc_land *l, int x, int w, int ht)
73     x1 = x - w;
74     x2 = x + w;
76 +   cx = x; /*k8: fixed warning*/
77     /* Level the columns in the interval. */
78     for(x = x1; cx <= x2; ++x) {
79        cx = x;
80 diff --git a/sgame/splayer.c b/sgame/splayer.c
81 index 1a3f777..6789b04 100644
82 --- a/sgame/splayer.c
83 +++ b/sgame/splayer.c
84 @@ -752,11 +752,10 @@ void sc_player_inc_wins(sc_config *c, sc_player *p) {
87  void sc_player_died(sc_config *c, sc_player *p) {
88 -/* sc_player_died */
90 -   p->dead = true;
91 -   p->money -= c->economics->deathloss;
93 +  p->dead = true;
94 +  p->money -= c->economics->deathloss;
95 +  /*k8: fix componly flag, so 'fast graphics' can be used right from here */
96 +  sc_config_fix_humans_flag_only_comps(c);
97  }
100 diff --git a/sgtk/sdialog-gtk.h b/sgtk/sdialog-gtk.h
101 index b083bb6..d371425 100644
102 --- a/sgtk/sdialog-gtk.h
103 +++ b/sgtk/sdialog-gtk.h
104 @@ -35,7 +35,7 @@
106  /* Tooltips and dialogue helpers */
107  static inline GtkWidget *tooltip(sc_window_gtk *w, const char *help, GtkWidget *widget) {
109 +  (void)w; /* shut up the compiler */
110  #if 0 /* TEMP - Not working ... do we even need it? */
111     if(GTK_IS_COMBO_BOX(widget)) {
112        /* TEMP - This was the COMBO non-BOX version using the old w->tooltips... */
113 diff --git a/sgtk/sexplosion-gtk.c b/sgtk/sexplosion-gtk.c
114 index 4693b44..5119c92 100644
115 --- a/sgtk/sexplosion-gtk.c
116 +++ b/sgtk/sexplosion-gtk.c
117 @@ -26,6 +26,8 @@
118  #include <stdio.h>
119  #include <stdlib.h>
121 +#include <gdk/gdk.h>
123  #include <sgtk.h>
124  #include <sdisplay.h>
126 diff --git a/sgtk/simage-gtk.c b/sgtk/simage-gtk.c
127 index 08c0c2b..23b6684 100644
128 --- a/sgtk/simage-gtk.c
129 +++ b/sgtk/simage-gtk.c
130 @@ -21,6 +21,8 @@
131     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
133  */
134 +#include <gdk/gdk.h>
136  #include <sgtk.h>
137  #include <simage-gtk.h>
139 diff --git a/sgtk/smenu-gtk.c b/sgtk/smenu-gtk.c
140 index 7672356..c504f32 100644
141 --- a/sgtk/smenu-gtk.c
142 +++ b/sgtk/smenu-gtk.c
143 @@ -183,7 +183,7 @@ static void _sc_action_network_status_gtk(sc_window_gtk *w) {
146  void sc_window_update_menus_gtk(sc_window_gtk *w) {
148 +  (void)w; /* shut up the compiler */
149     #if USE_NETWORK
150        sc_config *c = w->c;
152 @@ -207,7 +207,7 @@ void sc_window_create_menus_gtk(sc_window_gtk *w) {
154     /* OMG I HATE XML */
156 -   char *main_menu_xml = "<ui> \
157 +   const char *main_menu_xml = "<ui> \
158     <menubar name=\"MenuBar\"> \
159        <menu action=\"MenuGame\"> \
160           <menuitem action=\"Pause\" /> \
161 diff --git a/sgtk/soptions-gtk.c b/sgtk/soptions-gtk.c
162 index dd0b2d9..83a0bca 100644
163 --- a/sgtk/soptions-gtk.c
164 +++ b/sgtk/soptions-gtk.c
165 @@ -21,6 +21,8 @@
166     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
168  */
169 +#include <gtk/gtk.h>
171  #include <sgtk.h>
172  #include <sdialog.h>
173  #include <slabel.h>
174 diff --git a/sgtk/spaint-gtk.c b/sgtk/spaint-gtk.c
175 index aad0c29..133d8c3 100644
176 --- a/sgtk/spaint-gtk.c
177 +++ b/sgtk/spaint-gtk.c
178 @@ -25,6 +25,8 @@
179  #include <stdio.h>
180  #include <stdlib.h>
182 +#include <gdk/gdk.h>
184  #include <sgtk.h>
185  #include <sconsole.h>
186  #include <sdisplay.h>
187 @@ -270,10 +272,17 @@ static void _sc_window_draw_tank_gtk(sc_window_gtk *w, const sc_player *p) {
189     /* Draw tank's turret. */
190     radius = p->tank->turretradius;
191 -   gdk_draw_line(buffer, gc, 
192 -                 x, y, 
193 -                 x + rint(radius * cos(p->turret * M_PI / 180)), 
194 -                 y - rint(radius * sin(p->turret * M_PI / 180)));
195 +   {
196 +     int x1 = x+rint(radius*cos(p->turret*M_PI/180));
197 +     int y1 = y-rint(radius*sin(p->turret*M_PI/180));
198 +     /*
199 +     fprintf(stderr, "%d: [%s]: turret: angle=%d; radius=%d; line=(%d,%d-%d,%d)\n",
200 +       p->index, p->name,
201 +       p->turret, radius,
202 +       x, y, x1, y1);
203 +     */
204 +     gdk_draw_line(buffer, gc, x, y, x1, y1);
205 +   }
207     /* Make sure all of this gets drawn. */
208     tx1 = x - radius;
209 diff --git a/sgtk/ssound-gtk.c b/sgtk/ssound-gtk.c
210 index 72c860b..48551f2 100644
211 --- a/sgtk/ssound-gtk.c
212 +++ b/sgtk/ssound-gtk.c
213 @@ -37,7 +37,7 @@
215  #if !USE_SOUND
216  void sc_sound_setup_gtk(sc_window_gtk *w) {
217 -   
218 +   (void)w; /* shut up the compiler */
219     sc_dialog_message("Sound support not enabled", "Sound support not enabled");
220     
222 diff --git a/sgtk/sspill-gtk.c b/sgtk/sspill-gtk.c
223 index 6e79407..881bc08 100644
224 --- a/sgtk/sspill-gtk.c
225 +++ b/sgtk/sspill-gtk.c
226 @@ -21,6 +21,8 @@
227     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
229  */
230 +#include <gdk/gdk.h>
232  #include <sgtk.h>
233  #include <sdisplay.h>
235 diff --git a/sgtk/swidgets/sactiveconsole.c b/sgtk/swidgets/sactiveconsole.c
236 index 044d641..437bf11 100644
237 --- a/sgtk/swidgets/sactiveconsole.c
238 +++ b/sgtk/swidgets/sactiveconsole.c
239 @@ -408,7 +408,7 @@ static void _sc_active_console_paint_region(ScConsole *_cons, GdkRectangle *boun
241  static void _sc_active_console_enter_spot(ScActiveConsole *cons, gboolean forceenter) {
243 -   if(!forceenter && !GTK_WIDGET_HAS_FOCUS(GTK_WIDGET(cons))) {
244 +   if(!forceenter && !gtk_widget_has_focus(GTK_WIDGET(cons))) {
245        return;
246     }
247     if(cons->current != NULL) {
248 @@ -421,7 +421,7 @@ static void _sc_active_console_enter_spot(ScActiveConsole *cons, gboolean forcee
250  static void _sc_active_console_leave_spot(ScActiveConsole *cons, gboolean forceleave) {
252 -   if(!forceleave && !GTK_WIDGET_HAS_FOCUS(GTK_WIDGET(cons))) {
253 +   if(!forceleave && !gtk_widget_has_focus(GTK_WIDGET(cons))) {
254        return;
255     }
256     if(cons->current != NULL) {
257 @@ -1282,7 +1282,7 @@ static void _sc_active_console_init_obj(ScActiveConsole *cons) {
258     cons->spots = NULL;
259     cons->current = NULL;
261 -   GTK_WIDGET_SET_FLAGS(GTK_WIDGET(cons), GTK_CAN_DEFAULT);
262 +   gtk_widget_set_can_default(GTK_WIDGET(cons), TRUE);
263     gtk_widget_set_events(GTK_WIDGET(cons), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
266 diff --git a/sgtk/swidgets/sactoggle.c b/sgtk/swidgets/sactoggle.c
267 index cc0ab83..d77da36 100644
268 --- a/sgtk/swidgets/sactoggle.c
269 +++ b/sgtk/swidgets/sactoggle.c
270 @@ -26,10 +26,11 @@
271  #include <assert.h>
272  #include <stdio.h>
274 -#include <sactoggle.h>
276 +#include <gdk/gdk.h>
277  #include <gdk/gdkkeysyms.h>
279 +#include "sactoggle.h"
283  static ScGadgetClass *parent_class;
284 @@ -69,12 +70,12 @@ static void _sc_ac_toggle_draw(ScGadget *gadget) {
285     sc_gadget_get_extents(gadget, &bounds);
287     /* Find out if this gadget has the focus right now. */
288 -   focus = (GTK_WIDGET_HAS_FOCUS(gadget->console) &&
289 +   focus = (gtk_widget_has_focus(GTK_WIDGET(gadget->console)) &&
290              (gadget->console->current->data == gadget->spot))
291             ? TRUE : FALSE;
293     /* Find out if the gadget will be sensitive. */
294 -   sensitive = GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(gadget->console));
295 +   sensitive = gtk_widget_is_sensitive(GTK_WIDGET(gadget->console));
297     /* Setup the GC colors for the toggle (drawing outer). */
298     if(!sensitive)
299 diff --git a/sgtk/swidgets/sconsole.c b/sgtk/swidgets/sconsole.c
300 index a494f39..9788a59 100644
301 --- a/sgtk/swidgets/sconsole.c
302 +++ b/sgtk/swidgets/sconsole.c
303 @@ -569,7 +569,7 @@ static void _sc_console_draw_region(ScConsole *cons, gint x, gint y, gint width,
304           if(_sc_console_in_bounds(cx, cy, cons->cursor.x, cons->cursor.y,
305                                    cons->cursor.width, cons->cursor.height)) {
306              /* Welp, we're on the cursor.. all that work, for nothing */
307 -            if(GTK_WIDGET_HAS_FOCUS((GtkWidget *)cons)) {
308 +            if(gtk_widget_has_focus((GtkWidget *)cons)) {
309                 if(cons->cursor.highlighted) {
310                    fgcolor = &cons->colors.forelight;
311                    bgcolor = &cons->colors.backlight;
312 @@ -905,7 +905,7 @@ static gint _sc_console_draw_focus(GtkWidget *widget, GdkEventFocus *event) {
314     ScConsole *cons = SC_CONSOLE(widget);
316 -   GTK_WIDGET_SET_FLAGS(widget, GTK_HAS_FOCUS);
317 +   gtk_widget_set_can_focus(widget, TRUE);
318     _sc_console_draw_region(cons, cons->cursor.x, cons->cursor.y, cons->cursor.width, cons->cursor.height);
320     /* Check for a parent signal handler */
321 @@ -927,7 +927,7 @@ static gint _sc_console_undraw_focus(GtkWidget *widget, GdkEventFocus *event) {
323     ScConsole *cons = SC_CONSOLE(widget);
325 -   GTK_WIDGET_UNSET_FLAGS(widget, GTK_HAS_FOCUS);
326 +   gtk_widget_set_can_focus(widget, FALSE);
327     _sc_console_draw_region(cons, cons->cursor.x, cons->cursor.y, cons->cursor.width, cons->cursor.height);
329     /* Check for a parent signal handler */
330 @@ -1207,7 +1207,7 @@ static void _sc_console_init_obj(ScConsole *cons) {
331     cons->colors.bold = FALSE;
333     /* Make sure the console is focusable. */
334 -   GTK_WIDGET_SET_FLAGS(cons, GTK_CAN_FOCUS);
335 +   gtk_widget_set_can_focus(GTK_WIDGET(cons), TRUE); /*k8: shut up!*/
339 diff --git a/sgtk/swidgets/sdisplay.c b/sgtk/swidgets/sdisplay.c
340 index 3d4713a..d57c1db 100644
341 --- a/sgtk/swidgets/sdisplay.c
342 +++ b/sgtk/swidgets/sdisplay.c
343 @@ -31,7 +31,7 @@ static void _sc_display_init_obj(ScDisplay *dpy) {
345     assert(IS_SC_DISPLAY(dpy));
346     dpy->draw = NULL;
347 -   GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(dpy), GTK_CAN_FOCUS);
348 +   gtk_widget_set_can_focus(GTK_WIDGET(dpy), FALSE);
349     
352 diff --git a/sgtk/swidgets/sdrawbuf.c b/sgtk/swidgets/sdrawbuf.c
353 index 08c615e..ec41d25 100644
354 --- a/sgtk/swidgets/sdrawbuf.c
355 +++ b/sgtk/swidgets/sdrawbuf.c
356 @@ -21,7 +21,9 @@
357     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
359  */
360 -#include <sdrawbuf.h>
361 +#include <gdk/gdk.h>
363 +#include "sdrawbuf.h"
367 @@ -116,7 +118,7 @@ static gint _sc_drawbuf_configure(GtkWidget *widget, GdkEventConfigure *event) {
368  static gint _sc_drawbuf_expose(GtkWidget *widget, GdkEventExpose *event) {
370     ScDrawbuf *draw = SC_DRAWBUF(widget);
371 -   GdkGC *fg_gc = widget->style->fg_gc[GTK_WIDGET_STATE((GtkWidget *)draw)];
372 +   GdkGC *fg_gc = widget->style->fg_gc[gtk_widget_get_state((GtkWidget *)draw)];
374     /* Make sure buffer is allocated */
375     g_return_val_if_fail(sc_drawbuf_get_buffer(draw) != NULL, TRUE);
376 @@ -156,7 +158,7 @@ static void _sc_drawbuf_init_obj(ScDrawbuf *draw) {
377     draw->style_configured = FALSE;
379     /* Setup widget, and object signals */
380 -   GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(draw), GTK_CAN_FOCUS);
381 +   gtk_widget_set_can_focus(GTK_WIDGET(draw), FALSE);
382     gtk_widget_add_events(GTK_WIDGET(draw), GDK_EXPOSURE_MASK);
383     gtk_widget_set_app_paintable(GTK_WIDGET(draw), TRUE);
385 diff --git a/sgtk/swindow-gtk.c b/sgtk/swindow-gtk.c
386 index ec73ab6..7688210 100644
387 --- a/sgtk/swindow-gtk.c
388 +++ b/sgtk/swindow-gtk.c
389 @@ -370,7 +370,9 @@ sc_window *sc_window_new(sc_config *c, __libj_unused int argc, __libj_unused cha
390     if(w->c->options.tooltips) gtk_tooltips_enable(w->tooltips);
391     else                       gtk_tooltips_disable(w->tooltips);
392  #else
393 +   /*K8FIXME!
394     #warning Mumble mumble tooltips mumble...
395 +   */
396  /*
397     if(w->c->options.tooltips) gtk_tooltips_enable(w);
398     else                       gtk_tooltips_disable(w);
399 @@ -599,7 +601,6 @@ void sc_window_load_fonts(sc_window_gtk *w) {
401  void sc_window_unload_fonts(sc_window_gtk *w) {
403 -int i;
404     assert(w != NULL);
406     if(w->fixed_font != NULL)        gdk_font_unref(w->fixed_font);
407 [/postconfig-patch]
411 !DESC
412 Xscorch
414 Xscorch is a clone of the classic DOS game, "Scorched Earth".
415 The basic goal is to annihilate enemy tanks using overpowered guns.
416 Basically, you buy weapons, you target the enemy by adjusting the
417 angle of your turret and firing power, and you hope to destroy their
418 tank before they destroy yours.
419 !EOF