Difference for common/init.c from version 1.4 to 1.5


version 1.4 version 1.5
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_init_c =   * static char *rcsid_init_c =
  *   "$Id: init.c,v 1.4 2002/03/26 08:15:57 mwedel Exp $";   *   "$Id: init.c,v 1.5 2002/04/03 07:46:52 mwedel Exp $";
  */   */
 /*  /*
     Crossfire client, a client program for the crossfire program.      Crossfire client, a client program for the crossfire program.
Line 30
 
Line 30
   
 #include <client.h>  #include <client.h>
   
   /* Makes the load/save code trivial - basically, the
    * entries here match the same numbers as the CONFIG_ values defined
    * in common/client.h - this means the load and save just does
    * something like a fprintf(outifle, "%s: %d", config_names[i],
    *     want_config[i]);
    */
   char *config_names[CONFIG_NUMS] = {
   NULL, "colorinv", "colortext", "download_all_images", "echo_bindings",
   "fasttcpsend", "command_window", "cacheimages", "fog_of_war", "iconscale",
   "mapscale", "popups", "sdl", "showicon", "tooltips", "sound", "splitinfo",
   "split", "show_grid", "per_pixel_lighting", "per_tile_lighting",
   "map_width", "map_height", "foodbeep", "darkness", "port",
   "trim_info_window"};
   
   sint16 want_config[CONFIG_NUMS], use_config[CONFIG_NUMS];
   
 #define TEST_FREE_AND_CLEAR(xyz) {if (xyz) { free(xyz); xyz=NULL; } }  #define TEST_FREE_AND_CLEAR(xyz) {if (xyz) { free(xyz); xyz=NULL; } }
   
 void VersionCmd(char *data, int len)  void VersionCmd(char *data, int len)
Line 79
 
Line 95
 {  {
     int i;      int i;
   
   
     /* I think environemental variables should be more important than      /* I think environemental variables should be more important than
      * compiled in defaults, so these probably should be reversed.        * compiled in defaults, so these probably should be reversed.
      */       */
Line 112
 
Line 127
     cpl.below = map_item();      cpl.below = map_item();
     cpl.magicmap=NULL;      cpl.magicmap=NULL;
     cpl.showmagic=0;      cpl.showmagic=0;
     cpl.command_window = COMMAND_WINDOW;     
   
     csocket.command_sent=0;      csocket.command_sent=0;
     csocket.command_received=0;      csocket.command_received=0;
     csocket.command_time=0;      csocket.command_time=0;
   
     face_info.faceset = 0;      face_info.faceset = 0;
     face_info.cache_images = FALSE;  
     face_info.num_images = 0;      face_info.num_images = 0;
     face_info.bmaps_checksum = 0;      face_info.bmaps_checksum = 0;
     face_info.old_bmaps_checksum = 0;      face_info.old_bmaps_checksum = 0;
     face_info.want_faceset = NULL;      face_info.want_faceset = NULL;
     face_info.download_all_faces = 0;  
     face_info.cache_hits=0;      face_info.cache_hits=0;
     face_info.cache_misses=0;      face_info.cache_misses=0;
       face_info.have_faceset_info=0;
     for (i=0; i<MAX_FACE_SETS; i++) {      for (i=0; i<MAX_FACE_SETS; i++) {
  face_info.facesets[i].prefix = NULL;   face_info.facesets[i].prefix = NULL;
  face_info.facesets[i].fullname = NULL;   face_info.facesets[i].fullname = NULL;
Line 135
 
Line 149
  face_info.facesets[i].extension = NULL;   face_info.facesets[i].extension = NULL;
  face_info.facesets[i].comment = NULL;   face_info.facesets[i].comment = NULL;
     }      }
       /* Makes just as much sense to initialize the arrays
        * where they are declared, but I did this so I could
        * keep track of everything as I was updating
        * the code.  Plus, the performance difference is virtually
        * nothing.
        */
       want_config[CONFIG_COLORINV] = TRUE;
       want_config[CONFIG_COLORTXT] = TRUE;
       want_config[CONFIG_DOWNLOAD] = FALSE;
       want_config[CONFIG_ECHO] = FALSE;
       want_config[CONFIG_FASTTCP] = TRUE;
       want_config[CONFIG_CWINDOW] = COMMAND_WINDOW;
       want_config[CONFIG_CACHE] = FALSE;
       want_config[CONFIG_FOGWAR] = TRUE;
       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;
       want_config[CONFIG_SPLITINFO] = FALSE;
       want_config[CONFIG_SPLITWIN] = FALSE;
       want_config[CONFIG_SHOWGRID] = FALSE;
       want_config[CONFIG_LT_PIXEL] = FALSE;
       want_config[CONFIG_LT_TILE] = TRUE;
       want_config[CONFIG_MAPWIDTH] = 11;
       want_config[CONFIG_MAPHEIGHT] = 11;
       want_config[CONFIG_FOODBEEP] = FALSE;
       want_config[CONFIG_DARKNESS] = TRUE;
       want_config[CONFIG_PORT] = EPORT;
       want_config[CONFIG_TRIMINFO] = FALSE;
       for (i=0; i<CONFIG_NUMS; i++)
    use_config[i] = want_config[i];
   
 }  }
   
Line 147
 
Line 195
 {  {
     int i;      int i;
   
   
     cpl.count_left = 0;      cpl.count_left = 0;
     cpl.container = NULL;      cpl.container = NULL;
     memset(&cpl.stats,0, sizeof(Stats));      memset(&cpl.stats,0, sizeof(Stats));
Line 184
 
Line 231
     face_info.bmaps_checksum = 0;      face_info.bmaps_checksum = 0;
     face_info.cache_hits=0;      face_info.cache_hits=0;
     face_info.cache_misses=0;      face_info.cache_misses=0;
       face_info.have_faceset_info=0;
     for (i=0; i<MAX_FACE_SETS; i++) {      for (i=0; i<MAX_FACE_SETS; i++) {
  TEST_FREE_AND_CLEAR(face_info.facesets[i].prefix);   TEST_FREE_AND_CLEAR(face_info.facesets[i].prefix);
  TEST_FREE_AND_CLEAR(face_info.facesets[i].fullname);   TEST_FREE_AND_CLEAR(face_info.facesets[i].fullname);


Legend:
line(s) removed in v.1.4 
line(s) changed
 line(s) added in v.1.5

File made using version 1.96 of cvs2html by leaf at 2006-02-16 20:46