Gui

From WinBolo

(Difference between revisions)
Jump to: navigation, search
(Dialogs)
Line 13: Line 13:
Lastly it contains the code that starts and controls the server if a player starts a new networked game. (''gameFrontSetupServer();'')
Lastly it contains the code that starts and controls the server if a player starts a new networked game. (''gameFrontSetupServer();'')
-
=== Dialogs ===
+
=== dialog<name>.c ===
Dialog files all start with dialog<filename>.c The follow a similar pattern. For example on the Winbolonet Setup dialog:
Dialog files all start with dialog<filename>.c The follow a similar pattern. For example on the Winbolonet Setup dialog:
Line 28: Line 28:
Handles the OK action... etc
Handles the OK action... etc
-
 
== Other files ==
== Other files ==

Revision as of 18:14, 29 November 2008

The GUI directory contains platform front end specific code for running the game. There are win32 and linux subdirectories.

Contents

Windows

winbolo.c

gamefront.c

Gamefront provides the front end to the game. This includes initialising each component , drawing, sound, fonts, loading preferences etc. (gameFrontStart();)shutting everything down at the end (gameFrontEnd();)and handling the main windows loop (gameFrontRun();)

It contains a state machine of dialogs that the user goes through to start or join a game. (gameFrontSetDlgState();) If any of the starting dialogs need data it calls a gameFront function. (e.g. gameFrontGetTrackerOptions())

Lastly it contains the code that starts and controls the server if a player starts a new networked game. (gameFrontSetupServer();)

dialog<name>.c

Dialog files all start with dialog<filename>.c The follow a similar pattern. For example on the Winbolonet Setup dialog:

dialogWinbolonetSetup();

Sets up the dialog and initialises each of the labels using the lang.c file.

dialogWinbolonetCallback

The standard Windows call back function that calls other methods in the module to do the work.

dialogWinbolonetOK();

Handles the OK action... etc

Other files

  • draw.c contains all the functions related to drawing on the screen. Uses DirectX
  • sound.c contains all the functions in playing sound files.
  • font.c - fonts
  • cursor.c - mouse cursor
  • input.c - Keyboard reading.

Linux

The Linux code is no where near as readable and commented as the windows code. The port process occurred very quickly. Took about two weeks to complete. It was last changed for version 1.13. skin support the Log Viewer are not available.

gamefront.c and winbolo.c where merged into a giant 150K+ main.c file which is largely uncommented. The function names are mostly the same as winbolo.c

Most of the other code is laid out the same.

Glade was used to generate most of the dialog code.

Personal tools