[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/include interface.h iocompat.h io...
From: |
address@hidden |
Subject: |
[Stratagus-CVS] stratagus/src/include interface.h iocompat.h io... |
Date: |
22 Dec 2003 15:09:47 +1100 |
CVSROOT: /home/strat
Module name: stratagus
Changes by: <address@hidden> 03/12/22 15:09:46
Modified files:
src/include : interface.h iocompat.h iolib.h libcda.h map.h
Log message:
Tabs cleanup
Patches:
Index: stratagus/src/include/interface.h
diff -u stratagus/src/include/interface.h:1.86
stratagus/src/include/interface.h:1.87
--- stratagus/src/include/interface.h:1.86 Sat Dec 20 16:33:26 2003
+++ stratagus/src/include/interface.h Mon Dec 22 15:09:46 2003
@@ -4,13 +4,13 @@
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
// /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
// \/ \/ \//_____/ \/
-// ______________________ ______________________
-// T H E W A R B E G I N S
-// Stratagus - A free fantasy real time strategy game engine
+// ______________________ ______________________
+// T H E W A R B E G I N S
+// Stratagus - A free fantasy real time strategy game engine
//
-/address@hidden interface.h - The user interface header file. */
+/address@hidden interface.h - The user interface header file. */
//
-// (c) Copyright 1998-2003 by Lutz Sammer
+// (c) Copyright 1998-2004 by Lutz Sammer
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: interface.h,v 1.86 2003/12/20 05:33:26 jsalmon3 Exp $
+// $Id: interface.h,v 1.87 2003/12/22 04:09:46 wizzard Exp $
#ifndef __INTERFACE_H__
#define __INTERFACE_H__
@@ -34,7 +34,7 @@
//@{
/*----------------------------------------------------------------------------
--- Includes
+-- Includes
----------------------------------------------------------------------------*/
#include "player.h"
@@ -42,31 +42,31 @@
#include "icons.h"
/*----------------------------------------------------------------------------
--- Definitons
+-- Definitons
----------------------------------------------------------------------------*/
/// Button Commands that need target selection
enum _button_cmd_ {
- ButtonMove, /// order move
- ButtonAttack, /// order attack
- ButtonRepair, /// order repair
- ButtonHarvest, /// order harvest
- ButtonBuild, /// order build
- ButtonPatrol, /// order patrol
- ButtonAttackGround, /// order attack ground
- ButtonSpellCast, ///
order cast spell
- ButtonUnload, /// order
unload unit
- ButtonStop,
/// order stop
- ButtonButton, /// choose
other button set
- ButtonTrain, /// order train
- ButtonStandGround, ///
order stand ground
- ButtonReturn, /// order
return goods
- ButtonResearch, /// order
reseach
- ButtonUpgradeTo, ///
order upgrade
- ButtonCancel, /// cancel
- ButtonCancelUpgrade, /// cancel upgrade
- ButtonCancelTrain, ///
cancel training
- ButtonCancelBuild, ///
cancel building
+ ButtonMove, /// order move
+ ButtonAttack, /// order attack
+ ButtonRepair, /// order repair
+ ButtonHarvest, /// order harvest
+ ButtonBuild, /// order build
+ ButtonPatrol, /// order patrol
+ ButtonAttackGround, /// order attack ground
+ ButtonSpellCast, /// order cast spell
+ ButtonUnload, /// order unload unit
+ ButtonStop, /// order stop
+ ButtonButton, /// choose other button set
+ ButtonTrain, /// order train
+ ButtonStandGround, /// order stand ground
+ ButtonReturn, /// order return goods
+ ButtonResearch, /// order reseach
+ ButtonUpgradeTo, /// order upgrade
+ ButtonCancel, /// cancel
+ ButtonCancelUpgrade, /// cancel upgrade
+ ButtonCancelTrain, /// cancel training
+ ButtonCancelBuild, /// cancel building
};
/// typedef for action of button
@@ -75,156 +75,156 @@
/// Action of button
struct _button_action_ {
- int Pos;
/// button position in the grid
- int Level;
/// requires button level
- enum _button_cmd_ Action; /// command on
button press
- int Value;
/// extra value for command
- char* ValueStr; /// keep
original value string
- /// Check if this button is allowed
- ButtonCheckFunc Allowed;
- char* AllowStr; /// argument
for allowed
- char* UnitMask; /// for which
units is it available
- IconConfig Icon;
/// icon to display
- int Key;
/// alternative on keyboard
- char* Hint; /// tip
text
+ int Pos; /// button position in the grid
+ int Level; /// requires button level
+ enum _button_cmd_ Action; /// command on button press
+ int Value; /// extra value for command
+ char* ValueStr; /// keep original value string
+ /// Check if this button is allowed
+ ButtonCheckFunc Allowed;
+ char* AllowStr; /// argument for allowed
+ char* UnitMask; /// for which units is it available
+ IconConfig Icon; /// icon to display
+ int Key; /// alternative on keyboard
+ char* Hint; /// tip text
};
/// Button area under cursor
enum _button_area_ {
- ButtonAreaSelected, ///
Selected button
- ButtonAreaTraining, ///
Training button
- ButtonAreaUpgrading, /// Upgrading button
- ButtonAreaResearching, /// Researching button
- ButtonAreaTransporting, /// Transporting button
- ButtonAreaButton, ///
Button panel button
- ButtonAreaMenu, /// Menu button
+ ButtonAreaSelected, /// Selected button
+ ButtonAreaTraining, /// Training button
+ ButtonAreaUpgrading, /// Upgrading button
+ ButtonAreaResearching, /// Researching button
+ ButtonAreaTransporting, /// Transporting button
+ ButtonAreaButton, /// Button panel button
+ ButtonAreaMenu, /// Menu button
};
/// Menu button under cursor
enum _menu_button_under_ {
- ButtonUnderMenu, ///
Menu button
- ButtonUnderNetworkMenu, /// Network menu button
- ButtonUnderNetworkDiplomacy, /// Diplomacy button
+ ButtonUnderMenu, /// Menu button
+ ButtonUnderNetworkMenu, /// Network menu button
+ ButtonUnderNetworkDiplomacy, /// Diplomacy button
};
/// current interface state
enum _iface_state_ {
- IfaceStateNormal, ///
Normal Game state
- IfaceStateMenu, /// Menu active
+ IfaceStateNormal, /// Normal Game state
+ IfaceStateMenu, /// Menu active
};
/// current key state
enum _key_state_ {
- KeyStateCommand = 0, /// keys -> commands
- KeyStateInput /// keys -> line editor
-}; /// current
keyboard state
+ KeyStateCommand = 0, /// keys -> commands
+ KeyStateInput /// keys -> line editor
+}; /// current keyboard state
/// additional keycodes
enum _key_codes_ {
- KeyCodeUp=0x101, ///
internal keycode: cursor up key
- KeyCodeDown, /// internal
keycode: cursor down key
- KeyCodeLeft, /// internal
keycode: cursor left key
- KeyCodeRight, /// internal
keycode: cursor right key
- KeyCodePause, /// internal
keycode: game pause key
-
- KeyCodeF1,
/// internal keycode: F1 function keys
- KeyCodeF2,
/// internal keycode: F2 function keys
- KeyCodeF3,
/// internal keycode: F3 function keys
- KeyCodeF4,
/// internal keycode: F4 function keys
- KeyCodeF5,
/// internal keycode: F5 function keys
- KeyCodeF6,
/// internal keycode: F6 function keys
- KeyCodeF7,
/// internal keycode: F7 function keys
- KeyCodeF8,
/// internal keycode: F8 function keys
- KeyCodeF9,
/// internal keycode: F9 function keys
- KeyCodeF10,
/// internal keycode: F10 function keys
- KeyCodeF11,
/// internal keycode: F11 function keys
- KeyCodeF12,
/// internal keycode: F12 function keys
-
- KeyCodeKP0,
/// internal keycode: keypad 0
- KeyCodeKP1,
/// internal keycode: keypad 1
- KeyCodeKP2,
/// internal keycode: keypad 2
- KeyCodeKP3,
/// internal keycode: keypad 3
- KeyCodeKP4,
/// internal keycode: keypad 4
- KeyCodeKP5,
/// internal keycode: keypad 5
- KeyCodeKP6,
/// internal keycode: keypad 6
- KeyCodeKP7,
/// internal keycode: keypad 7
- KeyCodeKP8,
/// internal keycode: keypad 8
- KeyCodeKP9,
/// internal keycode: keypad 9
- KeyCodeKPPlus, /// internal
keycode: keypad +
- KeyCodeKPMinus, /// internal
keycode: keypad -
- KeyCodeKPPeriod, ///
internal keycode: keypad .
-
- KeyCodeShift, /// internal
keycode: shift modifier
- KeyCodeControl, /// internal
keycode: ctrl modifier
- KeyCodeAlt,
/// internal keycode: alt modifier
- KeyCodeSuper, /// internal
keycode: super modifier
- KeyCodeHyper, /// internal
keycode: hyper modifier
+ KeyCodeUp=0x101, /// internal keycode: cursor up key
+ KeyCodeDown, /// internal keycode: cursor down key
+ KeyCodeLeft, /// internal keycode: cursor left key
+ KeyCodeRight, /// internal keycode: cursor right key
+ KeyCodePause, /// internal keycode: game pause key
+
+ KeyCodeF1, /// internal keycode: F1 function keys
+ KeyCodeF2, /// internal keycode: F2 function keys
+ KeyCodeF3, /// internal keycode: F3 function keys
+ KeyCodeF4, /// internal keycode: F4 function keys
+ KeyCodeF5, /// internal keycode: F5 function keys
+ KeyCodeF6, /// internal keycode: F6 function keys
+ KeyCodeF7, /// internal keycode: F7 function keys
+ KeyCodeF8, /// internal keycode: F8 function keys
+ KeyCodeF9, /// internal keycode: F9 function keys
+ KeyCodeF10, /// internal keycode: F10 function keys
+ KeyCodeF11, /// internal keycode: F11 function keys
+ KeyCodeF12, /// internal keycode: F12 function keys
+
+ KeyCodeKP0, /// internal keycode: keypad 0
+ KeyCodeKP1, /// internal keycode: keypad 1
+ KeyCodeKP2, /// internal keycode: keypad 2
+ KeyCodeKP3, /// internal keycode: keypad 3
+ KeyCodeKP4, /// internal keycode: keypad 4
+ KeyCodeKP5, /// internal keycode: keypad 5
+ KeyCodeKP6, /// internal keycode: keypad 6
+ KeyCodeKP7, /// internal keycode: keypad 7
+ KeyCodeKP8, /// internal keycode: keypad 8
+ KeyCodeKP9, /// internal keycode: keypad 9
+ KeyCodeKPPlus, /// internal keycode: keypad +
+ KeyCodeKPMinus, /// internal keycode: keypad -
+ KeyCodeKPPeriod, /// internal keycode: keypad .
+
+ KeyCodeShift, /// internal keycode: shift modifier
+ KeyCodeControl, /// internal keycode: ctrl modifier
+ KeyCodeAlt, /// internal keycode: alt modifier
+ KeyCodeSuper, /// internal keycode: super modifier
+ KeyCodeHyper, /// internal keycode: hyper modifier
- KeyCodePrint, /// internal
keycode: print screen
- KeyCodeDelete, /// internal
keycode: delete
+ KeyCodePrint, /// internal keycode: print screen
+ KeyCodeDelete, /// internal keycode: delete
};
/// Key modifier
enum _key_modifiers_ {
- ModifierShift = 1, /// any shift
key pressed
- ModifierControl = 2, /// any
controll key pressed
- ModifierAlt = 4,
/// any alt key pressed
- ModifierSuper = 8, /// super key
(reserved for WM)
- ModifierHyper = 16, /// any hyper
key pressed
+ ModifierShift = 1, /// any shift key pressed
+ ModifierControl = 2, /// any controll key pressed
+ ModifierAlt = 4, /// any alt key pressed
+ ModifierSuper = 8, /// super key (reserved for WM)
+ ModifierHyper = 16, /// any hyper key pressed
};
-#define MouseDoubleShift 8 /// shift for double
click button
-#define MouseDragShift 16 /// shift for
drag button
-#define MouseHoldShift 24 /// shift for
hold button
+#define MouseDoubleShift 8 /// shift for double click button
+#define MouseDragShift 16 /// shift for drag button
+#define MouseHoldShift 24 /// shift for hold button
/// pressed mouse button flags
enum _mouse_buttons_ {
- LeftButton = 2,
/// Left button on mouse
- MiddleButton = 4, /// Middle
button on mouse
- RightButton = 8,
/// Right button on mouse
+ LeftButton = 2, /// Left button on mouse
+ MiddleButton = 4, /// Middle button on mouse
+ RightButton = 8, /// Right button on mouse
- UpButton = 16,
/// Scroll up button on mouse
- DownButton = 32,
/// Scroll down button on mouse
+ UpButton = 16, /// Scroll up button on mouse
+ DownButton = 32, /// Scroll down button on mouse
/// Left+Middle button on mouse
LeftAndMiddleButton = LeftButton|MiddleButton,
/// Left+Right button on mouse
- LeftAndRightButton = LeftButton|RightButton,
+ LeftAndRightButton = LeftButton|RightButton,
/// Middle+Right button on mouse
MiddleAndRightButton= MiddleButton|RightButton,
};
/// Where is our cursor ?
enum _cursor_on_ {
- CursorOnUnknown = -1, /// not known
- CursorOnMinimap, ///
minimap area
- CursorOnButton, /// button area
see: ButtonUnderCursor
- CursorOnMap, /// over map
area
- CursorOnScrollUp, /// in
scroll up area
- CursorOnScrollDown, /// in
scroll down area
- CursorOnScrollLeft, /// in
scroll left area
- CursorOnScrollRight, /// in scroll right area
- CursorOnScrollLeftUp, /// in scroll left+up
area
- CursorOnScrollLeftDown, /// in scroll left+down
area
- CursorOnScrollRightUp, /// in scroll right+up
area
- CursorOnScrollRightDown, /// in scroll
right+down area
+ CursorOnUnknown = -1, /// not known
+ CursorOnMinimap, /// minimap area
+ CursorOnButton, /// button area see: ButtonUnderCursor
+ CursorOnMap, /// over map area
+ CursorOnScrollUp, /// in scroll up area
+ CursorOnScrollDown, /// in scroll down area
+ CursorOnScrollLeft, /// in scroll left area
+ CursorOnScrollRight, /// in scroll right area
+ CursorOnScrollLeftUp, /// in scroll left+up area
+ CursorOnScrollLeftDown, /// in scroll left+down area
+ CursorOnScrollRightUp, /// in scroll right+up area
+ CursorOnScrollRightDown, /// in scroll right+down area
};
/// Are We Scrolling With the Keyboard ?
enum _scroll_state_ {
- ScrollNone = 0, /// not
scrolling
- ScrollUp = 1, /// scroll up
only
- ScrollDown = 2, /// scroll down
only
- ScrollLeft = 4, /// scroll left
only
- ScrollRight = 8, ///
scroll right only
- ScrollLeftUp = 5, ///
scroll left+up
- ScrollLeftDown = 6, ///
scroll left+down
- ScrollRightUp = 9, ///
scroll right+up
- ScrollRightDown = 10, /// scroll right+down
+ ScrollNone = 0, /// not scrolling
+ ScrollUp = 1, /// scroll up only
+ ScrollDown = 2, /// scroll down only
+ ScrollLeft = 4, /// scroll left only
+ ScrollRight = 8, /// scroll right only
+ ScrollLeftUp = 5, /// scroll left+up
+ ScrollLeftDown = 6, /// scroll left+down
+ ScrollRightUp = 9, /// scroll right+up
+ ScrollRightDown = 10, /// scroll right+down
};
/*----------------------------------------------------------------------------
--- Variables
+-- Variables
----------------------------------------------------------------------------*/
/// Flag telling if the game is running
@@ -279,46 +279,46 @@
extern int HoldClickDelay;
/*----------------------------------------------------------------------------
--- Functions
+-- Functions
----------------------------------------------------------------------------*/
//
-// in console.c
+// in console.c
//
/// Console clear
extern void ConsoleClear(void);
/// Console printf
-extern void ConsolePrintf(const char*,...);
+extern void ConsolePrintf(const char*, ...);
/// Redraw the console
extern void DrawConsole(void);
//
-// in botpanel.c
+// in botpanel.c
//
/// Generate all buttons
extern void InitButtons(void);
/// Free memory for buttons
extern void CleanButtons(void);
/// Make a new button
-extern int AddButton(int pos,int level,const char* IconIdent,
- enum _button_cmd_ action,const char* value,
- const ButtonCheckFunc func,const void* arg,
- int key,const char* hint,const char* umask);
+extern int AddButton(int pos, int level, const char* IconIdent,
+ enum _button_cmd_ action, const char* value,
+ const ButtonCheckFunc func, const void* arg,
+ int key, const char* hint, const char* umask);
/// Save all buttons
extern void SaveButtons(CLFile* file);
//
-// in mouse.c
+// in mouse.c
//
/// Called if any mouse button is pressed down
extern void HandleButtonDown(unsigned button);
/// Called if any mouse button is released up
extern void HandleButtonUp(unsigned button);
/// Keep coordinates in window and update cursor position
-extern void HandleCursorMove(int* x,int* y);
+extern void HandleCursorMove(int* x, int* y);
/// Called if the mouse is moved
-extern void HandleMouseMove(int x,int y);
+extern void HandleMouseMove(int x, int y);
/// Called if the mouse exits the game window (only for some videomodes)
extern void HandleMouseExit(void);
@@ -335,25 +335,25 @@
extern void HandleKeyRepeat(unsigned keycode,unsigned keychar);
//
-// in interface.c (for link between video and mouse.c)
+// in interface.c (for link between video and mouse.c)
//
/// Called if any mouse button is pressed down
-extern void InputMouseButtonPress(const EventCallback*,unsigned,unsigned);
+extern void InputMouseButtonPress(const EventCallback*, unsigned, unsigned);
/// Called if any mouse button is released up
-extern void InputMouseButtonRelease(const EventCallback*,unsigned,unsigned);
+extern void InputMouseButtonRelease(const EventCallback*, unsigned, unsigned);
/// Called if the mouse is moved
-extern void InputMouseMove(const EventCallback*,unsigned,int,int);
+extern void InputMouseMove(const EventCallback*, unsigned, int, int);
/// Called if the mouse exits the game window (when supported by
videomode)
-extern void InputMouseExit(const EventCallback*,unsigned);
+extern void InputMouseExit(const EventCallback*, unsigned);
/// Called to look for mouse timeouts
-extern void InputMouseTimeout(const EventCallback*,unsigned);
+extern void InputMouseTimeout(const EventCallback*, unsigned);
/// Called if any key button is pressed down
-extern void InputKeyButtonPress(const
EventCallback*,unsigned,unsigned,unsigned);
+extern void InputKeyButtonPress(const EventCallback*, unsigned, unsigned,
unsigned);
/// Called if any key button is released up
-extern void InputKeyButtonRelease(const
EventCallback*,unsigned,unsigned,unsigned);
+extern void InputKeyButtonRelease(const EventCallback*, unsigned, unsigned,
unsigned);
/// Called to look for key timeouts
-extern void InputKeyTimeout(const EventCallback*,unsigned);
+extern void InputKeyTimeout(const EventCallback*, unsigned);
/// Toggle pause mode
extern void UiTogglePause(void);
@@ -361,10 +361,10 @@
extern int HandleCheats(const char*);
//
-// Chaos pur.
+// Chaos pur.
//
/// Called if right mouse button is pressed
-extern void DoRightButton(int tx,int ty);
+extern void DoRightButton(int tx, int ty);
/// Cancel the building input mode
extern void CancelBuildingMode(void);
@@ -375,12 +375,12 @@
/// Draw the player resource in resource line
extern void DrawResources(void);
/// Set message to display
-extern void SetMessage( const char* fmt, ... );
+extern void SetMessage(const char* fmt, ...);
/// Set message to display with event point
-extern void SetMessageEvent( int x, int y, const char* fmt, ... );
+extern void SetMessageEvent(int x, int y, const char* fmt, ...);
/// Center view-point on last event message
extern void CenterOnMessage(void);
- /// Cleanup all messages
+ /// Cleanup all messages
extern void CleanMessages(void);
/// Set status line to show this information
@@ -392,7 +392,7 @@
/// Draw costs in status line
extern void DrawCosts(void);
/// Set costs to be displayed in status line
-extern void SetCosts(int,int,const int* costs);
+extern void SetCosts(int, int, const int* costs);
/// Clear the costs displayed in status line (undisplay!)
extern void ClearCosts(void);
@@ -412,40 +412,40 @@
extern int DoButtonPanelKey(int key);
/// Handle the mouse in scroll area
-extern int HandleMouseScrollArea(int,int);
+extern int HandleMouseScrollArea(int, int);
//
// in button_checks.c
//
/// Check is always true
-extern int ButtonCheckTrue(const Unit*,const ButtonAction*);
+extern int ButtonCheckTrue(const Unit*, const ButtonAction*);
/// Check is always false
-extern int ButtonCheckFalse(const Unit*,const ButtonAction*);
+extern int ButtonCheckFalse(const Unit*, const ButtonAction*);
/// Check if allowed upgrade is ready
-extern int ButtonCheckUpgrade(const Unit*,const ButtonAction*);
+extern int ButtonCheckUpgrade(const Unit*, const ButtonAction*);
/// Check if allowed units exists
-extern int ButtonCheckUnitsOr(const Unit*,const ButtonAction*);
+extern int ButtonCheckUnitsOr(const Unit*, const ButtonAction*);
/// Check if allowed units exists
-extern int ButtonCheckUnitsAnd(const Unit*,const ButtonAction*);
+extern int ButtonCheckUnitsAnd(const Unit*, const ButtonAction*);
/// Check if have network play
-extern int ButtonCheckNetwork(const Unit*,const ButtonAction*);
+extern int ButtonCheckNetwork(const Unit*, const ButtonAction*);
/// Check if don't have network play
-extern int ButtonCheckNoNetwork(const Unit*,const ButtonAction*);
+extern int ButtonCheckNoNetwork(const Unit*, const ButtonAction*);
/// Check if unit isn't working (train,upgrade,research)
-extern int ButtonCheckNoWork(const Unit*,const ButtonAction*);
+extern int ButtonCheckNoWork(const Unit*, const ButtonAction*);
/// Check if unit isn't researching or upgrading
-extern int ButtonCheckNoResearch(const Unit*,const ButtonAction*);
+extern int ButtonCheckNoResearch(const Unit*, const ButtonAction*);
/// Check if all requirements for an attack to are meet
-extern int ButtonCheckAttack(const Unit*,const ButtonAction*);
+extern int ButtonCheckAttack(const Unit*, const ButtonAction*);
/// Check if all requirements for an upgrade to are meet
-extern int ButtonCheckUpgradeTo(const Unit*,const ButtonAction*);
+extern int ButtonCheckUpgradeTo(const Unit*, const ButtonAction*);
/// Check if all requirements for a research are meet
-extern int ButtonCheckResearch(const Unit*,const ButtonAction*);
+extern int ButtonCheckResearch(const Unit*, const ButtonAction*);
/// Check if all requirements for a single research are meet
-extern int ButtonCheckSingleResearch(const Unit*,const ButtonAction*);
+extern int ButtonCheckSingleResearch(const Unit*, const ButtonAction*);
//
-// in ccl_ui.c
+// in ccl_ui.c
//
/// Called whenever the units selection is altered
extern void SelectionChanged(void);
@@ -454,4 +454,4 @@
//@}
-#endif // !__INTERFACE_H__
+#endif // !__INTERFACE_H__
Index: stratagus/src/include/iocompat.h
diff -u stratagus/src/include/iocompat.h:1.10
stratagus/src/include/iocompat.h:1.11
--- stratagus/src/include/iocompat.h:1.10 Sat Dec 20 16:33:26 2003
+++ stratagus/src/include/iocompat.h Mon Dec 22 15:09:46 2003
@@ -5,12 +5,12 @@
// /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
// \/ \/ \//_____/ \/
// ______________________ ______________________
-// T H E W A R B E G I N S
-// Stratagus - A free fantasy real time strategy game engine
+// T H E W A R B E G I N S
+// Stratagus - A free fantasy real time strategy game engine
//
-/address@hidden iocompat.h - IO platform compatibility header file.
*/
+/address@hidden iocompat.h - IO platform compatibility header file. */
//
-// (c) Copyright 2002 by Andreas Arens
+// (c) Copyright 2002-2004 by Andreas Arens
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: iocompat.h,v 1.10 2003/12/20 05:33:26 jsalmon3 Exp $
+// $Id: iocompat.h,v 1.11 2003/12/22 04:09:46 wizzard Exp $
#ifndef __IOCOMPAT_H__
#define __IOCOMPAT_H__
@@ -34,7 +34,7 @@
//@{
/*----------------------------------------------------------------------------
--- Platform dependant IO-related Includes and Definitions
+-- Platform dependant IO-related Includes and Definitions
----------------------------------------------------------------------------*/
#ifndef _MSC_VER
@@ -49,8 +49,8 @@
#else // _MSC_VER
-#define R_OK 4
-#define F_OK 0
+#define R_OK 4
+#define F_OK 0
#include <sys/types.h>
#include <sys/stat.h>
#include <direct.h>
@@ -65,9 +65,9 @@
#endif // _MSC_VER
#ifndef O_BINARY
-#define O_BINARY 0
+#define O_BINARY 0
#endif
//@}
-#endif // !__IOCOMPAT_H__
+#endif // !__IOCOMPAT_H__
Index: stratagus/src/include/iolib.h
diff -u stratagus/src/include/iolib.h:1.24 stratagus/src/include/iolib.h:1.25
--- stratagus/src/include/iolib.h:1.24 Sat Dec 20 16:33:26 2003
+++ stratagus/src/include/iolib.h Mon Dec 22 15:09:46 2003
@@ -5,12 +5,12 @@
// /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
// \/ \/ \//_____/ \/
// ______________________ ______________________
-// T H E W A R B E G I N S
-// Stratagus - A free fantasy real time strategy game engine
+// T H E W A R B E G I N S
+// Stratagus - A free fantasy real time strategy game engine
//
-/address@hidden iolib.h - The iolib functions header file. */
+/address@hidden iolib.h - The iolib functions header file. */
//
-// (c) Copyright 2000,2001 by Andreas Arens
+// (c) Copyright 2000-2004 by Andreas Arens
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: iolib.h,v 1.24 2003/12/20 05:33:26 jsalmon3 Exp $
+// $Id: iolib.h,v 1.25 2003/12/22 04:09:46 wizzard Exp $
#ifndef __IOLIB_H__
#define __IOLIB_H__
@@ -34,7 +34,7 @@
//@{
/*----------------------------------------------------------------------------
--- Includes
+-- Includes
----------------------------------------------------------------------------*/
#define DrawIcon WinDrawIcon
@@ -55,16 +55,16 @@
#undef FindResource
/*----------------------------------------------------------------------------
--- Definitons
+-- Definitons
----------------------------------------------------------------------------*/
/**
-** FileList struct used by directory access routine
+** FileList struct used by directory access routine
*/
typedef struct _filelist_ {
- char *name; ///
Name of the file
- int type;
/// Type of the file
- void *xdata; ///
Extra data attached by high level
+ char* name; /// Name of the file
+ int type; /// Type of the file
+ void* xdata; /// Extra data attached by high level
} FileList;
@@ -74,40 +74,40 @@
// FIXME: but we can avoid it anyway.
// use plain file routines directly
-#define CLFile FILE
-#define CLopen(file,whatever) fopen(file,"rwb")
-#define CLread(file,buf,len) fread(buf,1,len,file)
-#define CLseek(file,offset,whence) fseek(file,offset,whence)
-#define CLflush(file) fflush(file)
-#define CLclose(file) fclose(file)
+#define CLFile FILE
+#define CLopen(file,whatever) fopen(file,"rwb")
+#define CLread(file,buf,len) fread(buf,1,len,file)
+#define CLseek(file,offset,whence) fseek(file,offset,whence)
+#define CLflush(file) fflush(file)
+#define CLclose(file) fclose(file)
-#else // !USE_ZLIB && !USE_BZ2LIB && !defined(USE_ZZIPLIB)
+#else // !USE_ZLIB && !USE_BZ2LIB && !defined(USE_ZZIPLIB)
/**
-** Defines a library file
+** Defines a library file
**
-** @todo zip archive support
+** @todo zip archive support
*/
typedef struct _CL_File_ {
- int cl_type;
/// type of CLFile
- FILE *cl_plain; /// standard
file pointer
+ int cl_type; /// type of CLFile
+ FILE* cl_plain; /// standard file pointer
#ifdef USE_ZLIB
- gzFile *cl_gz; ///
gzip file pointer
-#endif // !USE_ZLIB
+ gzFile *cl_gz; /// gzip file pointer
+#endif // !USE_ZLIB
#ifdef USE_BZ2LIB
- BZFILE *cl_bz; ///
bzip2 file pointer
-#endif // !USE_BZ2LIB
+ BZFILE* cl_bz; /// bzip2 file pointer
+#endif // !USE_BZ2LIB
#ifdef USE_ZZIPLIB
- ZZIP_FILE *cl_zz;
/// zzip file pointer
-#endif // !USE_ZZIPLIB
+ ZZIP_FILE* cl_zz; /// zzip file pointer
+#endif // !USE_ZZIPLIB
} CLFile;
enum {
- CLF_TYPE_INVALID, ///
invalid file handle
- CLF_TYPE_PLAIN, /// plain text
file handle
- CLF_TYPE_GZIP, /// gzip file
handle
- CLF_TYPE_BZIP2, /// bzip2 file
handle
- CLF_TYPE_ZZIP, /// zzip file
handle
+ CLF_TYPE_INVALID, /// invalid file handle
+ CLF_TYPE_PLAIN, /// plain text file handle
+ CLF_TYPE_GZIP, /// gzip file handle
+ CLF_TYPE_BZIP2, /// bzip2 file handle
+ CLF_TYPE_ZZIP, /// zzip file handle
};
#define CL_OPEN_READ 0x1
@@ -116,11 +116,11 @@
#define CL_WRITE_BZ2 0x8
/*----------------------------------------------------------------------------
--- Functions
+-- Functions
----------------------------------------------------------------------------*/
/// Library file open
-extern CLFile *CLopen(const char *fn,long flags);
+extern CLFile *CLopen(const char *fn, long flags);
/// Library file close
extern int CLclose(CLFile *file);
/// Library file flush
@@ -133,14 +133,14 @@
extern int CLprintf(CLFile *file, char *format, ...);
-#endif // USE_ZLIB || USE_BZ2LIB || USE_ZZIPLIB
+#endif // USE_ZLIB || USE_BZ2LIB || USE_ZZIPLIB
/// Build libary path name
extern char* LibraryFileName(const char* file,char* buffer);
/// Read the contents of a directory
-extern int ReadDataDirectory(const char* dirname,int (*filter)(char *,FileList
*),FileList **flp);
+extern int ReadDataDirectory(const char* dirname, int (*filter)(char*,
FileList*), FileList** flp);
//@}
-#endif // !__IOLIB_H__
+#endif // !__IOLIB_H__
Index: stratagus/src/include/libcda.h
diff -u stratagus/src/include/libcda.h:1.1 stratagus/src/include/libcda.h:1.2
--- stratagus/src/include/libcda.h:1.1 Fri Apr 5 15:33:44 2002
+++ stratagus/src/include/libcda.h Mon Dec 22 15:09:46 2003
@@ -12,8 +12,8 @@
/* High-byte is major version, low-byte is minor. */
-#define LIBCDA_VERSION 0x0005
-#define LIBCDA_VERSION_STR "0.5"
+#define LIBCDA_VERSION 0x0005
+#define LIBCDA_VERSION_STR "0.5"
extern const char *cd_error;
@@ -31,10 +31,10 @@
int cd_is_paused(void);
void cd_stop(void);
-int cd_get_tracks(int *first, int *last);
+int cd_get_tracks(int* first, int* last);
int cd_is_audio(int track);
-void cd_get_volume(int *c0, int *c1);
+void cd_get_volume(int* c0, int* c1);
void cd_set_volume(int c0, int c1);
void cd_eject(void);
Index: stratagus/src/include/map.h
diff -u stratagus/src/include/map.h:1.108 stratagus/src/include/map.h:1.109
--- stratagus/src/include/map.h:1.108 Sat Dec 20 16:33:26 2003
+++ stratagus/src/include/map.h Mon Dec 22 15:09:46 2003
@@ -5,13 +5,13 @@
// /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
// \/ \/ \//_____/ \/
// ______________________ ______________________
-// T H E W A R B E G I N S
-// Stratagus - A free fantasy real time strategy game engine
+// T H E W A R B E G I N S
+// Stratagus - A free fantasy real time strategy game engine
//
-/address@hidden map.h - The map headerfile. */
+/address@hidden map.h - The map headerfile. */
//
-// (c) Copyright 1998-2003 by Vladi Shabanski, Lutz Sammer,
-// and Jimmy Salmon
+// (c) Copyright 1998-2003 by Vladi Shabanski, Lutz Sammer,
+// and Jimmy Salmon
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: map.h,v 1.108 2003/12/20 05:33:26 jsalmon3 Exp $
+// $Id: map.h,v 1.109 2003/12/22 04:09:46 wizzard Exp $
#ifndef __MAP_H__
#define __MAP_H__
@@ -35,152 +35,152 @@
//@{
/*----------------------------------------------------------------------------
--- Documentation
+-- Documentation
----------------------------------------------------------------------------*/
/**
-** @struct _map_field_ map.h
+** @struct _map_field_ map.h
**
-** \#include "map.h"
+** \#include "map.h"
**
-** typedef struct _map_field_ MapField;
+** typedef struct _map_field_ MapField;
**
-** This structure contains all informations about a field on map.
-** It contains it look, properties and content.
+** This structure contains all informations about a field on map.
+** It contains it look, properties and content.
**
-** The map-field structure members:
+** The map-field structure members:
**
-** MapField::Tile
+** MapField::Tile
**
-** Tile is number defining the graphic image
display for the
-** map-field. 65535 different tiles are supported.
A tile is
-** currently 32x32 pixels. In the future is
planned to support
-** animated tiles.
+** Tile is number defining the graphic image display for the
+** map-field. 65535 different tiles are supported. A tile is
+** currently 32x32 pixels. In the future is planned to support
+** animated tiles.
**
-** MapField::SeenTile
+** MapField::SeenTile
**
-** This is the tile number, that the player
sitting on the computer
-** currently knows. Idea: Can be uses for
illusions.
+** This is the tile number, that the player sitting on the computer
+** currently knows. Idea: Can be uses for illusions.
**
-** MapField::Flags
+** MapField::Flags
**
-** Contains special information of that tile. What
units are
-** on this field, what units could be placed on
this field.
+** Contains special information of that tile. What units are
+** on this field, what units could be placed on this field.
**
-** This is the list of all flags currently used:
+** This is the list of all flags currently used:
**
-** ::MapFieldVisible field is visible.
-** ::MapFieldExplored field is explored.
-** ::MapFieldHuman human player is the
owner of the field used for
-** walls.
-** ::MapFieldLandAllowed land units are allowed.
-** ::MapFieldCoastAllowed coast units
(transporter) and coast
-** buildings (shipyard) are
allowed.
-** ::MapFieldWaterAllowed water units allowed.
-** ::MapFieldNoBuilding no buildings allowed.
-** ::MapFieldUnpassable field is movement blocked.
-** ::MapFieldWall field contains wall.
-** ::MapFieldRocks field contains rocks.
-** ::MapFieldForest field contains forest.
-** ::MapFieldLandUnit land unit on field.
-** ::MapFieldAirUnit air unit on field.
-** ::MapFieldSeaUnit water unit on field.
-** ::MapFieldBuilding building on field.
+** ::MapFieldVisible field is visible.
+** ::MapFieldExplored field is explored.
+** ::MapFieldHuman human player is the owner of the field used for
+** walls.
+** ::MapFieldLandAllowed land units are allowed.
+** ::MapFieldCoastAllowed coast units (transporter) and coast
+** buildings (shipyard) are allowed.
+** ::MapFieldWaterAllowed water units allowed.
+** ::MapFieldNoBuilding no buildings allowed.
+** ::MapFieldUnpassable field is movement blocked.
+** ::MapFieldWall field contains wall.
+** ::MapFieldRocks field contains rocks.
+** ::MapFieldForest field contains forest.
+** ::MapFieldLandUnit land unit on field.
+** ::MapFieldAirUnit air unit on field.
+** ::MapFieldSeaUnit water unit on field.
+** ::MapFieldBuilding building on field.
**
-** Note: We want to add support for more
unit-types like under
-** ground units.
+** Note: We want to add support for more unit-types like under
+** ground units.
**
-** MapField::Value
+** MapField::Value
**
-** Extra value for each tile. This currently only
used for
-** walls, contains the remaining hit points of the
wall and
-** for forest, contains the frames until they grow.
+** Extra value for each tile. This currently only used for
+** walls, contains the remaining hit points of the wall and
+** for forest, contains the frames until they grow.
**
-** MapField::Visible[]
+** MapField::Visible[]
**
-** Counter how many units of the player can see
this field. 0 the
-** field is not explored, 1 explored, n-1 unit see
it. Currently
-** no more than 253 units can see a field.
+** Counter how many units of the player can see this field. 0 the
+** field is not explored, 1 explored, n-1 unit see it. Currently
+** no more than 253 units can see a field.
**
-** MapField::Here MapField::Here::Units
+** MapField::Here MapField::Here::Units
**
-** Contains a list of all units currently on this
field.
-** Note: currently units are only inserted at the
insert point.
-** This means units of the size of 2x2 fields are
inserted at the
-** top and right most map coordinate.
+** Contains a list of all units currently on this field.
+** Note: currently units are only inserted at the insert point.
+** This means units of the size of 2x2 fields are inserted at the
+** top and right most map coordinate.
**
-** MapField::Region
+** MapField::Region
**
-** Number of the region to that the tile belongs.
+** Number of the region to that the tile belongs.
*/
/**
-** @struct _world_map_ map.h
+** @struct _world_map_ map.h
**
-** \#include "map.h"
+** \#include "map.h"
**
-** typedef struct _world_map_ WorldMap;
+** typedef struct _world_map_ WorldMap;
**
-** This structure contains all informations about a stratagus
world.
-** A world is a rectangle of any size. In the future it is planned
to
-** support multiple worlds.
+** This structure contains all informations about a stratagus world.
+** A world is a rectangle of any size. In the future it is planned to
+** support multiple worlds.
**
-** The world-map structure members:
+** The world-map structure members:
**
-** WorldMap::Width WorldMap::Height
+** WorldMap::Width WorldMap::Height
**
-** The map size in tiles.
+** The map size in tiles.
**
-** WorldMap::Fields
+** WorldMap::Fields
**
-** An array WorldMap::Width*WorldMap::Height of
all fields
-** belonging to this map.
+** An array WorldMap::Width*WorldMap::Height of all fields
+** belonging to this map.
**
-** WorldMap::NoFogOfWar
+** WorldMap::NoFogOfWar
**
-** Flag if true, the fog of war is disabled.
+** Flag if true, the fog of war is disabled.
**
-** WorldMap::TerrainName
+** WorldMap::TerrainName
**
-** Terrain as name. Used for unit-type look
changes depending on
-** the current terrain type. In the future we want
to support
-** multiple terrains pro map.
+** Terrain as name. Used for unit-type look changes depending on
+** the current terrain type. In the future we want to support
+** multiple terrains pro map.
**
-** WorldMap::Terrain
+** WorldMap::Terrain
**
-** The terrain as number, this should be removed.
+** The terrain as number, this should be removed.
**
-** WorldMap::Tileset
+** WorldMap::Tileset
**
-** Tileset data for the map. See ::Tileset. This
contains all
-** information about the tile.
+** Tileset data for the map. See ::Tileset. This contains all
+** information about the tile.
**
-** WorldMap::TileCount
+** WorldMap::TileCount
**
-** How many graphic tiles are available.
+** How many graphic tiles are available.
**
-** WorldMap::Tiles
+** WorldMap::Tiles
**
-** Pointer into the tile graphic data. Used to
find fast the start
-** of different tiles.
+** Pointer into the tile graphic data. Used to find fast the start
+** of different tiles.
**
-** WorldMap::TileData
+** WorldMap::TileData
**
-** Tiles graphic for the map, loaded from
WorldMap::Tileset::File.
+** Tiles graphic for the map, loaded from WorldMap::Tileset::File.
**
-** WorldMap::Description[32]
+** WorldMap::Description[32]
**
-** Short description of the map.
+** Short description of the map.
**
-** WorldMap::Info
+** WorldMap::Info
**
-** Descriptive information of the map.
-** @see ::_map_info_
-** @todo This structure contains duplicate
informations of the map.
+** Descriptive information of the map.
+** @see ::_map_info_
+** @todo This structure contains duplicate informations of the map.
*/
/*----------------------------------------------------------------------------
--- Includes
+-- Includes
----------------------------------------------------------------------------*/
#include "unit.h"
@@ -188,170 +188,171 @@
#include "tileset.h"
/*----------------------------------------------------------------------------
--- Map
+-- Map
----------------------------------------------------------------------------*/
-// JOHNS: only limited by computer memory
-// OLD NEW Code
-// 512x512: 2 MB 3 MB
-// 1024x1024: 8 MB 12 MB
-// 2048*2048: 32 MB 48 MB
-// 4096*4096: 128 MB 192 MB
-#define MaxMapWidth 256 /// maximal
map width supported
-#define MaxMapHeight 256 /// maximal map
height supported
+// JOHNS: only limited by computer memory
+// OLD NEW Code
+// 512x512: 2 MB 3 MB
+// 1024x1024: 8 MB 12 MB
+// 2048*2048: 32 MB 48 MB
+// 4096*4096: 128 MB 192 MB
+#define MaxMapWidth 256 /// maximal map width supported
+#define MaxMapHeight 256 /// maximal map height supported
/*----------------------------------------------------------------------------
--- Map - field
+-- Map - field
----------------------------------------------------------------------------*/
#ifdef UNIT_ON_MAP
/**
-** All units on a map field, if more than one.
-** FIXME: unused
+** All units on a map field, if more than one.
+** FIXME: unused
*/
typedef struct _unit_array_ {
- Unit* Building; /// Building or
corpse
- Unit* SeaUnit; /// Sea unit
- Unit* LandUnit; /// Land unit
- Unit* AirUnit; /// Air unit
+ Unit* Building; /// Building or corpse
+ Unit* SeaUnit; /// Sea unit
+ Unit* LandUnit; /// Land unit
+ Unit* AirUnit; /// Air unit
} UnitArray;
#endif
/// Describes a field of the map
typedef struct _map_field_ {
- unsigned short Tile; /// graphic
tile number
- unsigned short SeenTile; /// last seen tile (FOW)
- unsigned short Flags; /// field flags
+ unsigned short Tile; /// graphic tile number
+ unsigned short SeenTile; /// last seen tile (FOW)
+ unsigned short Flags; /// field flags
// FIXME: Value can be removed, walls and regeneration can be handled
- // different.
- unsigned char Value; /// HP for
walls/ Wood Regeneration
- unsigned char Visible[PlayerMax]; /// Seen counter 0
unexplored
+ // different.
+ unsigned char Value; /// HP for walls/ Wood Regeneration
+ unsigned char Visible[PlayerMax]; /// Seen counter 0 unexplored
#ifdef UNIT_ON_MAP
union {
- Unit* Units;
/// An unit on the map field
- UnitArray* Array; ///
More units on the map field
- } Here;
/// What is on the field
+ Unit* Units; /// An unit on the map field
+ UnitArray* Array; /// More units on the map field
+ } Here; /// What is on the field
#endif
#ifdef UNITS_ON_MAP
- UnitRef Building; /// Building or
corpse
- UnitRef AirUnit; /// Air unit
- UnitRef LandUnit; /// Land unit
- UnitRef SeaUnit; /// Sea unit
+ UnitRef Building; /// Building or corpse
+ UnitRef AirUnit; /// Air unit
+ UnitRef LandUnit; /// Land unit
+ UnitRef SeaUnit; /// Sea unit
#endif
#ifdef HIERARCHIC_PATHFINDER
- unsigned short RegId; /// Region to which the field
belongs
+ unsigned short RegId; /// Region to which the field belongs
// FIXME: Johns: this values can't be placed in the map field,
// this needs too much memory.
- unsigned short f, g; /// A*
parameters (no need to store h)
- unsigned short h; ///stored only
for BestSoFar computation
-#define HIER_LOW_OPEN 0
-#define HIER_LOW_CLOSED 1
- unsigned int Set:1; /// Open/Closed
- unsigned int Goal:1;
+ unsigned short f, g; /// A* parameters (no need to store h)
+ unsigned short h; ///stored only for BestSoFar computation
+#define HIER_LOW_OPEN 0
+#define HIER_LOW_CLOSED 1
+ unsigned int Set:1; /// Open/Closed
+ unsigned int Goal:1;
// FIXME perhaps the previous 2 one-bit fields should be crammed into
e.g.
// g? There's potentially a *lot* of MapFields in this game and every
byte
// saved here could translate into 1 MB saved overall for max sized map.
- char Traceback; /// The field
through which we arrived
-
/// to this one
+ char Traceback; /// The field through which we arrived to this one
#endif
} MapField;
// Not used until now:
-//#define MapFieldArray 0x0004 ///
More than one unit on the field
+#if 0
+#define MapFieldArray 0x0004 /// More than one unit on the field
+#endif
-#define MapFieldHuman 0x0008 /// Human is
owner of the field (walls)
+#define MapFieldHuman 0x0008 /// Human is owner of the field (walls)
-#define MapFieldLandAllowed 0x0010 /// Land units allowed
-#define MapFieldCoastAllowed 0x0020 /// Coast (transporter)
units allowed
-#define MapFieldWaterAllowed 0x0040 /// Water units allowed
-#define MapFieldNoBuilding 0x0080 /// No buildings allowed
-
-#define MapFieldUnpassable 0x0100 /// Field is movement
blocked
-#define MapFieldWall 0x0200 /// Field
contains wall
-#define MapFieldRocks 0x0400 /// Field
contains rocks
-#define MapFieldForest 0x0800 /// Field
contains forest
-
-#define MapFieldLandUnit 0x1000 /// Land unit on field
-#define MapFieldAirUnit 0x2000 /// Air
unit on field
-#define MapFieldSeaUnit 0x4000 ///
Water unit on field
-#define MapFieldBuilding 0x8000 /// Building on field
+#define MapFieldLandAllowed 0x0010 /// Land units allowed
+#define MapFieldCoastAllowed 0x0020 /// Coast (transporter) units allowed
+#define MapFieldWaterAllowed 0x0040 /// Water units allowed
+#define MapFieldNoBuilding 0x0080 /// No buildings allowed
+
+#define MapFieldUnpassable 0x0100 /// Field is movement blocked
+#define MapFieldWall 0x0200 /// Field contains wall
+#define MapFieldRocks 0x0400 /// Field contains rocks
+#define MapFieldForest 0x0800 /// Field contains forest
+
+#define MapFieldLandUnit 0x1000 /// Land unit on field
+#define MapFieldAirUnit 0x2000 /// Air unit on field
+#define MapFieldSeaUnit 0x4000 /// Water unit on field
+#define MapFieldBuilding 0x8000 /// Building on field
/*----------------------------------------------------------------------------
--- Map info structure
+-- Map info structure
----------------------------------------------------------------------------*/
/**
-** Get info about a map.
+** Get info about a map.
*/
typedef struct _map_info_ {
- char* Description; /// Map
description
- char* MapTerrainName; /// Map terrain
name
+ char* Description; /// Map description
+ char* MapTerrainName; /// Map terrain name
// FIXME: Map Terrain Nr. should be removed.
- int MapTerrain;
/// Map terrain
- int MapWidth;
/// Map width
- int MapHeight;
/// Map height
- int PlayerType[PlayerMax]; ///
Same player->Type
- int PlayerSide[PlayerMax]; ///
Same player->Side
- int PlayerResources[PlayerMax][MaxCosts];
/// Same player->Gold
- int PlayerAi[PlayerMax]; ///
Same player->Ai
- unsigned int MapUID; /// Unique Map ID (hash)
+ int MapTerrain; /// Map terrain
+ int MapWidth; /// Map width
+ int MapHeight; /// Map height
+ int PlayerType[PlayerMax]; /// Same player->Type
+ int PlayerSide[PlayerMax]; /// Same player->Side
+ int PlayerResources[PlayerMax][MaxCosts]; /// Same player->Gold
+ int PlayerAi[PlayerMax]; /// Same player->Ai
+ unsigned int MapUID; /// Unique Map ID (hash)
} MapInfo;
/*----------------------------------------------------------------------------
--- Map itself
+-- Map itself
----------------------------------------------------------------------------*/
/// Describes the wold map
typedef struct _world_map_ {
- int Width;
/// the map width
- int Height;
/// the map height
+ int Width; /// the map width
+ int Height; /// the map height
- MapField* Fields;
/// fields on map
- unsigned* Visible[PlayerMax]; /// visible
bit-field
+ MapField* Fields; /// fields on map
+ unsigned* Visible[PlayerMax]; /// visible bit-field
- unsigned char NoFogOfWar; /// fog of war disabled
+ unsigned char NoFogOfWar; /// fog of war disabled
- char* TerrainName; /// terrain as
name
+ char* TerrainName; /// terrain as name
// FIXME: terrain nr. should be removed?
- int Terrain;
/// terrain type (summer,winter,...)
- Tileset* Tileset; ///
tileset data
+ int Terrain; /// terrain type (summer,winter,...)
+ Tileset* Tileset; /// tileset data
#ifdef USE_SDL_SURFACE
- unsigned int TileCount; /// how many tiles,
-
/// == TileGraphic->NFrames
- Graphic* TileGraphic; ///
graphic for all the tiles
+ unsigned int TileCount; /// how many tiles,
+ /// == TileGraphic->NFrames
+ Graphic* TileGraphic; /// graphic for all the tiles
#else
- unsigned TileCount; /// how
many tiles are available
- unsigned char** Tiles; /// pointer to
tile data
- Graphic* TileData; ///
tiles graphic for map
+ unsigned TileCount; /// how many tiles are available
+ unsigned char** Tiles; /// pointer to tile data
+ Graphic* TileData; /// tiles graphic for map
#endif
- char Description[32];/// map description
short
+ char Description[32];/// map description short
- MapInfo* Info;
/// descriptive information (FIXME: DUPLICATES!)
+ MapInfo* Info; /// descriptive information (FIXME: DUPLICATES!)
} WorldMap;
/*----------------------------------------------------------------------------
--- Variables
+-- Variables
----------------------------------------------------------------------------*/
-extern WorldMap TheMap; /// The
current map
+extern WorldMap TheMap; /// The current map
-extern char MustRedrawRow[MAXMAP_W]; /// Flags must
redraw map row
-extern char MustRedrawTile[MAXMAP_W*MAXMAP_H]; /// Flags must redraw
tile
+extern char MustRedrawRow[MAXMAP_W]; /// Flags must redraw map row
+extern char MustRedrawTile[MAXMAP_W*MAXMAP_H]; /// Flags must redraw tile
/// Fast draw tile, display and video mode independ
#ifdef USE_SDL_SURFACE
-extern void VideoDrawTile(const int,int,int);
+extern void VideoDrawTile(const int, int, int);
#else
-extern void (*VideoDrawTile)(const unsigned char*,int,int);
+extern void (*VideoDrawTile)(const unsigned char*, int, int);
#endif
/// Draws tiles display and video mode independ
#ifdef USE_SDL_SURFACE
-extern void MapDrawTile(int,int,int);
+extern void MapDrawTile(int, int, int);
#else
-extern void (*MapDrawTile)(int,int,int);
+extern void (*MapDrawTile)(int, int, int);
#endif
/// Vision Table to see where to locate goals and vision
extern unsigned char *VisionTable[3];
@@ -381,18 +382,20 @@
extern int ReplayRevealMap;
/*----------------------------------------------------------------------------
--- Functions
+-- Functions
----------------------------------------------------------------------------*/
//
-// in map_draw.c
+// in map_draw.c
//
+#if 0
/// Fast draw 32x32 tile for 32 bpp video modes
-//extern void VideoDraw32Tile32(const unsigned char* data,int x,int y);
+extern void VideoDraw32Tile32(const unsigned char* data,int x,int y);
/// Fast draw 32x32 tile for 16 bpp video modes
-//extern void VideoDraw16Tile32(const unsigned char* data,int x,int y);
+extern void VideoDraw16Tile32(const unsigned char* data,int x,int y);
/// Fast draw 32x32 tile for 8 bpp video modes
-//extern void VideoDraw8Tile32(const unsigned char* data,int x,int y);
+extern void VideoDraw8Tile32(const unsigned char* data,int x,int y);
+#endif
/// Called when the color cycles
extern void MapColorCycle(void);
@@ -405,34 +408,34 @@
/// Mark position inside screenmap be drawn for next display update
extern int MarkDrawPosMap(int x, int y );
/// Denote wether area in map is overlapping with viewport on screen
-extern int MapAreaVisibleInViewport(const Viewport*, int , int , int , int );
+extern int MapAreaVisibleInViewport(const Viewport*, int , int , int , int);
/// Check if any part of an area is visible in viewport
-extern int AnyMapAreaVisibleInViewport(const Viewport*, int , int , int , int
);
+extern int AnyMapAreaVisibleInViewport(const Viewport*, int , int , int , int);
/// Set overlapping area as entries in MustRedrawRow and MustRedrawTile
-extern int MarkDrawAreaMap( int sx, int sy, int ex, int ey );
+extern int MarkDrawAreaMap(int sx, int sy, int ex, int ey);
/// Set all entries in MustRedrawRow and MustRedrawTile
extern void MarkDrawEntireMap(void);
//
-// in map_fog.c
+// in map_fog.c
//
/// Mark a tile for normal sight
-extern void MapMarkTileSight(const Player* player,int x,int y);
+extern void MapMarkTileSight(const Player* player, int x, int y);
/// Unmark a tile for normal sight
-extern void MapUnmarkTileSight(const Player* player,int x,int y);
+extern void MapUnmarkTileSight(const Player* player, int x, int y);
/// Mark Cloaked units on a tile as detected.
-extern void MapDetectUnitsOnTile(const Player* player,int x,int y);
+extern void MapDetectUnitsOnTile(const Player* player, int x, int y);
/// Mark sight changes
-extern void MapSight(const Player* player, int x, int y, int w, int h, int
range, void (*marker)(const Player*,int,int));
+extern void MapSight(const Player* player, int x, int y, int w, int h, int
range, void (*marker)(const Player*, int, int));
/// Find if a tile is visible (With shared vision)
extern unsigned char IsTileVisible(const Player* player, int x, int y);
/// Mark tiles with fog of war to be redrawn
-extern void MapUpdateFogOfWar(int x,int y);
- /// Update fog of war
+extern void MapUpdateFogOfWar(int x, int y);
+ /// Update fog of war
extern void UpdateFogOfWarChange(void);
/// Draw the map fog of war
-extern void DrawMapFogOfWar(const Viewport* vp,int x,int y);
+extern void DrawMapFogOfWar(const Viewport* vp, int x, int y);
/// Build tables for fog of war
extern void InitMapFogOfWar(void);
/// Cleanup memory for fog of war tables
@@ -443,15 +446,15 @@
extern void FreeVisionTable(void);
//
-// in map_wall.c
+// in map_wall.c
//
- /// Check if the seen tile-type is wall
+ /// Check if the seen tile-type is wall
extern int MapIsSeenTileWall(int x, int y,int walltype);
- /// Correct the seen wall field, depending on the
surrounding
+ /// Correct the seen wall field, depending on the surrounding
extern void MapFixSeenWallTile(int x, int y);
- /// Correct the surrounding seen wall fields
+ /// Correct the surrounding seen wall fields
extern void MapFixSeenWallNeighbors(int x, int y);
- /// Correct the real wall field, depending on the
surrounding
+ /// Correct the real wall field, depending on the surrounding
extern void MapFixWallTile(int x, int y);
/// Remove wall on tile
extern void MapRemoveWall(unsigned x,unsigned y);
@@ -459,46 +462,48 @@
extern void HitWall(unsigned x,unsigned y,unsigned damage);
//
-// in map_wood.c
+// in map_wood.c
//
- /// Check if the seen tile-type is wood
+ /// Check if the seen tile-type is wood
extern int MapIsSeenTileWood(int x, int y);
- /// Correct the seen wood field, depending on the
surrounding
+ /// Correct the seen wood field, depending on the surrounding
extern void MapFixSeenWoodTile(int x, int y);
- /// Correct the surrounding seen wood fields
+ /// Correct the surrounding seen wood fields
extern void MapFixSeenWoodNeighbors(int x, int y);
- /// Correct the real wood field, depending on the
surrounding
+ /// Correct the real wood field, depending on the surrounding
extern void MapFixWoodTile(int x, int y);
/// Remove wood from the map
-extern void MapRemoveWood(unsigned x,unsigned y);
+extern void MapRemoveWood(unsigned x, unsigned y);
/// Regenerate the forest
extern void RegenerateForest(void);
//
-// in map_rock.c
+// in map_rock.c
//
- /// Check if the seen tile-type is rock
+ /// Check if the seen tile-type is rock
extern int MapIsSeenTileRock(int x, int y);
- /// Correct the seen rock field, depending on the
surrounding
+ /// Correct the seen rock field, depending on the surrounding
extern void MapFixSeenRockTile(int x, int y);
- /// Correct the surrounding seen rock fields
+ /// Correct the surrounding seen rock fields
extern void MapFixSeenRockNeighbors(int x, int y);
- /// Correct the real rock field, depending on the
surrounding
+ /// Correct the real rock field, depending on the surrounding
extern void MapFixRockTile(int x, int y);
/// Remove rock from the map
extern void MapRemoveRock(unsigned x,unsigned y);
//
-// in ccl_map.c
+// in ccl_map.c
//
/// register ccl features
extern void MapCclRegister(void);
//
-// mixed sources
+// mixed sources
//
/// Load a map
-//extern void LoadMap(const char* file,WorldMap* map);
+#if 0
+extern void LoadMap(const char* file, WorldMap* map);
+#endif
/// Save the map
extern void SaveMap(CLFile* file);
/// Clean the map
@@ -508,58 +513,58 @@
extern void FreeMapInfo(MapInfo* info);
/// Mark a tile as seen by the player
-extern void MapMarkSeenTile(int x,int y);
+extern void MapMarkSeenTile(int x, int y);
/// Reveal the complete map, make everything known
extern void RevealMap(void);
/// Returns true, if the tile field is empty
-extern int IsMapFieldEmpty(int x,int y);
+extern int IsMapFieldEmpty(int x, int y);
/// Returns true, if water on the map tile field
-extern int WaterOnMap(int x,int y);
+extern int WaterOnMap(int x, int y);
/// Returns true, if coast on the map tile field
-extern int CoastOnMap(int x,int y);
+extern int CoastOnMap(int x, int y);
/// Returns true, if wall on the map tile field
-extern int WallOnMap(int x,int y);
+extern int WallOnMap(int x, int y);
/// Returns true, if human wall on the map tile field
-extern int HumanWallOnMap(int x,int y);
+extern int HumanWallOnMap(int x, int y);
/// Returns true, if orc wall on the map tile field
-extern int OrcWallOnMap(int x,int y);
+extern int OrcWallOnMap(int x, int y);
/// Returns true, if forest on the map tile field with bounds check
-extern int CheckedForestOnMap(int x,int y);
+extern int CheckedForestOnMap(int x, int y);
/// Returns true, if forest on the map tile field
-extern int ForestOnMap(int x,int y);
+extern int ForestOnMap(int x, int y);
/// Returns true, if rock on the map tile field
-extern int RockOnMap(int x,int y);
+extern int RockOnMap(int x, int y);
#ifdef HIERARCHIC_PATHFINDER
/// FIXME: docu
-extern inline unsigned short MapFieldGetRegId(int , int );
+extern inline unsigned short MapFieldGetRegId(int, int);
/// FIXME: docu
-extern inline void MapFieldSetRegId(int , int , unsigned short );
+extern inline void MapFieldSetRegId(int, int, unsigned short);
/// FIXME: docu
-extern inline int MapFieldPassable(int , int , int );
+extern inline int MapFieldPassable(int, int, int);
#endif
/// Returns true, if the unit-type(mask can enter field with bounds
check
-extern int CheckedCanMoveToMask(int x,int y,int mask);
+extern int CheckedCanMoveToMask(int x, int y, int mask);
/// Returns true, if the unit-type(mask) can enter the field
-extern int CanMoveToMask(int x,int y,int mask);
+extern int CanMoveToMask(int x, int y, int mask);
/// Returns true, if the unit-type can enter the field
-extern int UnitTypeCanMoveTo(int x,int y,const UnitType* type);
+extern int UnitTypeCanMoveTo(int x, int y, const UnitType* type);
/// Returns true, if the unit can enter the field
-extern int UnitCanMoveTo(int x,int y,const Unit* unit);
+extern int UnitCanMoveTo(int x, int y, const Unit* unit);
/// Preprocess map, for internal use.
extern void PreprocessMap(void);
/// Set wall on field
-extern void MapSetWall(unsigned x,unsigned y,int humanwall);
+extern void MapSetWall(unsigned x, unsigned y, int humanwall);
/*----------------------------------------------------------------------------
--- Defines
+-- Defines
----------------------------------------------------------------------------*/
/// Tile number of the tile drawn for unexplored space
@@ -570,17 +575,17 @@
!(TheMap.Fields[(x)+(y)*TheMap.Width].Flags&(mask))
#define MapDetectCloakedUnits(unit)
MapSight((unit)->Player,(unit)->X,(unit)->Y, \
-
(unit)->Type->TileWidth,(unit)->Type->TileHeight,(unit)->CurrentSightRange,MapDetectUnitsOnTile)
+
(unit)->Type->TileWidth,(unit)->Type->TileHeight,(unit)->CurrentSightRange,MapDetectUnitsOnTile)
#define MapMarkSight(player,x,y,w,h,range)
MapSight((player),(x),(y),(w),(h),(range),MapMarkTileSight)
#define MapUnmarkSight(player,x,y,w,h,range)
MapSight((player),(x),(y),(w),(h),(range),MapUnmarkTileSight)
#define MapMarkUnitSight(unit) MapSight((unit)->Player,(unit)->X,(unit)->Y, \
-
(unit)->Type->TileWidth,(unit)->Type->TileHeight,(unit)->CurrentSightRange,MapMarkTileSight)
+
(unit)->Type->TileWidth,(unit)->Type->TileHeight,(unit)->CurrentSightRange,MapMarkTileSight)
#define MapUnmarkUnitSight(unit) MapSight((unit)->Player,(unit)->X,(unit)->Y, \
-
(unit)->Type->TileWidth,(unit)->Type->TileHeight,(unit)->CurrentSightRange,MapUnmarkTileSight)
+
(unit)->Type->TileWidth,(unit)->Type->TileHeight,(unit)->CurrentSightRange,MapUnmarkTileSight)
#define MapMarkUnitOnBoardSight(unit,host)
MapSight((unit)->Player,(host)->X,(host)->Y, \
-
(host)->Type->TileWidth,(host)->Type->TileHeight,(unit)->CurrentSightRange,MapMarkTileSight)
+
(host)->Type->TileWidth,(host)->Type->TileHeight,(unit)->CurrentSightRange,MapMarkTileSight)
#define MapUnmarkUnitOnBoardSight(unit,host)
MapSight((unit)->Player,(host)->X,(host)->Y, \
-
(host)->Type->TileWidth,(host)->Type->TileHeight,(unit)->CurrentSightRange,MapUnmarkTileSight)
+
(host)->Type->TileWidth,(host)->Type->TileHeight,(unit)->CurrentSightRange,MapUnmarkTileSight)
/// Check if a field for the user is explored
#define IsMapFieldExplored(player,x,y) \
(IsTileVisible((player),(x),(y)))
@@ -591,15 +596,15 @@
#ifdef UNITS_ON_MAP
/// Is there a building on this field
-#define BuildingOnMapField(mf) ((mf)->Building != 0xffff)
+#define BuildingOnMapField(mf) ((mf)->Building != 0xffff)
/// Is there a land unit on this field
-#define LandUnitOnMapField(mf) ((mf)->LandUnit != 0xffff)
+#define LandUnitOnMapField(mf) ((mf)->LandUnit != 0xffff)
/// Is there a sea unit on this field
-#define SeaUnitOnMapField(mf) ((mf)->SeaUnit != 0xffff)
+#define SeaUnitOnMapField(mf) ((mf)->SeaUnit != 0xffff)
/// Is there an air unit on this field
-#define AirUnitOnMapField(mf) ((mf)->AirUnit != 0xffff)
+#define AirUnitOnMapField(mf) ((mf)->AirUnit != 0xffff)
#endif // UNITS_ON_MAP
//@}
-#endif // !__MAP_H__
+#endif // !__MAP_H__
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src/include interface.h iocompat.h io...,
address@hidden <=