|
From: <cro...@li...> - 2005-03-22 07:23:10
|
Module Name: client
Committed By: mwedel
Date: Tue Mar 22 07:23:01 UTC 2005
Modified Files:
client: ChangeLog configure configure.in
client/common: client.h commands.c config.h.in image.c init.c
client/gtk: config.c gx11.c gx11.h image.c map.c sdl.c
client/gtk-v2/src: Makefile.am Makefile.in config.c gtk2proto.h image.c
image.h info.c inventory.c keys.c main.c map.c png.c sdl.c
client/x11: xutil.c
Added Files:
client/gtk-v2/src: opengl.c
Log Message:
Main change of this is addition of opengl drawing for the map in the gtk-v2
client. On my system, the opengl code is about 10 times faster than the
sdl code was, making it so I can turn on all the bells and whistles (smoothing,
best lighting) and still use less than 10% cpu time. As part of this, I
redid the smoothing logic, so the client now requires a new server for
smoothing to work (needs push logic, as client won't request smoothing
info as that adds a lot of complication). This change was done because
the old smoothing code wasn't that efficient - now, we store the smoothing
face along with the face it smooths, so finding the smoothing info is
much faster.
--
configure.in, configure: Add check for -lglut - indication we have opengl
libraries available.
common/client.h: Remove Smooths struct. Change CONFIG_SDL to
CONFIG_DISPLAY, and add CFG_DM_... to denote different display modes,
since there is more than just sdl and not sdl now.
common/commands.c: Don't have SmoothCmd try to update what spaces need
to be redrawn - for opengl, it doesn't care about that, and for
most other maps, it will figure it out when it needs to redraw
anyways.
common/config.h.in: Addition of HAVE_OPENGL line.
common/image.c: Remove getsmooth() - rely on push logic.
common/init.c: Update want_config[CONFIG_SDL] to
want_config[CONFIG_DISPLAYMODE]
gtk/config.c: Change access to CONFIG_DISPLAYMODE
gtk/gx11.c: Change access to CONFIG_DISPLAYMODE. Add -smooth command line
option.
gtk/gx11.h: Add smooth_face to PixmapInfo struct.
gtk/image.c: Change access to CONFIG_DISPLAYMODE. When getting new
PixmapInfo struct, use calloc so we are sure all fields are initialized
to zero. Add addsmooth().
gtk/map.c: Change access to CONFIG_DISPLAYMODE. Change how we access
smooth face info.
gtk/sdl.c: Change how we access smooth face info.
gtk-v2/src/Makefile.am, gtk-v2/src/Makefile.in: Add addition of OPENGL_LIBS
to link libs. Add opengl.c file.
gtk-v2/src/config.c: Add image.h include.
gtk-v2/src/gtk2proto.h: Rebuilt.
gtk-v2/src/image.c: Change access to CONFIG_DISPLAYMODE. Add hooks for
opengl image generation. Change call for pixmap creation from malloc
to calloc. Add addsmooth().
gtk-v2/src/image.h. If we have opengl, include GL/gl.h. Add fields
for opengl texture maps.
gtk-v2/src/info.c: Update so text line wraps if it is too long.
gtk-v2/src/inventory.c: Add checks to make sure object face is
valid before trying to draw. In icon mode, add code to cleanup
old fields (if you drop an item, it wouldn't erase the list item
in the list). Also, free callbacks, as they effectively stack,
and we were using incorrect object pointers (pointer from first
callback, which didn't match current one).
gtk-v2/src/keys.c: Add image.h to includes.
gtk-v2/src/main.c: Add image.h to includes. Change access to
CONFIG_DISPLAYMODE. Add -opengl command switch. Remove
+sdl and popups command line options. Relocate setup of
cache call setup to after we know all windows have been created.
gtk-v2/src/map.c: Change access to CONFIG_DISPLAYMODE. Add opengl
drawing hooks. Change access for smooth info. Implement
button press code for map window (basically grabbed from
gtk/map.c)
gtk-v2/src/opengl.c: New file containing opengl draw code.
gtk-v2/src/png.c: Remove some unused code resulting in compile warnings.
gtk-v2/src/sdl.c: Remove some commented out code. Change access method
for smoothing code.
x11/xutil.c: Change access to CONFIG_DISPLAYMODE. Add addsmooth()
function.
MSW 2005-03-20
The following files had too many changes to show the context diffs here:
cvs rdiff -r1.49 -r1.50 client/configure
cvs rdiff -r1.60 -r1.61 client/gtk/gx11.c
cvs rdiff -r0 -r1.1 client/gtk-v2/src/opengl.c
Start of context diffs
Index: client/ChangeLog
diff -c client/ChangeLog:1.4 client/ChangeLog:1.5
*** client/ChangeLog:1.4 Sun Mar 13 07:18:21 2005
--- client/ChangeLog Mon Mar 21 23:22:54 2005
***************
*** 1,9 ****
! "$Id: ChangeLog,v 1.4 2005/03/13 15:18:21 ryo_saeba Exp $"
Top of CVS tree:
------------------------------------------------------------------------------
! Applied patch #1161817 (cowboyatheart): Add wands/staves/rods/horns to new pickup (client).
gtk/gx11.c: add new 'magic devices' menu option.
Ryo 2005-03-13
--- 1,77 ----
! "$Id: ChangeLog,v 1.5 2005/03/22 07:22:54 mwedel Exp $"
Top of CVS tree:
------------------------------------------------------------------------------
! Main change of this is addition of opengl drawing for the map in the gtk-v2
! client. On my system, the opengl code is about 10 times faster than the
! sdl code was, making it so I can turn on all the bells and whistles (smoothing,
! best lighting) and still use less than 10% cpu time. As part of this, I
! redid the smoothing logic, so the client now requires a new server for
! smoothing to work (needs push logic, as client won't request smoothing
! info as that adds a lot of complication). This change was done because
! the old smoothing code wasn't that efficient - now, we store the smoothing
! face along with the face it smooths, so finding the smoothing info is
! much faster.
! --
! configure.in, configure: Add check for -lglut - indication we have opengl
! libraries available.
! common/client.h: Remove Smooths struct. Change CONFIG_SDL to
! CONFIG_DISPLAY, and add CFG_DM_... to denote different display modes,
! since there is more than just sdl and not sdl now.
! common/commands.c: Don't have SmoothCmd try to update what spaces need
! to be redrawn - for opengl, it doesn't care about that, and for
! most other maps, it will figure it out when it needs to redraw
! anyways.
! common/config.h.in: Addition of HAVE_OPENGL line.
! common/image.c: Remove getsmooth() - rely on push logic.
! common/init.c: Update want_config[CONFIG_SDL] to
! want_config[CONFIG_DISPLAYMODE]
! gtk/config.c: Change access to CONFIG_DISPLAYMODE
! gtk/gx11.c: Change access to CONFIG_DISPLAYMODE. Add -smooth command line
! option.
! gtk/gx11.h: Add smooth_face to PixmapInfo struct.
! gtk/image.c: Change access to CONFIG_DISPLAYMODE. When getting new
! PixmapInfo struct, use calloc so we are sure all fields are initialized
! to zero. Add addsmooth().
! gtk/map.c: Change access to CONFIG_DISPLAYMODE. Change how we access
! smooth face info.
! gtk/sdl.c: Change how we access smooth face info.
! gtk-v2/src/Makefile.am, gtk-v2/src/Makefile.in: Add addition of OPENGL_LIBS
! to link libs. Add opengl.c file.
! gtk-v2/src/config.c: Add image.h include.
! gtk-v2/src/gtk2proto.h: Rebuilt.
! gtk-v2/src/image.c: Change access to CONFIG_DISPLAYMODE. Add hooks for
! opengl image generation. Change call for pixmap creation from malloc
! to calloc. Add addsmooth().
! gtk-v2/src/image.h. If we have opengl, include GL/gl.h. Add fields
! for opengl texture maps.
! gtk-v2/src/info.c: Update so text line wraps if it is too long.
! gtk-v2/src/inventory.c: Add checks to make sure object face is
! valid before trying to draw. In icon mode, add code to cleanup
! old fields (if you drop an item, it wouldn't erase the list item
! in the list). Also, free callbacks, as they effectively stack,
! and we were using incorrect object pointers (pointer from first
! callback, which didn't match current one).
! gtk-v2/src/keys.c: Add image.h to includes.
! gtk-v2/src/main.c: Add image.h to includes. Change access to
! CONFIG_DISPLAYMODE. Add -opengl command switch. Remove
! +sdl and popups command line options. Relocate setup of
! cache call setup to after we know all windows have been created.
! gtk-v2/src/map.c: Change access to CONFIG_DISPLAYMODE. Add opengl
! drawing hooks. Change access for smooth info. Implement
! button press code for map window (basically grabbed from
! gtk/map.c)
! gtk-v2/src/opengl.c: New file containing opengl draw code.
! gtk-v2/src/png.c: Remove some unused code resulting in compile warnings.
! gtk-v2/src/sdl.c: Remove some commented out code. Change access method
! for smoothing code.
! x11/xutil.c: Change access to CONFIG_DISPLAYMODE. Add addsmooth()
! function.
! MSW 2005-03-20
!
! Applied patch #1161817 (cowboyatheart): Add wands/staves/rods/horns to new
! pickup (client).
gtk/gx11.c: add new 'magic devices' menu option.
Ryo 2005-03-13
Index: client/configure.in
diff -c client/configure.in:1.48 client/configure.in:1.49
*** client/configure.in:1.48 Wed Mar 2 00:19:43 2005
--- client/configure.in Mon Mar 21 23:22:57 2005
***************
*** 39,44 ****
--- 39,49 ----
AC_SUBST(INTLLIBS)
CF_SUBDIRS="$CF_SUBDIRS gtk-v2"
+ AC_CHECK_LIB(glut, main, OPENGL_LIBS="-lglut")
+ AC_SUBST(OPENGL_LIBS)
+ if eval "test x$OPENGL_LIBS != x"; then
+ AC_DEFINE(HAVE_OPENGL)
+ fi
dnl end of gtk-v2 stuff
Index: client/common/client.h
diff -c client/common/client.h:1.24 client/common/client.h:1.25
*** client/common/client.h:1.24 Sun Feb 13 21:42:01 2005
--- client/common/client.h Mon Mar 21 23:22:58 2005
***************
*** 1,6 ****
/*
* static char *rcsid_client_h =
! * "$Id: client.h,v 1.24 2005/02/14 05:42:01 mwedel Exp $";
*/
/*
Crossfire client, a client program for the crossfire program.
--- 1,6 ----
/*
* static char *rcsid_client_h =
! * "$Id: client.h,v 1.25 2005/03/22 07:22:58 mwedel Exp $";
*/
/*
Crossfire client, a client program for the crossfire program.
***************
*** 74,88 ****
extern Animations animations[MAXANIM];
- #define MAXSMOOTH 1000
- typedef struct Smooths {
- uint8 received:1;
- uint16 smoothid;
- uint16 face;
- } Smooths;
-
- extern Smooths smooths[MAXSMOOTH];
- extern int smoothused;
#define CAN_SMOOTH(__SMOOTHLEVEL) (__SMOOTHLEVEL)
/* ClientSocket could probably hold more of the global values - it could
--- 74,79 ----
***************
*** 146,152 ****
#define CONFIG_ICONSCALE 9
#define CONFIG_MAPSCALE 10
#define CONFIG_POPUPS 11
! #define CONFIG_SDL 12
#define CONFIG_SHOWICON 13
#define CONFIG_TOOLTIPS 14
#define CONFIG_SOUND 15
--- 137,143 ----
#define CONFIG_ICONSCALE 9
#define CONFIG_MAPSCALE 10
#define CONFIG_POPUPS 11
! #define CONFIG_DISPLAYMODE 12
#define CONFIG_SHOWICON 13
#define CONFIG_TOOLTIPS 14
#define CONFIG_SOUND 15
***************
*** 172,177 ****
--- 163,176 ----
#define CFG_LT_PIXEL 2
#define CFG_LT_PIXEL_BEST 3
+ /* CONFIG_DISPLAYMODE can have several possible values. Give
+ * defines for the possibilities.
+ */
+ #define CFG_DM_PIXMAP 0
+ #define CFG_DM_SDL 1
+ #define CFG_DM_OPENGL 2
+
+
extern sint16 want_config[CONFIG_NUMS], use_config[CONFIG_NUMS];
/* see common/init.c - basically, this is a string to number
Index: client/common/config.h.in
diff -c client/common/config.h.in:1.3 client/common/config.h.in:1.4
*** client/common/config.h.in:1.3 Sat May 17 22:59:58 2003
--- client/common/config.h.in Mon Mar 21 23:22:58 2005
***************
*** 95,97 ****
--- 95,100 ----
/* The size of a `long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG
+
+ /* The size of a `long long', as computed by sizeof. */
+ #undef HAVE_OPENGL
Index: client/common/image.c
diff -c client/common/image.c:1.16 client/common/image.c:1.17
*** client/common/image.c:1.16 Fri Jan 30 14:03:37 2004
--- client/common/image.c Mon Mar 21 23:22:58 2005
***************
*** 1,5 ****
char *rcsid_common_image_c =
! "$Id: image.c,v 1.16 2004/01/30 22:03:37 ryo_saeba Exp $";
/*
Crossfire client, a client program for the crossfire program.
--- 1,5 ----
char *rcsid_common_image_c =
! "$Id: image.c,v 1.17 2005/03/22 07:22:58 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
***************
*** 367,399 ****
void requestsmooth (int pnum){
cs_print_string (csocket.fd, "asksmooth %d",pnum);
}
- int getsmooth (int face){
- int i;
- if (smoothused<1){
- smooths[0].smoothid=face;
- smooths[0].received=0;
- requestsmooth(face);
- smoothused++;
- return 0;
- }
- for (i=0;i<smoothused;i++){
- if (smooths[i].smoothid==face){
- if (smooths[i].received)
- return smooths[i].face;
- else{
- return -1;
- }
- }
- }
- if (smoothused<MAXSMOOTH){
- smooths[smoothused].smoothid=face;
- smooths[smoothused].received=0;
- requestsmooth(face);
- smoothused++;
- return -1;
- }
- return -1;
- }
/******************************************************************************
*
--- 367,372 ----
***************
*** 506,516 ****
facetoname[i]=NULL;
}
}
- /* Also reset smooth data, considered to be part of image cache
- * (Actually this is the better place to handle it) :P
- */
- smoothused=0;
- memset (smooths,sizeof(Smooths)*MAXSMOOTH,0);
}
--- 479,484 ----
Index: client/common/init.c
diff -c client/common/init.c:1.20 client/common/init.c:1.21
*** client/common/init.c:1.20 Wed Feb 9 23:03:35 2005
--- client/common/init.c Mon Mar 21 23:22:58 2005
***************
*** 1,5 ****
char *rcsid_common_init_c =
! "$Id: init.c,v 1.20 2005/02/10 07:03:35 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
--- 1,5 ----
char *rcsid_common_init_c =
! "$Id: init.c,v 1.21 2005/03/22 07:22:58 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
***************
*** 172,178 ****
want_config[CONFIG_ICONSCALE] = 100;
want_config[CONFIG_MAPSCALE] = 100;
want_config[CONFIG_POPUPS] = TRUE;
! want_config[CONFIG_SDL] = FALSE;
want_config[CONFIG_SHOWICON] = FALSE;
want_config[CONFIG_TOOLTIPS] = TRUE;
want_config[CONFIG_SOUND] = TRUE;
--- 172,178 ----
want_config[CONFIG_ICONSCALE] = 100;
want_config[CONFIG_MAPSCALE] = 100;
want_config[CONFIG_POPUPS] = TRUE;
! want_config[CONFIG_DISPLAYMODE] = CFG_DM_PIXMAP;
want_config[CONFIG_SHOWICON] = FALSE;
want_config[CONFIG_TOOLTIPS] = TRUE;
want_config[CONFIG_SOUND] = TRUE;
Index: client/gtk/config.c
diff -c client/gtk/config.c:1.19 client/gtk/config.c:1.20
*** client/gtk/config.c:1.19 Sun Feb 13 21:42:01 2005
--- client/gtk/config.c Mon Mar 21 23:22:58 2005
***************
*** 1,5 ****
char *rcsid_gtk_config_c =
! "$Id: config.c,v 1.19 2005/02/14 05:42:01 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
--- 1,5 ----
char *rcsid_gtk_config_c =
! "$Id: config.c,v 1.20 2005/03/22 07:22:58 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
***************
*** 188,194 ****
"Map Scale (Takes effect next run)"},
{NULL, CBUTTON, CONFIG_SMOOTH, FLAG_MAPPANE | FLAG_UPDATE,
"Enable smoothing - Use additionnal CPU (Take effect on next connection)."},
! {NULL, CBUTTON, CONFIG_SDL, FLAG_MAPPANE,
"SDL Image Support (Take effect next run)"},
{NULL, CBUTTON, CONFIG_SHOWGRID, FLAG_MAPPANE | FLAG_UPDATE,
"Print Grid Overlay (SDL only, Slow, useful for debugging/development"},
--- 188,194 ----
"Map Scale (Takes effect next run)"},
{NULL, CBUTTON, CONFIG_SMOOTH, FLAG_MAPPANE | FLAG_UPDATE,
"Enable smoothing - Use additionnal CPU (Take effect on next connection)."},
! {NULL, CBUTTON, CONFIG_DISPLAYMODE, FLAG_MAPPANE,
"SDL Image Support (Take effect next run)"},
{NULL, CBUTTON, CONFIG_SHOWGRID, FLAG_MAPPANE | FLAG_UPDATE,
"Print Grid Overlay (SDL only, Slow, useful for debugging/development"},
***************
*** 348,354 ****
use_config[CONFIG_LIGHTING] = lighting;
}
#ifdef HAVE_SDL
! if (use_config[CONFIG_SDL])
/* This is done to make the 'lightmap' in the proper format */
init_SDL( NULL, 1);
#endif
--- 348,354 ----
use_config[CONFIG_LIGHTING] = lighting;
}
#ifdef HAVE_SDL
! if (use_config[CONFIG_DISPLAYMODE]==CFG_DM_SDL)
/* This is done to make the 'lightmap' in the proper format */
init_SDL( NULL, 1);
#endif
Index: client/gtk/gx11.h
diff -c client/gtk/gx11.h:1.9 client/gtk/gx11.h:1.10
*** client/gtk/gx11.h:1.9 Sun Oct 26 03:43:55 2003
--- client/gtk/gx11.h Mon Mar 21 23:22:59 2005
***************
*** 1,6 ****
/*
* static char *rcsid_gx11_h =
! * "$Id: gx11.h,v 1.9 2003/10/26 11:43:55 ryo_saeba Exp $";
*/
/*
Crossfire client, a client program for the crossfire program.
--- 1,6 ----
/*
* static char *rcsid_gx11_h =
! * "$Id: gx11.h,v 1.10 2005/03/22 07:22:59 mwedel Exp $";
*/
/*
Crossfire client, a client program for the crossfire program.
***************
*** 56,61 ****
--- 56,62 ----
void *map_mask, *map_image;
uint16 map_width, map_height;
void *fog_image;
+ uint16 smooth_face;
} PixmapInfo;
extern PixmapInfo *pixmaps[MAXPIXMAPNUM];
Index: client/gtk/image.c
diff -c client/gtk/image.c:1.20 client/gtk/image.c:1.21
*** client/gtk/image.c:1.20 Sat May 22 08:51:50 2004
--- client/gtk/image.c Mon Mar 21 23:22:59 2005
***************
*** 1,5 ****
char *rcsid_gtk_image_c =
! "$Id: image.c,v 1.20 2004/05/22 15:51:50 tchize Exp $";
/*
Crossfire client, a client program for the crossfire program.
--- 1,5 ----
char *rcsid_gtk_image_c =
! "$Id: image.c,v 1.21 2005/03/22 07:22:59 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
***************
*** 133,139 ****
pi->map_image = NULL;
pi->map_mask = NULL;
! if (use_config[CONFIG_SDL]) {
#if defined(HAVE_SDL)
int i;
SDL_Surface *fog;
--- 133,139 ----
pi->map_image = NULL;
pi->map_mask = NULL;
! if (use_config[CONFIG_DISPLAYMODE]==CFG_DM_SDL) {
#if defined(HAVE_SDL)
int i;
SDL_Surface *fog;
***************
*** 234,240 ****
if (pi->map_mask) gdk_pixmap_unref(pi->map_mask);
if (pi->map_image) {
#ifdef HAVE_SDL
! if (use_config[CONFIG_SDL]) {
free(((SDL_Surface*)pi->map_image)->pixels);
SDL_FreeSurface(pi->map_image);
SDL_FreeSurface(pi->fog_image);
--- 234,240 ----
if (pi->map_mask) gdk_pixmap_unref(pi->map_mask);
if (pi->map_image) {
#ifdef HAVE_SDL
! if (use_config[CONFIG_DISPLAYMODE]==CFG_DM_SDL) {
free(((SDL_Surface*)pi->map_image)->pixels);
SDL_FreeSurface(pi->map_image);
SDL_FreeSurface(pi->fog_image);
***************
*** 261,267 ****
uint8 *png_tmp;
PixmapInfo *pi;
! pi = malloc(sizeof(PixmapInfo));
iscale = use_config[CONFIG_ICONSCALE];
--- 261,267 ----
uint8 *png_tmp;
PixmapInfo *pi;
! pi = calloc(1, sizeof(PixmapInfo));
iscale = use_config[CONFIG_ICONSCALE];
***************
*** 308,321 ****
pi->map_width = nx;
pi->map_height = ny;
create_map_image(png_tmp, pi);
! if (!use_config[CONFIG_SDL]) free(png_tmp);
} else {
pi->map_width = width;
pi->map_height = height;
/* if using SDL mode, a copy of the rgba data needs to be
* stored away.
*/
! if (use_config[CONFIG_SDL]) {
png_tmp = malloc(width * height * BPP);
memcpy(png_tmp, rgba_data, width * height * BPP);
} else
--- 308,321 ----
pi->map_width = nx;
pi->map_height = ny;
create_map_image(png_tmp, pi);
! if (use_config[CONFIG_DISPLAYMODE]==CFG_DM_PIXMAP) free(png_tmp);
} else {
pi->map_width = width;
pi->map_height = height;
/* if using SDL mode, a copy of the rgba data needs to be
* stored away.
*/
! if (use_config[CONFIG_DISPLAYMODE]==CFG_DM_SDL) {
png_tmp = malloc(width * height * BPP);
memcpy(png_tmp, rgba_data, width * height * BPP);
} else
***************
*** 338,343 ****
--- 338,348 ----
return 0;
}
+ void addsmooth(uint16 face, uint16 smooth_face)
+ {
+ pixmaps[face]->smooth_face = smooth_face;
+ }
+
/* This functions associates the image_data in the cache entry
* with the specific pixmap number. Returns 0 on success, -1
* on failure. Currently, there is no failure condition, but
Index: client/gtk/map.c
diff -c client/gtk/map.c:1.24 client/gtk/map.c:1.25
*** client/gtk/map.c:1.24 Sun May 9 00:56:54 2004
--- client/gtk/map.c Mon Mar 21 23:22:59 2005
***************
*** 1,5 ****
char *rcsid_gtk_map_c =
! "$Id: map.c,v 1.24 2004/05/09 07:56:54 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
--- 1,5 ----
char *rcsid_gtk_map_c =
! "$Id: map.c,v 1.25 2005/03/22 07:22:59 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
***************
*** 202,208 ****
* let the neighbors know they should update their darkness
* now.
*/
! if (use_config[CONFIG_SDL] &&
(use_config[CONFIG_LIGHTING] == CFG_LT_PIXEL ||
use_config[CONFIG_LIGHTING] == CFG_LT_PIXEL_BEST)) {
if (x-1>0) the_map.cells[x-1][y].need_update = 1;
--- 202,208 ----
* let the neighbors know they should update their darkness
* now.
*/
! if (use_config[CONFIG_DISPLAYMODE]==CFG_DM_SDL &&
(use_config[CONFIG_LIGHTING] == CFG_LT_PIXEL ||
use_config[CONFIG_LIGHTING] == CFG_LT_PIXEL_BEST)) {
if (x-1>0) the_map.cells[x-1][y].need_update = 1;
***************
*** 369,375 ****
} /* for x */
#ifdef HAVE_SDL
! if (use_config[CONFIG_SDL])
sdl_mapscroll(dx,dy);
else
#endif
--- 369,375 ----
} /* for x */
#ifdef HAVE_SDL
! if (use_config[CONFIG_DISPLAYMODE]==CFG_DM_SDL)
sdl_mapscroll(dx,dy);
else
#endif
***************
*** 447,453 ****
sfaces[i]=0; /*black picture*/
}else{
slevels[i]=the_map.cells[emx][emy].smooth[layer];
! sfaces[i]=getsmooth(the_map.cells[emx][emy].heads[layer].face);
dosmooth=1;
}
}
--- 447,453 ----
sfaces[i]=0; /*black picture*/
}else{
slevels[i]=the_map.cells[emx][emy].smooth[layer];
! sfaces[i]=pixmaps[the_map.cells[emx][emy].heads[layer].face]->smooth_face;
dosmooth=1;
}
}
Index: client/gtk/sdl.c
diff -c client/gtk/sdl.c:1.15 client/gtk/sdl.c:1.16
*** client/gtk/sdl.c:1.15 Sat Feb 26 22:06:30 2005
--- client/gtk/sdl.c Mon Mar 21 23:22:59 2005
***************
*** 1,5 ****
char *rcsid_gtk_sdl_c =
! "$Id: sdl.c,v 1.15 2005/02/27 06:06:30 mwedel Exp $";
/*
CrossFire, A Multiplayer game for X-windows
--- 1,5 ----
char *rcsid_gtk_sdl_c =
! "$Id: sdl.c,v 1.16 2005/03/22 07:22:59 mwedel Exp $";
/*
CrossFire, A Multiplayer game for X-windows
***************
*** 651,657 ****
sfaces[i]=0; /*black picture*/
}else{
slevels[i]=the_map.cells[emx][emy].smooth[layer];
! sfaces[i]=getsmooth(the_map.cells[emx][emy].heads[layer].face);
dosmooth=1;
}
}
--- 651,657 ----
sfaces[i]=0; /*black picture*/
}else{
slevels[i]=the_map.cells[emx][emy].smooth[layer];
! sfaces[i]=pixmaps[the_map.cells[emx][emy].heads[layer].face]->smooth_face;
dosmooth=1;
}
}
Index: client/gtk-v2/src/Makefile.am
diff -c client/gtk-v2/src/Makefile.am:1.2 client/gtk-v2/src/Makefile.am:1.3
*** client/gtk-v2/src/Makefile.am:1.2 Mon Mar 7 23:18:09 2005
--- client/gtk-v2/src/Makefile.am Mon Mar 21 23:22:59 2005
***************
*** 19,24 ****
--- 19,25 ----
map.c \
magicmap.c \
menubar.c \
+ opengl.c \
png.c \
sdl.c \
sound.c \
***************
*** 30,36 ****
interface.c interface.h
! gcfclient2_LDADD = @PACKAGE_LIBS@ @DMALLOC_LIB@ $(INTLLIBS) ../../common/libcfclient.a @SDL_LIBS@
proto:
--- 31,37 ----
interface.c interface.h
! gcfclient2_LDADD = @PACKAGE_LIBS@ @DMALLOC_LIB@ $(INTLLIBS) ../../common/libcfclient.a @SDL_LIBS@ @OPENGL_LIBS@
proto:
Index: client/gtk-v2/src/config.c
diff -c client/gtk-v2/src/config.c:1.1 client/gtk-v2/src/config.c:1.2
*** client/gtk-v2/src/config.c:1.1 Tue Mar 1 23:52:04 2005
--- client/gtk-v2/src/config.c Mon Mar 21 23:23:00 2005
***************
*** 1,5 ****
char *rcsid_gtk2_config_c =
! "$Id: config.c,v 1.1 2005/03/02 07:52:04 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
--- 1,5 ----
char *rcsid_gtk2_config_c =
! "$Id: config.c,v 1.2 2005/03/22 07:23:00 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
***************
*** 38,43 ****
--- 38,44 ----
#include "support.h"
#include "main.h"
+ #include "image.h"
#include "gtk2proto.h"
void load_defaults()
Index: client/x11/xutil.c
diff -c client/x11/xutil.c:1.17 client/x11/xutil.c:1.18
*** client/x11/xutil.c:1.17 Wed Feb 9 23:03:56 2005
--- client/x11/xutil.c Mon Mar 21 23:23:00 2005
***************
*** 1,5 ****
char *rcsid_x11_xutil_c =
! "$Id: xutil.c,v 1.17 2005/02/10 07:03:56 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
--- 1,5 ----
char *rcsid_x11_xutil_c =
! "$Id: xutil.c,v 1.18 2005/03/22 07:23:00 mwedel Exp $";
/*
Crossfire client, a client program for the crossfire program.
***************
*** 1334,1340 ****
* let the neighbors know they should update their darkness
* now.
*/
! if (use_config[CONFIG_SDL]) {
if (x-1>0) the_map.cells[x-1][y].need_update = 1;
if (y-1>0) the_map.cells[x][y-1].need_update = 1;
if (x+1<use_config[CONFIG_MAPWIDTH]) the_map.cells[x+1][y].need_update = 1;
--- 1334,1340 ----
* let the neighbors know they should update their darkness
* now.
*/
! if (use_config[CONFIG_DISPLAYMODE]==CFG_DM_SDL) {
if (x-1>0) the_map.cells[x-1][y].need_update = 1;
if (y-1>0) the_map.cells[x][y-1].need_update = 1;
if (x+1<use_config[CONFIG_MAPWIDTH]) the_map.cells[x+1][y].need_update = 1;
***************
*** 1521,1523 ****
--- 1521,1529 ----
}
}
}
+
+
+ /* x11 client doesn't do smoothing, so don't need to do anything with this */
+ void addsmooth(uint16 face, uint smooth_face)
+ {
+ }
|