File: source.xml

package info (click to toggle)
liquidwar 5.4.5-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,020 kB
  • ctags: 1,508
  • sloc: ansic: 13,836; sh: 2,488; xml: 2,270; asm: 1,349; makefile: 749; python: 443
file content (536 lines) | stat: -rw-r--r-- 15,056 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
<?xml version="1.0"?>
<FILE TITLE="Source code">

  <CHAP TITLE="General remarks">
    <TEXT>
      Liquid War 5 is basically a big C program, and this section
      explains what you can find in source files. I've splitted
      the source code in many small files for I do not like to
      have to handle big monolithic sources, but this does not
      mean Liquid War is very modular. In fact Liquid War 5
      is quite bloated with global variables and other ugly
      stuff 8-(
    </TEXT>
  </CHAP>

  <CHAP TITLE="List of C source files">
    <PART TITLE="advanced.c / advanced.h">
      <TEXT>
	Contains the GUI advanced options menu. 
      </TEXT>
    </PART>
    <PART TITLE="alleg2.c / alleg2.h">
      <TEXT>
	Contains some tweaked allegro functions. I wanted to use
	bitmaps with sevral colors for my fonts, and change some
	of the allegro default behavior. So rather than modifying
	the allegro source code right in the library I copied
	it in this file and then modified it.
      </TEXT>
    </PART>
    <PART TITLE="area.c / area.h">
      <TEXT>
	Contains functions to create the game area.
	Basically it contains functions to create
	the data structures in which the level is
	stored during the game.
      </TEXT>
    </PART>
    <PART TITLE="army.c / army.h">
      <TEXT>
	Functions to create the armies, and place them on the
	battlefield.
      </TEXT>
    </PART>
    <PART TITLE="autoplay.c / autoplay.h">
      <TEXT>
	Contains the code for the computer AI.
	This module simulates keypresses from the computer,
	then the computer is handled as any other player.
      </TEXT>
    </PART>
    <PART TITLE="back.c / back.h">
      <TEXT>
	This modules displays the background image.
      </TEXT>
    </PART>
    <PART TITLE="base.h">
      <TEXT>
	Contains global constants used in many different files.
      </TEXT>
    </PART>
    <PART TITLE="basicopt.c / basicopt.h">
      <TEXT>
	Handles basic command line parameters such as "-v" or "-h".
      </TEXT>
    </PART>
    <PART TITLE="bigdata.c / bigdata.h">
      <TEXT>
	I had a really hard time with the malloc function with DJGPP
	under Win95 dos box. I tried to have it working for hours and
	hours but my program kept being buggy. So I decided to allocate
	the memory myself, in a memory zone I create at startup.
	This is what this module does: create a huge memory zone
	and then give parts of it to the rest of the program.
      </TEXT>
    </PART>
    <PART TITLE="code.c / code.h">
      <TEXT>
	This file contains the code to handle key presses during
	the game. That's to say the pause key for instance.
      </TEXT>
    </PART>
    <PART TITLE="config.c / config.h">
      <TEXT>
	Contains everything that is related to the game configuration.
	This module contains in global variables all the parameters
	that are stored in the config file.
      </TEXT>
    </PART>
    <PART TITLE="cursor.c / cursor.h">
      <TEXT>
	Contains the code to init the cursors and place them
	on the battlefield at the beginning of the game.
      </TEXT>
    </PART>
    <PART TITLE="decal.c / decal.h">
      <TEXT>
	This module makes the link between teams and players.
	Its coding is quite ugly, for some modules in LW assume
	that when 2 teams are playing they are always teams 0 and 1.
	So when 3 teams are playing are playing and the second team loses,
	one has to make team 2 become team 1.
	That's what this module is for.
      </TEXT>
    </PART>
    <PART TITLE="dialog.c / dialog.h">
      <TEXT>
	Contains code for standard dialog boxes.
      </TEXT>
    </PART>
    <PART TITLE="disk.c / disk.h">
      <TEXT>
	Contains all the code to access data from the hard drive.
	In fact, all the HD access is done at startup.
      </TEXT>
    </PART>
    <PART TITLE="disp.c / disp.h">
      <TEXT>
	Contains functions to display the battlefield.
      </TEXT>
    </PART>
    <PART TITLE="distor.c / distor.h">
      <TEXT>
	This module contains code to create the "wave effect".
	It uses a lot of data tables, and is quite complicated
	to understand...
      </TEXT>
    </PART>
    <PART TITLE="error.c / error.h">
      <TEXT>
	Contains functions to display error messages once the game
	is in graphical mode.
      </TEXT>
    </PART>
    <PART TITLE="exit.c / exit.h">
      <TEXT>
	Contains code that is executed when the game ends,
	it shuts down Allegro and displays messages on the console.
      </TEXT>
    </PART>
    <PART TITLE="fighter.c / fighter.h">
      <TEXT>
	Contains code to move the armies, once the gradient has been calculated.
      </TEXT>
    </PART>
    <PART TITLE="game.c / game.h">
      <TEXT>
	Contains the main game loop.
      </TEXT>
    </PART>
    <PART TITLE="gfxmode.c / gfxmode.h">
      <TEXT>
	Contains code to set up the various video modes,
	and defines which modes are available for each platform.
      </TEXT>
    </PART>
    <PART TITLE="glouglou.s / glouglou.h">
      <TEXT>
	Assembly module, it is a replacement for some functions of distor.c.
	It goes much faster but does the same.
      </TEXT>
    </PART>
    <PART TITLE="grad.c / grad.h">
      <TEXT>
	This module calculates the gradient for each team.
	One could say it's the "kernel" of the game,
	since most of the CPU time is spent in this module
	(except if you have a slow display...).
      </TEXT>
    </PART>
    <PART TITLE="graphics.c / graphics.h">
      <TEXT>
	Code for the graphic options menu.
      </TEXT>
    </PART>
    <PART TITLE="help.c / help.h">
      <TEXT>
	Generic functions to display the various help pages.
      </TEXT>
    </PART>
    <PART TITLE="httputil.c / httputil.h">
      <TEXT>
	Low level functions to handle http requests to "http://www.ufoot.org".
      </TEXT>
    </PART>
    <PART TITLE="info.c / info.h">
      <TEXT>
	Contains code to display the info bar.
	The info bar is the bar which display the time left and the amount of players
	for each team while the game is running.
      </TEXT>
    </PART>
    <PART TITLE="init.c / init.h">
      <TEXT>
	Contains code to initialize Allegro with proper options and analyze failures.
      </TEXT>
    </PART>
    <PART TITLE="joystick.c / joystick.h">
      <TEXT>
	Contains code to support joystick input. It wraps joystick buttons
	to virtual keyboard keys, so that joystick and keyboard behave
	exactly the same.
      </TEXT>
    </PART>
    <PART TITLE="keyboard.c / keyboard.h">
      <TEXT>
	Contains code to handle key presses.
      </TEXT>
    </PART>
    <PART TITLE="keyexch.c / keyexch.h">
      <TEXT>
	Functions to send and receive keys to the server. Used on the
	client.
      </TEXT>
    </PART>
    <PART TITLE="level.c / level.h">
      <TEXT>
	Contains code for the menu where the player
	can select a level and its options (texture or color).
      </TEXT>
    </PART>
    <PART TITLE="log.h">
      <TEXT>
      	Common header for logcli.c and logsrv.c.
      </TEXT>
    </PART>
    <PART TITLE="logcli.c">
      <TEXT>
	Contains code to display messages on the console.
	It's usefull for console may have different behaviors
	when the games is used on different platforms.
	This file is used to compile the client.
      </TEXT>
    </PART>
    <PART TITLE="logsrv.c">
      <TEXT>
	Contains code to display messages on the console.
	This file is used to compile the server, which does not
	use Allegro at all.
      </TEXT>
    </PART>
    <PART TITLE="main.c / main.h">
      <TEXT>
	The file where the main C function is declared.
	Doesn't contain much except calling init functions and
	running the GUI.
      </TEXT>
    </PART>
    <PART TITLE="map.c / map.h">
      <TEXT>
	Contains code to load the maps from a datafile raw data
	or a user defined bitmap
	to a usable structure in RAM.
      </TEXT>
    </PART>
    <PART TITLE="menu.c / menu.h">
      <TEXT>
	Contains the code for the main menu.
      </TEXT>
    </PART>
    <PART TITLE="mesh.c / mesh.h">
      <TEXT>
	Contains code to set up a usable mesh with a map.
	Mesh are re-calculated at each time a new game is started,
	the reason for this being that meshes are *very* big so
	it would not be reasonnable to save them directly on the HD.
      </TEXT>
    </PART>
    <PART TITLE="message.c / message.h">
      <TEXT>
	Provides an API to display messages during the game.
	Very useful if you want to debug the game: you can trace
	and display anything.
      </TEXT>
    </PART>
    <PART TITLE="monster.s / monster.h">
      <TEXT>
	Assembly functions to speed-up the game.
	It's a replacement for some fighter.c functions.
      </TEXT>
    </PART>
    <PART TITLE="mouse.c / mouse.h">
      <TEXT>
	Wraps the mouse movements to virtual keyboard keys.
	This way the mouse can be used to control the players.
      </TEXT>
    </PART>
    <PART TITLE="move.c / move.h">
      <TEXT>
	Provides an API to move the cursors.
      </TEXT>
    </PART>
    <PART TITLE="netconf.c / netconf.h">
      <TEXT>
	Code to send and receive the config of the clients over the network.
      </TEXT>
    </PART>
    <PART TITLE="netgame.c / netgame.h">
      <TEXT>
	Contains the code for the net game menu.
      </TEXT>
    </PART>
    <PART TITLE="netkey.c / netkey.h">
      <TEXT>
	Contains some tools to manipulate key strokes over the network.
      </TEXT>
    </PART>
    <PART TITLE="netmap.c / netmap.h">
      <TEXT>
	Code to send and receive the maps over the network.
      </TEXT>
    </PART>
    <PART TITLE="netmess.c / netmess.h">
      <TEXT>
	Contains a parser to interpret plain text messages. Used when
	exhanging information over the network.
      </TEXT>
    </PART>
    <PART TITLE="network.c / network.h">
      <TEXT>
	Contains some network related functions and constants used on
	the client.
      </TEXT>
    </PART>
    <PART TITLE="options.c / options.h">
      <TEXT>
	Contains the code for the options menu.
      </TEXT>
    </PART>
    <PART TITLE="palette.c / palette.h">
      <TEXT>
	Contains function to set up the current color palette.
	Liquid War uses different palettes, depending on what
	colors are chosen for teams.
      </TEXT>
    </PART>
    <PART TITLE="parser.c / parser.h">
      <TEXT>
	Contains code to parse and analyze the command line parameters.
      </TEXT>
    </PART>
    <PART TITLE="pion.c / pion.h">
      <TEXT>
	Contains code to display the cursors.
      </TEXT>
    </PART>
    <PART TITLE="play.c / play.h">
      <TEXT>
	Contains the code which ties the menu to the main gameloop.
      </TEXT>
    </PART>
    <PART TITLE="profile.c / profile.h">
      <TEXT>
	Provides tools to calculate how fast the game is runnning
	and what operations slow it down.
      </TEXT>
    </PART>
    <PART TITLE="protocol.c / protocol.h">
      <TEXT>
	Contains the sequence of messages send and recevied by the
	client when connecting on the server.
      </TEXT>
    </PART>
    <PART TITLE="rules.c / rules.h">
      <TEXT>
	Code for the rules menu.
      </TEXT>
    </PART>
    <PART TITLE="score.c / score.h">
      <TEXT>
	Functions to display the scores at the end of the game.
      </TEXT>
    </PART>
    <PART TITLE="server.c / server.h">
      <TEXT>
	Main code for the server (equivalent of main.c for the client).
      </TEXT>
    </PART>
    <PART TITLE="sock2cli.c">
      <TEXT>
	Code used to wrap low-level network function on the client.
      </TEXT>
    </PART>
    <PART TITLE="sock2gen.h">
      <TEXT>
	Header for sock2cli.c and sock2srv.c.
      </TEXT>
    </PART>
    <PART TITLE="sock2srv.c">
      <TEXT>
	Code used to wrap low-level network function on the server.
      </TEXT>
    </PART>
    <PART TITLE="sockdos.c">
      <TEXT>
	Network API for DOS.
      </TEXT>
    </PART>
    <PART TITLE="sockex.c">
      <TEXT>
	Netowrk routines shared by sockunix and sockw32.
      </TEXT>
    </PART>
    <PART TITLE="sockgen.h">
      <TEXT>
	header for sockdos.c, sockunix.c and sockw32.c.
      </TEXT>
    </PART>
    <PART TITLE="sockunix.c">
      <TEXT>
	Network API for UNIX.
      </TEXT>
    </PART>
    <PART TITLE="sockw32.c">
      <TEXT>
	Network API for Win32.
      </TEXT>
    </PART>
    <PART TITLE="sound.c / sound.h">
      <TEXT>
	Functions to play sound.
      </TEXT>
    </PART>
    <PART TITLE="speeds.c / speeds.h">
      <TEXT>
	Contains the code for the speeds menu.
      </TEXT>
    </PART>
    <PART TITLE="spread.s / spread.h">
      <TEXT>
	Contains assembly replacements for some functions of grad.c.
	These replacements do the same than the original ones from grad.c,
	but faster. Could still be optimized.
      </TEXT>
    </PART>
    <PART TITLE="srvchan.c / srvchan.h">
      <TEXT>
	Code used to handles channels on the server. A channel is associated
	to a given computer and may manage several teams.
      </TEXT>
    </PART>
    <PART TITLE="srvcont.c / srvcont.h">
      <TEXT>
	Global network controler used on the server.
      </TEXT>
    </PART>
    <PART TITLE="srvteam.c / srvteam.h">
      <TEXT>
	Code used to handle teams on the server.
      </TEXT>
    </PART>
    <PART TITLE="srvtime.c / srvtime.h">
      <TEXT>
	Code used to handle time on the server, where Allegro's functions
	are not available.
      </TEXT>
    </PART>
    <PART TITLE="startup.c / startup.h">
      <TEXT>
	Analyzes the command line parameters and stores them
	into global variables.
      </TEXT>
    </PART>
    <PART TITLE="team.c / team.h">
      <TEXT>
	Code for the team menu.
      </TEXT>
    </PART>
    <PART TITLE="texture.c / texture.h">
      <TEXT>
	Contains code to handle textures.
	Textures are stored in a special format which uses
	5 bits per pixel.
      </TEXT>
    </PART>
    <PART TITLE="thrdgen.h">
      <TEXT>
	Header fo,r thrdunix.c and thrdw32.c.
      </TEXT>
    </PART>
    <PART TITLE="thrdunix.c">
      <TEXT>
	Provides thread support on UNIX.
      </TEXT>
    </PART>
    <PART TITLE="thrdw32.c">
      <TEXT>
	Provides thread support on Win32.
      </TEXT>
    </PART>
    <PART TITLE="ticker.c / ticker.h">
      <TEXT>
	Sets up a timer callback.
      </TEXT>
    </PART>
    <PART TITLE="time.c / time.h">
      <TEXT>
	Functions to know how long the game has been running,
	knowing that it can be interrupted.
      </TEXT>
    </PART>
    <PART TITLE="volume.c / volume.h">
      <TEXT>
	Code for the sound menu.
      </TEXT>
    </PART>
    <PART TITLE="disk.c / disk.h">
      <TEXT>
	Contains all the code to access data from the hard drive.
	In fact, all the HD access is done at startup.
      </TEXT>
    </PART>
    <PART TITLE="watchdog.c / watchdog.h">
      <TEXT>
	This module waits for "secret codes" to be typed while
	the game is running, and traps them.
      </TEXT>
    </PART>
    <PART TITLE="wave.c / wave.h">
      <TEXT>
	Code for the wave menu.
      </TEXT>
    </PART>
    <PART TITLE="wwwcli.c / wwwcli.h">
      <TEXT>
	Code used on the client to communicate with "http://www.ufoot.org".
      </TEXT>
    </PART>
    <PART TITLE="wwwsrv.c / wwwsrv.h">
      <TEXT>
	Code used on the server to communicate with "http://www.ufoot.org".
      </TEXT>
    </PART>
  </CHAP>

</FILE>