Re: [Freeciv-Dev] (PR#38411) error in data file crashes system

2007-03-25 Thread Per I. Mathisen

http://bugs.freeciv.org/Ticket/Display.html?id=38411 >

On Sun, 18 Mar 2007, Roy Gathercoal wrote:
> I just discovered (after four frustrating days of trying just about
> everything I could think of) that if one of the variables in the data
> file is too long, the entire Freeciv system crashes.
...
> I then looked at the only data file I had touched: The nation file for
> the Welsh. I had entered a few real world placenames to the list of
> Welsh cities (and took out "Barry"--I know it is an actual place name
> but how can it compare to the sheer poetry of "Llantwit Major", or
> "Ysgol Maes Dyfan"?
>
> Anyway, I had entered in a particularly descriptive and somewhat famous
> Welsh town name and apparently this is what broke Freeciv.

Can you post your modified Welsh ruleset so that we can try to reproduce 
the crash?

Thanks.

> Perhaps the Freeciv client might be adjusted so that it would not 
> immediately cover up the server's complaints?

Which client is this?

   - Per



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] Re: [Freeciv-commits] r12872 - /branches/S2_1/common/aicore/pf_tools.c

2007-03-25 Thread Daniel Markstedt

Excellent! Now we only need a new beta to stop the endless tide of
"broken bombers" bug reports...

~Daniel

On 3/26/07, Per I. Mathisen <[EMAIL PROTECTED]> wrote:

Author: per
Date: Sun Mar 25 22:28:25 2007
New Revision: 12872

URL: http://svn.gna.org/viewcvs/freeciv?rev=12872&view=rev
Log:
Band-aid fix for problem described in PR#15097 that prevents air units
from using goto to move as expected or attack. Allow movement anywhere
as long as we have movement points to return, and allow attacks, even
suicidal ones. Backport from trunk.

Modified:
branches/S2_1/common/aicore/pf_tools.c


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] Re: mission goals / improve diplomacy

2007-03-25 Thread Sam Steingold
> * Wolfram Sieber <[EMAIL PROTECTED]> [2006-07-21 00:52:43 +0200]:
>
> I'm curious why the only two mission goals of civ should be to either
> conquer the world or to succeed in space race. Transferred to everyday
> real life behaviour, that's probably the thing most people don't like
> -- dominant egoists.

:-)

> Hence, I was pondering on an alternative mission goal -- which could be
> more real life compatible, improving the social abilities of the player.

I usually abandon games as soon as the research tree is exhausted - or
as soon as my score is both
-- at least twice as large as that of each adversary
-- larger than the sum of scores of all adversaries

> So, what do you think about another one or two exit conditions for
> freeciv, like e.g. 50 years (or turns) of world peace/non-war or
> averagely e.g. 2 military units per city (i.e. no military
> aggregations anywhere)?

yuk.


-- 
Sam Steingold (http://sds.podval.org/) on Fedora Core release 6 (Zod)
http://mideasttruth.com http://pmw.org.il http://dhimmi.com http://camera.org
http://palestinefacts.org http://thereligionofpeace.com http://jihadwatch.org
Bill Gates is great, as long as `bill' is a verb.


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] limit tradeless city size

2007-03-25 Thread Sam Steingold
in addition to notradesize and fulltradesize, I suggest another option,
notraderoutesmaxsize: the maximum city size without a trade route.
e.g., a city cannot grow beyond 6 if it has no trade routes.

-- 
Sam Steingold (http://sds.podval.org/) on Fedora Core release 6 (Zod)
http://jihadwatch.org http://iris.org.il http://mideasttruth.com
http://camera.org http://truepeace.org http://thereligionofpeace.com
UNIX is as friendly to you as you are to it. Windows is hostile no matter what.


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#38363) freecive: failure to use SDL.

2007-03-25 Thread Christian Prochaska

http://bugs.freeciv.org/Ticket/Display.html?id=38363 >

> [EMAIL PROTECTED] - So 18. Mär 2007, 10:05:18]:
> 
> Version: freeciv-2.0.9.
> Output:
> 1: Error calling Mix_OpenAudio
> 1: Plugin sdl found but can't be initialized.
> 1: Plugin esd found but can't be initialized.
> 1: Plugin alsa found but can't be initialized.
> 1: No real audio subsystem managed to initialize!
> 1: Perhaps there is some misconfigurationg or bad permissions
> 2: Proceeding with sound support disabled
> 
> I don't care about lacking sound. But I would like to run FreeCiv in
> SDL mode. Why can't my SDL plugin be initialized?
> 
> Thank you for  your time,
> James Steven Supancic III
> 

If you meant the SDL client with "SDL mode", then you need Freeciv
2.1.0-beta3 or one of the development versions and run "configure" with
the "--enable-client=sdl" switch.


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#38196) [SDL client] hex tilesets lack fog

2007-03-25 Thread Christian Prochaska

http://bugs.freeciv.org/Ticket/Display.html?id=38196 >

> [dmarks - Do 15. Mär 2007, 14:31:52]:
> 
> The SDL client doesn't support world map fogging for hex tilesets
> (tested with isophex and hex2t). Seems to be a problem in both S2_1
> and trunk.
> 
> The terminal gives dozens of:
>  PORT ME: canvas_put_sprite_fogged()
> 
>  ~Daniel
> 

Patch attached.

Index: client/gui-sdl/canvas.c
===
--- client/gui-sdl/canvas.c	(Revision 12872)
+++ client/gui-sdl/canvas.c	(Arbeitskopie)
@@ -116,13 +116,16 @@
 			  struct sprite *psprite,
 			  bool fog, int fog_x, int fog_y)
 {
-  /* PORTME */
-  freelog(LOG_NORMAL, "PORT ME: canvas_put_sprite_fogged()");
-
-  /* FIXME: implement fog */
   SDL_Rect dst = {canvas_x, canvas_y, 0, 0};
 
-  alphablit(GET_SURF(psprite), NULL, pcanvas->surf, &dst);  
+  if (fog) {
+SDL_Surface *tmp_surf = blend_surface(GET_SURF(psprite), 160);
+alphablit(tmp_surf, NULL, pcanvas->surf, &dst);
+FREESURFACE(tmp_surf);
+  } else {
+canvas_put_sprite_full(pcanvas, canvas_x, canvas_y, psprite);
+  }
+
 }
 
 /
@@ -163,8 +166,15 @@
 void canvas_fog_sprite_area(struct canvas *pcanvas, struct sprite *psprite,
 			int canvas_x, int canvas_y)
 {
- /* PORTME */
-  freelog(LOG_NORMAL, "PORT ME: canvas_fog_sprite_area()");
+  SDL_Rect dst = {canvas_x, canvas_y, GET_SURF(psprite)->w,
+  GET_SURF(psprite)->h};
+  
+  SDL_Surface *tmp_surf = create_surf_alpha(GET_SURF(psprite)->w, 
+GET_SURF(psprite)->h,
+SDL_SWSURFACE);
+  SDL_FillRect(tmp_surf, NULL, SDL_MapRGBA(tmp_surf->format, 0, 0, 0, 64));
+  alphablit(tmp_surf, NULL, pcanvas->surf, &dst);
+  FREESURFACE(tmp_surf);
 }
 
 /
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] Re: [Freeciv-commits] r12862 - in /branches/S2_1: client/gui-sdl/cma_fe.c common/packets_gen.c common/packets_gen.h

2007-03-25 Thread Christian Prochaska

On 3/25/07, Christian Prochaska <[EMAIL PROTECTED]> wrote:

Author: cproc
Date: Sun Mar 25 15:39:57 2007
New Revision: 12862

URL: http://svn.gna.org/viewcvs/freeciv?rev=12862&view=rev
Log:
Fix deletion of the preset select dialog in the city governor dialog. Patch by John 
Lenton <[EMAIL PROTECTED]> in PR#38808.

Modified:
branches/S2_1/client/gui-sdl/cma_fe.c
branches/S2_1/common/packets_gen.c
branches/S2_1/common/packets_gen.h



The packets_gen.* changes seem to belong to revision 12860. This
commit was only about cma_fe.c.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#38808) CMA load preset dialog doesn't close when you select a preset [PATCH]

2007-03-25 Thread Christian Prochaska

http://bugs.freeciv.org/Ticket/Display.html?id=38808 >

> [EMAIL PROTECTED] - Sa 24. Mär 2007, 04:53:36]:
> 
> When you select a preset in the CMA dialog, the preset list never
> goes away. It just sits there, dead to the world.
> 
> Attached patch fixes the issue.
> 
> -- 
> John Lenton ([EMAIL PROTECTED])  --  http://except.com.ar/
> except - responsible free software developers for hire.
>

Thanks, committed to S2_1 and trunk.


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#38552) resolution

2007-03-25 Thread Christian Prochaska

http://bugs.freeciv.org/Ticket/Display.html?id=38552 >

> [EMAIL PROTECTED] - Di 20. Mär 2007, 21:53:18]:
> 
> Hello,
> Here I am once again with another problem. My problem is that I tried 
> the SDL client and I was having trouble with the resolution. I was 
> trying to set it to full-screen and 1280 by 800 resolution. It didn't 
> have a 1280 by 800 setting and I could not get it to stay in 
> full-screen. Could you please fix this or tell me how or what I need to 
> do to fix it.
> 
> Christopher
> 
> 

Does the 1280x800 resolution work when you set it manually in the
.civclientrc file? (look for "gui_sdl_screen_width" and
"gui_sdl_screen_height")

The attached patch fixes the "could not get it to stay in full-screen"
problem.

Index: client/gui-sdl/optiondlg.c
===
--- client/gui-sdl/optiondlg.c	(Revision 12860)
+++ client/gui-sdl/optiondlg.c	(Arbeitskopie)
@@ -424,7 +424,7 @@
   
 set_wstate(pWidget, FC_WS_DISABLED);
   
-if (gui_sdl_fullscreen != (Main.screen->flags & SDL_FULLSCREEN)) {
+if (gui_sdl_fullscreen != BOOL_VAL(Main.screen->flags & SDL_FULLSCREEN)) {
   tmp_flags ^= SDL_FULLSCREEN;
   tmp_flags ^= SDL_RESIZABLE;
 }
@@ -440,7 +440,7 @@
   
 gui_sdl_screen_width = Main.screen->w;
 gui_sdl_screen_height = Main.screen->h;
-
+
 /* change setting label */
 if (Main.screen->flags & SDL_FULLSCREEN) {
   my_snprintf(cBuf, sizeof(cBuf), _("Current Setup\nFullscreen %dx%d"),
@@ -665,8 +665,8 @@
   
 /* gui_sdl_fullscreen check box */
 pTmpGui = create_checkbox(pWindow->dst,
-  ((Main.screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN),
-  WF_RESTORE_BACKGROUND);
+  (Main.screen->flags & SDL_FULLSCREEN),
+  WF_RESTORE_BACKGROUND);
 
 pTmpGui->action = toggle_fullscreen_callback;
 set_wstate(pTmpGui, FC_WS_NORMAL);
@@ -2322,7 +2322,7 @@
 
   SDL_Client_Flags |= (CF_OPTION_MAIN | CF_OPTION_OPEN);
   
-  gui_sdl_fullscreen = Main.screen->flags & SDL_FULLSCREEN;
+  gui_sdl_fullscreen = BOOL_VAL(Main.screen->flags & SDL_FULLSCREEN);
   
   disable_main_widgets();
   
@@ -2340,7 +2340,7 @@
 
 SDL_Client_Flags &= ~(CF_OPTION_MAIN | CF_OPTION_OPEN);
 			  
-gui_sdl_fullscreen = Main.screen->flags & SDL_FULLSCREEN;
+gui_sdl_fullscreen = BOOL_VAL(Main.screen->flags & SDL_FULLSCREEN);
 
 FC_FREE(pOption_Dlg);
 enable_main_widgets();
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#38548) 2.1.0-beta3-sdl inciting crashes client

2007-03-25 Thread Christian Prochaska

http://bugs.freeciv.org/Ticket/Display.html?id=38548 >

> [EMAIL PROTECTED] - Di 20. Mär 2007, 19:48:46]:
> 
> Hi!
> 
> We discovered that inciting revolt with the Diplomat crashes the
> client. We were also able to reproduce this. However the Spy on City
> option seemed to work just fine. We didn't test the remaining options.
> 
> Regards,
> Lauri Uotinen
> 
> 

Patch attached.

Index: client/gui-sdl/diplomat_dialog.c
===
--- client/gui-sdl/diplomat_dialog.c	(Revision 12860)
+++ client/gui-sdl/diplomat_dialog.c	(Arbeitskopie)
@@ -17,6 +17,7 @@
 
 /* utility */
 #include "fcintl.h"
+#include "log.h"
 
 /* common */
 #include "game.h"
@@ -130,13 +131,13 @@
 */
 static int spy_sabotage_request(struct widget *pWidget)
 {
-  popdown_diplomat_dialog();
-
   if (find_unit_by_id(pDiplomat_Dlg->diplomat_id)
  && find_city_by_id(pDiplomat_Dlg->diplomat_target_id)) {  
 request_diplomat_action(SPY_GET_SABOTAGE_LIST, pDiplomat_Dlg->diplomat_id,
pDiplomat_Dlg->diplomat_target_id, 0);
   }
+
+  popdown_diplomat_dialog();
   
   return -1;
 }
@@ -423,12 +424,12 @@
 static int diplomat_incite_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
-popdown_diplomat_dialog();
-  
 if (find_unit_by_id(pDiplomat_Dlg->diplomat_id)
&& find_city_by_id(pDiplomat_Dlg->diplomat_target_id)) {  
   dsend_packet_city_incite_inq(&aconnection, pDiplomat_Dlg->diplomat_target_id);   
 }
+
+popdown_diplomat_dialog();
   }  
   return -1;
 }
@@ -461,12 +462,13 @@
 static int diplomat_bribe_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
-popdown_diplomat_dialog();
   
 if (find_unit_by_id(pDiplomat_Dlg->diplomat_id)
&& find_unit_by_id(pDiplomat_Dlg->diplomat_target_id)) {  
   dsend_packet_unit_bribe_inq(&aconnection, pDiplomat_Dlg->diplomat_target_id);
 }
+
+popdown_diplomat_dialog();
   }  
   return -1;
 }
@@ -1114,11 +1116,11 @@
   
   /* ugly hack */
   pUnit = unit_list_get(get_units_in_focus(), 0);
-
-  if (!pUnit || !unit_flag(pUnit,F_SPY)) {
+  
+  if (!pUnit || !is_diplomat_unit(pUnit)) {
 return;
   }
-
+  
   is_unit_move_blocked = TRUE;
   
   pIncite_Dlg = fc_calloc(1, sizeof(struct small_diplomat_dialog));
@@ -1355,8 +1357,7 @@
   /* ugly hack */
   pDiplomatUnit = unit_list_get(get_units_in_focus(), 0);
   
-  if (!pDiplomatUnit || !(unit_flag(pDiplomatUnit, F_SPY) ||
-		unit_flag(pDiplomatUnit, F_DIPLOMAT))) {
+  if (!pDiplomatUnit || !is_diplomat_unit(pDiplomatUnit)) {
 return;
   }
   
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#38545) 2.1.0-beta3-sdl selling crashes client

2007-03-25 Thread Christian Prochaska

http://bugs.freeciv.org/Ticket/Display.html?id=38545 >

> [EMAIL PROTECTED] - Di 20. Mär 2007, 19:37:48]:
> 
> Hi!
> 
> In the most recent testgame we found out that when you attempt
> to sell a building the game opens two sell dialogs (one in the
> center and one on top left of the screen). The center one is
> completely inresponsive and the top left one crashes the game
> if clicked.
> 
> We were able to reproduce this bug.
> 
> The building we attempted to sell was The Aqueduct, if it matters.
> The city in question had two other buildings, the City Wall and
> the Palace.
> 
> Regards,
> Lauri Uotinen
> 

The duplication problem is already fixed in the development version, but
it still crashed when clicking the "Sell" button. Patch for S2_1 and
trunk attached.

Index: client/gui-sdl/citydlg.c
===
--- client/gui-sdl/citydlg.c	(Revision 12860)
+++ client/gui-sdl/citydlg.c	(Arbeitskopie)
@@ -1334,8 +1334,8 @@
 
 /* popdown, we don't redraw and flush becouse this is make by redraw city dlg.
when response from server come */
-del_group_of_widgets_from_gui_list(pCityDlg->pBeginCityMenuWidgetList,
-   pCityDlg->pEndCityMenuWidgetList);
+popdown_window_group_dialog(pCityDlg->pBeginCityMenuWidgetList,
+pCityDlg->pEndCityMenuWidgetList);
   
 pCityDlg->pEndCityMenuWidgetList = NULL;
   
@@ -1362,7 +1362,7 @@
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
 struct SDL_String16 *pStr = NULL;
-struct widget *pLabel = pImpr;
+struct widget *pLabel = NULL;
 struct widget *pWindow = NULL;
 struct widget *pCancel_Button = NULL;
 struct widget *pOK_Button = NULL;
@@ -1407,7 +1407,7 @@
 /* create ok button */
 pOK_Button = create_themeicon_button_from_chars(
   pTheme->Small_OK_Icon, pWindow->dst, _("Sell"), adj_font(10),  0);
-pOK_Button->data.ptr = (void *)pLabel;
+pOK_Button->data.ptr = (void *)pImpr;
 pOK_Button->size.w = pCancel_Button->size.w;
 pOK_Button->action = sell_imprvm_dlg_ok_callback;
 pOK_Button->key = SDLK_RETURN;
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#38197) [SDL client] city garrison masking

2007-03-25 Thread Christian Prochaska

http://bugs.freeciv.org/Ticket/Display.html?id=38197 >

> [dmarks - Do 15. Mär 2007, 14:36:42]:
> 
> Black is masked in the city dialog garrison panel, clearly seen in
> this screenshot where half the Silesian (black&yellow) shield is
> transparent. Is this the intended effect?`
> 
>  ~Daniel
> 

Patch attached.


Index: client/gui-sdl/citydlg.c
===
--- client/gui-sdl/citydlg.c	(Revision 12860)
+++ client/gui-sdl/citydlg.c	(Arbeitskopie)
@@ -610,15 +610,13 @@
 {
   int i, step;
   SDL_Rect dest;
-/*  SDL_Surface *pSurf =
-SDL_DisplayFormatAlpha(get_unittype_surface(pUnit->type)); */
 
   SDL_Surface *pSurf = create_surf_alpha(tileset_full_tile_width(tileset),
 tileset_full_tile_height(tileset), SDL_SWSURFACE);
   
-  struct canvas *destcanvas = canvas_create(tileset_full_tile_width(tileset),
- tileset_full_tile_height(tileset));  
-  SDL_SetColorKey(destcanvas->surf, SDL_SRCCOLORKEY, 0);
+  struct canvas *destcanvas = canvas_create_with_alpha(
+tileset_full_tile_width(tileset),
+tileset_full_tile_height(tileset));  
   
   put_unit(pUnit, destcanvas, 0, 0);
   
@@ -626,8 +624,8 @@
 
   canvas_free(destcanvas);
 
-  if (pSurf->w > 59) {
-float zoom = 59.0 / pSurf->w;
+  if (pSurf->w > adj_size(59)) {
+float zoom = (float)adj_size(59) / pSurf->w;
 SDL_Surface *pZoomed = zoomSurface(pSurf, zoom, zoom, 1);
 FREESURFACE(pSurf);
 pSurf = pZoomed;
@@ -643,7 +641,7 @@
   step = pIcons->pFood->w;
 }
 
-dest.y = pSurf->h - pIcons->pFood->h - 2;
+dest.y = pSurf->h - pIcons->pFood->h - adj_size(2);
 dest.x = pSurf->w / 8;
 
 for (i = 0; i < pUnit->upkeep[O_SHIELD]; i++) {
Index: client/gui-sdl/mapview.c
===
--- client/gui-sdl/mapview.c	(Revision 12860)
+++ client/gui-sdl/mapview.c	(Arbeitskopie)
@@ -1323,11 +1323,9 @@
 canvas_free(terrain_canvas);
   }
 
-  terrain_canvas = canvas_create(tileset_full_tile_width(tileset),
-  tileset_full_tile_height(tileset));
+  terrain_canvas = canvas_create_with_alpha(tileset_full_tile_width(tileset),
+tileset_full_tile_height(tileset));
 
-  SDL_SetColorKey(terrain_canvas->surf, SDL_SRCCOLORKEY, 0);
-  
   put_terrain(ptile, terrain_canvas, 0, 0);
   
   return terrain_canvas->surf;
Index: client/gui-sdl/canvas.c
===
--- client/gui-sdl/canvas.c	(Revision 12860)
+++ client/gui-sdl/canvas.c	(Arbeitskopie)
@@ -49,6 +49,18 @@
 }
 
 /**
+  Create a canvas of the given size (with alpha channel).
+**/
+struct canvas *canvas_create_with_alpha(int width, int height)
+{
+  struct canvas *result = fc_malloc(sizeof(*result));	
+
+  result->surf = create_surf_alpha(width, height, SDL_SWSURFACE);
+
+  return result;
+}
+
+/**
   Free any resources associated with this canvas and the canvas struct
   itself.
 **/
Index: client/gui-sdl/canvas.h
===
--- client/gui-sdl/canvas.h	(Revision 12860)
+++ client/gui-sdl/canvas.h	(Arbeitskopie)
@@ -22,4 +22,6 @@
   SDL_Surface *surf;
 };
 
+struct canvas *canvas_create_with_alpha(int width, int height);
+
 #endif/* FC__CANVAS_H */
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev