|
From: <cro...@li...> - 2005-03-28 06:45:00
|
Module Name: client
Committed By: mwedel
Date: Mon Mar 28 06:44:53 UTC 2005
Modified Files:
client: ChangeLog configure configure.in
client/common: misc.c
client/gtk-v2/src: map.c
Log Message:
Various minor bugfixes:
configure.in, configure: Add warning message if we can't find gtk+ 2.0 or
later, but continue configure process instead of exiting.
common/misc.c: Fix code so that it compiles with older C compilers.
gtk-v2/src/map.c: Change code on need_recenter_map() - use MAX_MAP_OFFSET
instead of hard coded value of 2 - found a crash here when running
around the world map - could have been caused by a big image and/or
the fact my character moved 2 spaces in one tick. either way, this
change shouldn't impact things, as it is seldom the virtual map needs
to be recentered.
MSW 2005-03-27
Start of context diffs
Index: client/ChangeLog
diff -c client/ChangeLog:1.7 client/ChangeLog:1.8
*** client/ChangeLog:1.7 Sun Mar 27 12:51:23 2005
--- client/ChangeLog Sun Mar 27 22:44:51 2005
***************
*** 1,8 ****
! "$Id: ChangeLog,v 1.7 2005/03/27 20:51:23 akirschbaum Exp $"
Top of CVS tree:
------------------------------------------------------------------------------
This patch fixes a few memory leaks related to image caching in all clients.
common/image.c: Declare facetoname[] as static. Add all code accessing this
array. Print warning if image cannot be created.
--- 1,20 ----
! "$Id: ChangeLog,v 1.8 2005/03/28 06:44:51 mwedel Exp $"
Top of CVS tree:
------------------------------------------------------------------------------
+ Various minor bugfixes:
+ configure.in, configure: Add warning message if we can't find gtk+ 2.0 or
+ later, but continue configure process instead of exiting.
+ common/misc.c: Fix code so that it compiles with older C compilers.
+ gtk-v2/src/map.c: Change code on need_recenter_map() - use MAX_MAP_OFFSET
+ instead of hard coded value of 2 - found a crash here when running
+ around the world map - could have been caused by a big image and/or
+ the fact my character moved 2 spaces in one tick. either way, this
+ change shouldn't impact things, as it is seldom the virtual map needs
+ to be recentered.
+ MSW 2005-03-27
+
This patch fixes a few memory leaks related to image caching in all clients.
common/image.c: Declare facetoname[] as static. Add all code accessing this
array. Print warning if image cannot be created.
Index: client/configure
diff -c client/configure:1.50 client/configure:1.51
*** client/configure:1.50 Mon Mar 21 23:22:54 2005
--- client/configure Sun Mar 27 22:44:51 2005
***************
*** 2227,2233 ****
## If we have a custom action on failure, don't print errors, but
## do set a variable so people can do so.
PACKAGE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$pkg_modules"`
! echo $PACKAGE_PKG_ERRORS
fi
--- 2227,2233 ----
## If we have a custom action on failure, don't print errors, but
## do set a variable so people can do so.
PACKAGE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$pkg_modules"`
!
fi
***************
*** 2239,2249 ****
fi
if test $succeeded = yes; then
! :
else
! { { echo "$as_me:$LINENO: error: Library requirements ($pkg_modules) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5
! echo "$as_me: error: Library requirements ($pkg_modules) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;}
! { (exit 1); exit 1; }; }
fi
--- 2239,2248 ----
fi
if test $succeeded = yes; then
! CF_SUBDIRS="$CF_SUBDIRS gtk-v2"
else
! { echo "$as_me:$LINENO: WARNING: GTK v2 libraries not found - will not build gtkv2 client" >&5
! echo "$as_me: WARNING: GTK v2 libraries not found - will not build gtkv2 client" >&2;}
fi
***************
*** 2273,2279 ****
- CF_SUBDIRS="$CF_SUBDIRS gtk-v2"
DEPDIR="${am__leading_dot}deps"
--- 2272,2277 ----
Index: client/configure.in
diff -c client/configure.in:1.49 client/configure.in:1.50
*** client/configure.in:1.49 Mon Mar 21 23:22:57 2005
--- client/configure.in Sun Mar 27 22:44:52 2005
***************
*** 32,43 ****
dnl for gtk-v2 client
pkg_modules="gtk+-2.0 >= 2.0.0"
! PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
AM_MAINTAINER_MODE
AC_SUBST(PACKAGE_LIBS)
AC_SUBST(INTLLIBS)
- CF_SUBDIRS="$CF_SUBDIRS gtk-v2"
AC_CHECK_LIB(glut, main, OPENGL_LIBS="-lglut")
AC_SUBST(OPENGL_LIBS)
--- 32,43 ----
dnl for gtk-v2 client
pkg_modules="gtk+-2.0 >= 2.0.0"
! PKG_CHECK_MODULES(PACKAGE, [$pkg_modules], CF_SUBDIRS="$CF_SUBDIRS gtk-v2",
! AC_MSG_WARN(GTK v2 libraries not found - will not build gtkv2 client) )
AM_MAINTAINER_MODE
AC_SUBST(PACKAGE_LIBS)
AC_SUBST(INTLLIBS)
AC_CHECK_LIB(glut, main, OPENGL_LIBS="-lglut")
AC_SUBST(OPENGL_LIBS)
Index: client/common/misc.c
diff -c client/common/misc.c:1.9 client/common/misc.c:1.10
*** client/common/misc.c:1.9 Sat Feb 5 15:31:31 2005
--- client/common/misc.c Sun Mar 27 22:44:53 2005
***************
*** 1,5 ****
char *rcsid_common_misc_c =
! "$Id: misc.c,v 1.9 2005/02/05 23:31:31 ryo_saeba Exp $";
/*
Crossfire client, a client program for the crossfire program.
--- 1,5 ----
char *rcsid_common_misc_c =
! "$Id: misc.c,v 1.10 2005/03/28 06:44:53 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
***************
*** 24,30 ****
/*
* static char *rcsid_misc_c =
! * "$Id: misc.c,v 1.9 2005/02/05 23:31:31 ryo_saeba Exp $";
*/
--- 24,30 ----
/*
* static char *rcsid_misc_c =
! * "$Id: misc.c,v 1.10 2005/03/28 06:44:53 mwedel Exp $";
*/
***************
*** 241,249 ****
if (!cp)
return; /*no child to monitor*/
if (waitpid(cp->pid,NULL,WNOHANG)){
/*pid is dead*/
LOG(LOG_INFO,"common::monitorChilds","Child %s died. Removing and closing pipes",cp->name?cp->name:"UNKNOWN");
- ChildProcess* next;
if (cp==LastChild)
LastChild=last;
next=cp->next;
--- 241,250 ----
if (!cp)
return; /*no child to monitor*/
if (waitpid(cp->pid,NULL,WNOHANG)){
+ ChildProcess* next;
+
/*pid is dead*/
LOG(LOG_INFO,"common::monitorChilds","Child %s died. Removing and closing pipes",cp->name?cp->name:"UNKNOWN");
if (cp==LastChild)
LastChild=last;
next=cp->next;
Index: client/gtk-v2/src/map.c
diff -c client/gtk-v2/src/map.c:1.5 client/gtk-v2/src/map.c:1.6
*** client/gtk-v2/src/map.c:1.5 Sat Mar 26 11:19:13 2005
--- client/gtk-v2/src/map.c Sun Mar 27 22:44:53 2005
***************
*** 1,5 ****
char *rcsid_gtk2_map_c =
! "$Id: map.c,v 1.5 2005/03/26 19:19:13 akirschbaum Exp $";
/*
Crossfire client, a client program for the crossfire program.
--- 1,5 ----
char *rcsid_gtk2_map_c =
! "$Id: map.c,v 1.6 2005/03/28 06:44:53 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
***************
*** 297,313 ****
/*
* Returns true if virtual view is about to butt up against
* the side of the virtual map on the next scroll
! * Add 2 as a fudge factor - in this way, code that checks
! * within the displayable area but +/-1 of the edges will
! * still process data within bounds.
*/
static int need_recenter_map( int dx, int dy)
{
! if( pl_pos.x + dx + use_config[CONFIG_MAPWIDTH] +2 >= the_map.x ||
! pl_pos.y + dy + use_config[CONFIG_MAPHEIGHT] +2 >= the_map.y ||
! pl_pos.x + dx -2 <= 0 ||
! pl_pos.y + dy -2 <= 0 )
{
return TRUE;
}
--- 297,314 ----
/*
* Returns true if virtual view is about to butt up against
* the side of the virtual map on the next scroll
! * Add 5 as a fudge factor - two wasn't enough - faster
! * players could hop two spaces in one tick, which would
! * cause problems here. 5 gives a decent buffer just in
! * case.
*/
static int need_recenter_map( int dx, int dy)
{
! if( pl_pos.x + dx + use_config[CONFIG_MAPWIDTH] + MAX_MAP_OFFSET >= the_map.x ||
! pl_pos.y + dy + use_config[CONFIG_MAPHEIGHT] + MAX_MAP_OFFSET >= the_map.y ||
! pl_pos.x + dx -5 <= 0 ||
! pl_pos.y + dy -5 <= 0 )
{
return TRUE;
}
|