~ubuntu-branches/debian/sid/freeciv/sid

« back to all changes in this revision

Viewing changes to doc/HACKING

  • Committer: Package Import Robot
  • Author(s): Clint Adams, Karl Goetz, Clint Adams
  • Date: 2011-08-28 22:40:00 UTC
  • mfrom: (1.2.19 upstream)
  • Revision ID: package-import@ubuntu.com-20110828224000-j2r1erewlem25dox
Tags: 2.3.0-1
[ Karl Goetz ]
* New upstream version.
* Fix themes_sdl_use_system_fonts.diff to apply cleanly on 2.3.0
* Massage work_around_unity_induced_breakage.diff to get it
  applying to the new codebase (The patch assumes commits made
  after 2.3.0 was tagged upstream).

[ Clint Adams ]
* Fudge build system to think there is no libtool mismatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
# set timeout 3         # run a client/server autogame
71
71
set timeout -1          # run a server only autogame
72
72
set minplayers 0        # no human player needed
 
73
set ec_turns 0          # avoid timestamps in savegames
73
74
set aifill 7            # fill to 7 players
74
75
hard                    # make the AI do complex things
75
76
create Caesar           # first player (with known name) created and 
593
594
Unknown tiles and Fog of War
594
595
=========================================================================
595
596
 
596
 
In common/tile.h, there are several fields:
597
 
 
598
 
struct tile {
599
 
  ...
600
 
  bv_player tile_known, tile_seen[V_COUNT];
601
 
  ...
 
597
In common/player.h, there are several fields:
 
598
 
 
599
struct player {
 
600
  ...
 
601
  struct dbv tile_known;
 
602
 
 
603
  union {
 
604
    struct {
 
605
      ...
 
606
    } server;
 
607
 
 
608
    struct {
 
609
      struct dbv tile_vision[V_COUNT];
 
610
    } client;
 
611
  };
602
612
};
603
613
 
604
614
While tile_get_known() returns:
1064
1074
under our control, and all output to the command line must be converted.
1065
1075
 
1066
1076
===========================================================================
 
1077
Debugging and Profiling
 
1078
===========================================================================
 
1079
 
 
1080
Debugging has to be activated on compile time by adding the option
 
1081
'--enable-debug=no/some/yes/checks' to the configure script. The different
 
1082
options have the following meaning:
 
1083
 
 
1084
  no:     no debugging enabled(NDEBUG is defined)
 
1085
          additional compiler flags for optimisation (-O3 -fomit-frame-pointer)
 
1086
  some:   default build (neither NDEBUG nor DEBUG is defined)
 
1087
  yes:    debugging enable (DEBUG is defined)
 
1088
          debugging log level available (4, log_debug())
 
1089
          additional compiler flag: -Werror
 
1090
  checks: same as 'yes' but with more compiler checks (-Wall -Wpointer-arith
 
1091
          -Wcast-align -Wmissing-prototypes -Wmissing-declarations
 
1092
          -Wstrict-prototypes -Wnested-externs)
 
1093
 
 
1094
REMARK: The debug option '--enable-debug=checks' adds additionally compiler
 
1095
        options. This is OK for the server and most clients but in the case
 
1096
        of the gtk client there is a problems in its main external library
 
1097
        (gtk2) which prevent the compilation of the client using the
 
1098
        extended flags. A fix is available but will not be applied due to
 
1099
        compatibility issues. To compile freeciv with this option,
 
1100
        temporary patch the file gtkitemfactory.h
 
1101
        (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=148766).
 
1102
 
 
1103
Profiling is enabled by '--enable-gprof'. After the compilation run freeciv
 
1104
normally. It will be 5 to 10 times slower due to the added calls to the
 
1105
profiling functions. After freeciv quits normally (not after a crash) the
 
1106
file gmon.out is written. It can be analyzed by calling
 
1107
'gprof ./server/freeciv-server gmon.out > gprof.txt'. More information can
 
1108
be found at http://sourceware.org/binutils/docs/gprof/index.html.
 
1109
 
 
1110
===========================================================================