Introduce unit uTypes in order to remove some cyclic unit dependencies
authorunC0Rr
Wed, 17 Nov 2010 17:22:36 +0300
changeset 4357 a1fcfc341a52
parent 4355 4554c4df9f1a
child 4359 83ef50815535
Introduce unit uTypes in order to remove some cyclic unit dependencies
hedgewars/CMakeLists.txt
hedgewars/hwengine.pas
hedgewars/uAI.pas
hedgewars/uAIActions.pas
hedgewars/uAIAmmoTests.pas
hedgewars/uAIMisc.pas
hedgewars/uAmmos.pas
hedgewars/uChat.pas
hedgewars/uCollisions.pas
hedgewars/uConsole.pas
hedgewars/uConsts.pas
hedgewars/uGame.pas
hedgewars/uGears.pas
hedgewars/uIO.pas
hedgewars/uLand.pas
hedgewars/uLandGraphics.pas
hedgewars/uLandObjects.pas
hedgewars/uLandTexture.pas
hedgewars/uMisc.pas
hedgewars/uScript.pas
hedgewars/uSound.pas
hedgewars/uStats.pas
hedgewars/uStore.pas
hedgewars/uTeams.pas
hedgewars/uTypes.pas
hedgewars/uVisualGears.pas
hedgewars/uWorld.pas
--- a/hedgewars/CMakeLists.txt	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/CMakeLists.txt	Wed Nov 17 17:22:36 2010 +0300
@@ -11,24 +11,24 @@
 #if the headers are not installed, the newer apis won't be activated
 find_file(sdlmixer_h SDL_mixer.h ${SDLMIXER_INCLUDE_DIR})
 if(sdlmixer_h)
-	file(STRINGS ${sdlmixer_h} sdlmixer_version_tmp REGEX "SDL_MIXER_PATCHLEVEL[\t' ']+[0-9]+")
-	string(REGEX MATCH ".([0-9]+)" sdlmixer_version "${sdlmixer_version_tmp}")
+    file(STRINGS ${sdlmixer_h} sdlmixer_version_tmp REGEX "SDL_MIXER_PATCHLEVEL[\t' ']+[0-9]+")
+    string(REGEX MATCH ".([0-9]+)" sdlmixer_version "${sdlmixer_version_tmp}")
 
-	if(sdlmixer_version GREATER 9)
-		message(STATUS "Enabling enhanced SDL_Mixer calls")
-		set(pascal_compiler_flags_cmn "-dSDL_MIXER_NEWER" ${pascal_compiler_flags_cmn})
-	endif()
+    if(sdlmixer_version GREATER 9)
+        message(STATUS "Enabling enhanced SDL_Mixer calls")
+        set(pascal_compiler_flags_cmn "-dSDL_MIXER_NEWER" ${pascal_compiler_flags_cmn})
+    endif()
 endif()
 
 find_file(sdlimage_h SDL_image.h ${SDLIMAGE_INCLUDE_DIR})
 if(sdlimage_h)
-	file(STRINGS ${sdlimage_h} sdlimage_version_tmp REGEX "SDL_IMAGE_PATCHLEVEL[\t' ']+[0-9]+")
-	string(REGEX MATCH ".([0-9]+)" sdlimage_version "${sdlimage_version_tmp}")
+    file(STRINGS ${sdlimage_h} sdlimage_version_tmp REGEX "SDL_IMAGE_PATCHLEVEL[\t' ']+[0-9]+")
+    string(REGEX MATCH ".([0-9]+)" sdlimage_version "${sdlimage_version_tmp}")
 
-	if(sdlimage_version GREATER 7)
-		message(STATUS "Enabling enhanced SDL_Image calls")
-		set(pascal_compiler_flags_cmn "-dSDL_IMAGE_NEWER" ${pascal_compiler_flags_cmn})
-	endif()
+    if(sdlimage_version GREATER 7)
+        message(STATUS "Enabling enhanced SDL_Image calls")
+        set(pascal_compiler_flags_cmn "-dSDL_IMAGE_NEWER" ${pascal_compiler_flags_cmn})
+    endif()
 endif()
 
 #SOURCE AND PROGRAMS SECTION
@@ -36,86 +36,87 @@
 set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwengine.pas)
 
 set(engine_sources
-	${hwengine_project}
-	SDLh.pas
-	uAI.pas
-	uAIActions.pas
-	uAIAmmoTests.pas
-	uAIMisc.pas
-	uAmmos.pas
-	uChat.pas
-	uCollisions.pas
-	uConsole.pas
-	uConsts.pas
-	uFloat.pas
-	uGame.pas
-	uGears.pas
-	uIO.pas
-	uKeys.pas
-	uLand.pas
-	uLandGraphics.pas
-	uLandObjects.pas
-	uLandTemplates.pas
-	uLandTexture.pas
-	uLocale.pas
-	uMisc.pas
-	uMobile.pas
-	uRandom.pas
-	uScript.pas
-	adler32.pas
-	uSound.pas
-	uStats.pas
-	uStore.pas
-	uTeams.pas
-	uVisualGears.pas
-	uWorld.pas
-	CCHandlers.inc
-	GSHandlers.inc
-	VGSHandlers.inc
-	GearDrawing.inc
-	HHHandlers.inc
-	SinTable.inc
-	ArgParsers.inc
-	options.inc
-	${CMAKE_CURRENT_BINARY_DIR}/config.inc
-	)
+    ${hwengine_project}
+    SDLh.pas
+    uAI.pas
+    uAIActions.pas
+    uAIAmmoTests.pas
+    uAIMisc.pas
+    uAmmos.pas
+    uChat.pas
+    uCollisions.pas
+    uConsole.pas
+    uConsts.pas
+    uFloat.pas
+    uGame.pas
+    uGears.pas
+    uIO.pas
+    uKeys.pas
+    uLand.pas
+    uLandGraphics.pas
+    uLandObjects.pas
+    uLandTemplates.pas
+    uLandTexture.pas
+    uLocale.pas
+    uMisc.pas
+    uMobile.pas
+    uRandom.pas
+    uScript.pas
+    adler32.pas
+    uSound.pas
+    uStats.pas
+    uStore.pas
+    uTeams.pas
+    uTypes.pas
+    uVisualGears.pas
+    uWorld.pas
+    CCHandlers.inc
+    GSHandlers.inc
+    VGSHandlers.inc
+    GearDrawing.inc
+    HHHandlers.inc
+    SinTable.inc
+    ArgParsers.inc
+    options.inc
+    ${CMAKE_CURRENT_BINARY_DIR}/config.inc
+    )
 
 if(BUILD_ENGINE_LIBRARY)
-	message(STATUS "Engine will be built as library (experimental)")
-	set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwLibrary.pas)
-	set(engine_sources ${hwengine_project} PascalExports.pas ${engine_sources})
-	set(pascal_compiler_flags_cmn "-dHWLIBRARY" "-k-no_order_inits" "-fPIC" ${pascal_compiler_flags_cmn})
+    message(STATUS "Engine will be built as library (experimental)")
+    set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwLibrary.pas)
+    set(engine_sources ${hwengine_project} PascalExports.pas ${engine_sources})
+    set(pascal_compiler_flags_cmn "-dHWLIBRARY" "-k-no_order_inits" "-fPIC" ${pascal_compiler_flags_cmn})
 endif(BUILD_ENGINE_LIBRARY)
 
 
 find_program(fpc_executable ${fpc_tryexe})
 
 if(fpc_executable)
-	 exec_program(${fpc_executable} ARGS "-iV" OUTPUT_VARIABLE fpc_output)
+    exec_program(${fpc_executable} ARGS "-iV" OUTPUT_VARIABLE fpc_output)
 endif(fpc_executable)
 
 set(noexecstack_flags "-k-z" "-knoexecstack")
 file(WRITE ${EXECUTABLE_OUTPUT_PATH}/checkstack.pas "begin end.")
 
 exec_program(${fpc_executable} ${EXECUTABLE_OUTPUT_PATH}
-	ARGS ${noexecstack_flags} checkstack.pas
-	OUTPUT_VARIABLE noout
-	RETURN_VALUE testnoexecstack
-	)
+    ARGS ${noexecstack_flags} checkstack.pas
+    OUTPUT_VARIABLE noout
+    RETURN_VALUE testnoexecstack
+    )
 
 if(${testnoexecstack})
-	set (noexecstack_flags "")
+    set (noexecstack_flags "")
 endif(${testnoexecstack})
 
 
 if(APPLE)
-	string(REGEX MATCH "[pP][pP][cC]+" powerpc_build "${CMAKE_OSX_ARCHITECTURES}")
-	string(REGEX MATCH "[iI]386+" i386_build "${CMAKE_OSX_ARCHITECTURES}")
-	string(REGEX MATCH "[xX]86_64+" x86_64_build "${CMAKE_OSX_ARCHITECTURES}")
+    string(REGEX MATCH "[pP][pP][cC]+" powerpc_build "${CMAKE_OSX_ARCHITECTURES}")
+    string(REGEX MATCH "[iI]386+" i386_build "${CMAKE_OSX_ARCHITECTURES}")
+    string(REGEX MATCH "[xX]86_64+" x86_64_build "${CMAKE_OSX_ARCHITECTURES}")
 
-	if(powerpc_build)
-		set(powerpc_build "powerpc")
-	endif()
+    if(powerpc_build)
+        set(powerpc_build "powerpc")
+    endif()
 endif(APPLE)
 
 
@@ -123,19 +124,19 @@
 string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" fpc_version "${fpc_output}")
 
 if(fpc_version)
-	string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" fpc_vers_major "${fpc_version}")
-	string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}")
-	string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}")
-	message(STATUS "Freepascal version detected: ${fpc_vers_major}.${fpc_vers_minor}")
-	math(EXPR fpc_ver "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}")
+    string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" fpc_vers_major "${fpc_version}")
+    string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}")
+    string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}")
+    message(STATUS "Freepascal version detected: ${fpc_vers_major}.${fpc_vers_minor}")
+    math(EXPR fpc_ver "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}")
 
-	if(fpc_ver LESS "020200")
-		message(FATAL_ERROR "Minimum required version of FreePascal is 2.2.0")
-	elseif(APPLE AND x86_64_build AND fpc_ver LESS "020400")
-		message(FATAL_ERROR "Minimum required version of FreePascal is 2.4.0 for building 64 bit applications!")
-	endif()
+    if(fpc_ver LESS "020200")
+        message(FATAL_ERROR "Minimum required version of FreePascal is 2.2.0")
+    elseif(APPLE AND x86_64_build AND fpc_ver LESS "020400")
+        message(FATAL_ERROR "Minimum required version of FreePascal is 2.4.0 for building 64 bit applications!")
+    endif()
 else()
-	message(FATAL_ERROR "No Pascal compiler found!")
+    message(FATAL_ERROR "No Pascal compiler found!")
 endif()
 
 set(pascal_compiler ${fpc_executable})
@@ -144,40 +145,40 @@
 
 #DEPENDECIES AND EXECUTABLES SECTION
 IF(NOT APPLE OR BUILD_ENGINE_LIBRARY)
-	#here is the command for standard executables or for shared library
-	add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}"
-		COMMAND "${pascal_compiler}"
-		ARGS ${pascal_compiler_flags}
-		MAIN_DEPENDENCY ${hwengine_project}
-		DEPENDS ${engine_sources}
-		)
+    #here is the command for standard executables or for shared library
+    add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}"
+        COMMAND "${pascal_compiler}"
+        ARGS ${pascal_compiler_flags}
+        MAIN_DEPENDENCY ${hwengine_project}
+        DEPENDS ${engine_sources}
+        )
 ELSE()
-	#let's build sdlmain, which is absent from the framework
-	find_package(SDL REQUIRED)
+    #let's build sdlmain, which is absent from the framework
+    find_package(SDL REQUIRED)
 
-	set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
-	include_directories(${SDL_INCLUDE_DIR})
+    set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
+    include_directories(${SDL_INCLUDE_DIR})
 
-	add_library (SDLmain STATIC SDLMain.m)
+    add_library (SDLmain STATIC SDLMain.m)
 
 
-	#these are the dependencies for building a universal binary on Mac OS X
-	foreach (build_arch ${powerpc_build} ${i386_build} ${x86_64_build})
-		set(lipo_args_list "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}" ${lipo_args_list})
-		add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}"
-			COMMAND "${pascal_compiler}"
-			ARGS ${pascal_compiler_flags} -ohwengine.${build_arch} -P${build_arch}
-			MAIN_DEPENDENCY ${hwengine_project}
-			DEPENDS ${engine_sources} SDLmain lua
-			)
-		add_custom_target(hwengine.${build_arch} ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}")
-	endforeach()
+    #these are the dependencies for building a universal binary on Mac OS X
+    foreach (build_arch ${powerpc_build} ${i386_build} ${x86_64_build})
+        set(lipo_args_list "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}" ${lipo_args_list})
+        add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}"
+            COMMAND "${pascal_compiler}"
+            ARGS ${pascal_compiler_flags} -ohwengine.${build_arch} -P${build_arch}
+            MAIN_DEPENDENCY ${hwengine_project}
+            DEPENDS ${engine_sources} SDLmain lua
+            )
+        add_custom_target(hwengine.${build_arch} ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}")
+    endforeach()
 
-	add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine"
-		COMMAND "lipo"
-		ARGS ${lipo_args_list} -create -output ${EXECUTABLE_OUTPUT_PATH}/hwengine
-		DEPENDS ${lipo_args_list}
-		)
+    add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine"
+        COMMAND "lipo"
+        ARGS ${lipo_args_list} -create -output ${EXECUTABLE_OUTPUT_PATH}/hwengine
+        DEPENDS ${lipo_args_list}
+        )
 ENDIF()
 
 
--- a/hedgewars/hwengine.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/hwengine.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -30,7 +30,8 @@
 {$ENDIF}
 
 uses SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uKeys, uSound,
-     uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uRandom, uLandTexture, uCollisions, uMobile, sysutils;
+     uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uRandom, uLandTexture, uCollisions, uMobile,
+    sysutils, uTypes;
 
 var isTerminated: boolean = false;
     alsoShutdownFrontend: boolean = false;
--- a/hedgewars/uAI.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uAI.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -29,8 +29,8 @@
 procedure FreeActionsList;
 
 implementation
-uses uTeams, uConsts, SDLh, uAIMisc, uGears, uAIAmmoTests, uAIActions, uMisc,
-     uAmmos, uConsole, SysUtils{$IFDEF UNIX}, cthreads{$ENDIF};
+uses uTeams, uConsts, SDLh, uAIMisc, uAIAmmoTests, uAIActions, uMisc,
+     uAmmos, uConsole, SysUtils{$IFDEF UNIX}, cthreads{$ENDIF}, uTypes;
 
 var BestActions: TActions;
     CanUseAmmo: array [TAmmoType] of boolean;
--- a/hedgewars/uAIActions.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uAIActions.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,7 +20,7 @@
 
 unit uAIActions;
 interface
-uses uGears, uFloat;
+uses uFloat, uTypes;
 
 const MAXACTIONS     = 96;
       aia_none       = 0;
@@ -62,7 +62,7 @@
 procedure ProcessAction(var Actions: TActions; Me: PGear);
 
 implementation
-uses uMisc, uConsts, uConsole, uAIMisc, uAI, uAmmos;
+uses uMisc, uConsole, uAIMisc, uAI, uAmmos;
 
 const ActionIdToStr: array[0..6] of string[16] = (
 {aia_none}           '',
--- a/hedgewars/uAIAmmoTests.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uAIAmmoTests.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,7 +20,7 @@
 
 unit uAIAmmoTests;
 interface
-uses SDLh, uGears, uConsts, uFloat;
+uses SDLh, uConsts, uFloat, uTypes;
 const amtest_OnTurn = $00000001;
 
 type TAttackParams = record
--- a/hedgewars/uAIMisc.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uAIMisc.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,7 +20,7 @@
 
 unit uAIMisc;
 interface
-uses SDLh, uConsts, uGears, uFloat;
+uses SDLh, uConsts, uGears, uFloat, uTypes;
 
 const MAXBONUS = 1024;
 
--- a/hedgewars/uAmmos.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uAmmos.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,7 +20,7 @@
 
 unit uAmmos;
 interface
-uses uConsts, uTeams;
+uses uConsts, uTeams, uTypes;
 
 procedure initModule;
 procedure freeModule;
--- a/hedgewars/uChat.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uChat.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -34,7 +34,7 @@
     showAll: boolean;
 
 implementation
-uses uMisc, uStore, uConsts, SDLh, uConsole, uKeys, uTeams;
+uses uMisc, uStore, uConsts, SDLh, uConsole, uKeys, uTeams, uTypes;
 
 const MaxStrIndex = 27;
 
--- a/hedgewars/uCollisions.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uCollisions.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,7 +20,7 @@
 
 unit uCollisions;
 interface
-uses uGears, uFloat;
+uses uFloat, uTypes;
 
 const cMaxGearArrayInd = 255;
 
--- a/hedgewars/uConsole.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uConsole.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -38,7 +38,7 @@
 
 implementation
 uses uMisc, uStore, Types, uConsts, uGears, uTeams, uIO, uKeys, uWorld, uMobile,
-     uRandom, uAmmos, uStats, uChat, SDLh, uSound, uVisualGears, uScript;
+     uRandom, uAmmos, uStats, uChat, SDLh, uSound, uVisualGears, uScript, uTypes;
 
 const cLineWidth: LongInt = 0;
       cLinesCount = 256;
--- a/hedgewars/uConsts.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uConsts.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -21,7 +21,7 @@
 unit uConsts;
 interface
 
-uses    SDLh, uFloat, uLocale, GLunit;
+uses    SDLh, uFloat, uLocale, GLunit, uTypes;
 
 
 {$INCLUDE "config.inc"}
@@ -29,170 +29,6 @@
 // typed const is a variable despite const qualifier
 // in freepascal you may actually use var for the same purpose
 
-type
-    HwColor4f = record
-        r, g, b, a: byte
-        end;
-
-    TGameState = (gsLandGen, gsStart, gsGame, gsChat, gsConfirm, gsExit);
-
-    TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtSyntax);
-
-    TPathType = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptTeams, ptMaps,
-            ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts,
-            ptLocale, ptAmmoMenu, ptHedgehog, ptVoices, ptHats, ptFlags, ptMissionMaps);
-
-    TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprFrame,
-            sprLag, sprArrow, sprBazookaShell, sprTargetP, sprBee,
-            sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff,
-            sprMineOn, sprMineDead, sprCase, sprFAid, sprDynamite, sprPower,
-            sprClusterBomb, sprClusterParticle, sprFlame, sprHorizont,
-            sprHorizontL, sprHorizontR, sprSky, sprSkyL,
-            sprSkyR, sprAMBorderHorizontal, sprAMBorderVertical, sprAMSlot, sprAMAmmos,
-            sprAMSlotKeys, sprAMCorners, sprFinger, sprAirBomb,
-            sprAirplane, sprAmAirplane, sprAmGirder, sprHHTelepMask,
-            sprSwitch, sprParachute, sprTarget, sprRopeNode,
-            sprQuestion, sprPowerBar, sprWindBar, sprWindL, sprWindR,
-            sprFlake, sprHandRope, sprHandBazooka, sprHandShotgun,
-            sprHandDEagle, sprHandAirAttack, sprHandBaseball, sprPHammer,
-            sprHandBlowTorch, sprBlowTorch, sprTeleport, sprHHDeath,
-            sprShotgun, sprDEagle, sprHHIdle, sprMortar, sprTurnsLeft,
-            sprKamikaze, sprWhip, sprKowtow, sprSad, sprWave,
-            sprHurrah, sprLemonade, sprShrug, sprJuggle, sprExplPart, sprExplPart2,
-            sprCakeWalk, sprCakeDown, sprAMAmmosBW, sprWatermelon,
-            sprEvilTrace, sprHellishBomb, sprSeduction, sprDress,
-            sprCensored, sprDrill, sprHandDrill, sprHandBallgun, sprBalls,
-            sprPlane, sprHandPlane, sprUtility, sprInvulnerable, sprVampiric, sprGirder,
-            sprSpeechCorner, sprSpeechEdge, sprSpeechTail,
-            sprThoughtCorner, sprThoughtEdge, sprThoughtTail,
-            sprShoutCorner, sprShoutEdge, sprShoutTail,
-            sprSniperRifle, sprBubbles, sprJetpack, sprHealth, sprHandMolotov, sprMolotov,
-            sprSmoke, sprSmokeWhite, sprShell, sprDust, sprExplosives, sprExplosivesRoll,
-            sprAmTeleport, sprSplash, sprDroplet, sprBirdy, sprHandCake, sprHandConstruction,
-            sprHandGrenade, sprHandMelon, sprHandMortar, sprHandSkip, sprHandCluster,
-            sprHandDynamite, sprHandHellish, sprHandMine, sprHandSeduction, sprHandVamp,
-            sprBigExplosion, sprSmokeRing, sprBeeTrace, sprEgg, sprTargetBee, sprHandBee,
-            sprFeather, sprPiano, sprHandSineGun, sprPortalGun, sprPortal,
-            sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk, sprNote,
-            sprSMineOff, sprSMineOn, sprHandSMine, sprHammer,
-            sprHandResurrector, sprCross, sprAirDrill, sprNapalmBomb,
-            sprBulletHit
-            );
-
-    // Gears that interact with other Gears and/or Land
-    TGearType = (gtBomb, gtHedgehog, gtShell, gtGrave, gtBee, // 4
-            gtShotgunShot, gtPickHammer, gtRope, gtMine, gtCase, // 9
-            gtDEagleShot, gtDynamite, gtClusterBomb, gtCluster, gtShover, // 14
-            gtFlame, gtFirePunch, gtATStartGame, gtATSmoothWindCh, // 18
-            gtATFinishGame, gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, // 23
-            gtGirder, gtTeleport, gtSwitcher, gtTarget, gtMortar, // 28
-            gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 34
-            gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 40
-            gtSniperRifleShot, gtJetpack, gtMolotov, gtExplosives, gtBirdy, // 45
-            gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 51
-            gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector, // 56
-            gtNapalmBomb); // 57
-
-    // Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.)
-    TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
-            vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble,
-            vgtSteam, vgtAmmo, vgtSmoke, vgtSmokeWhite, vgtHealth, vgtShell,
-            vgtDust, vgtSplash, vgtDroplet, vgtSmokeRing, vgtBeeTrace, vgtEgg,
-            vgtFeather, vgtHealthTag, vgtSmokeTrace, vgtEvilTrace, vgtExplosion,
-            vgtBigExplosion, vgtChunk, vgtNote, vgtLineTrail,
-            vgtBulletHit);
-
-    TGearsType = set of TGearType;
-
-    TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison);
-
-    TSound = (sndNone,
-            sndGrenadeImpact, sndExplosion, sndThrowPowerUp, sndThrowRelease,
-            sndSplash, sndShotgunReload, sndShotgunFire, sndGraveImpact,
-            sndMineTick, sndPickhammer, sndGun, sndBee, sndJump1, sndJump2,
-            sndJump3, sndYesSir, sndLaugh, sndIllGetYou, sndIncoming,
-            sndMissed, sndStupid, sndFirstBlood, sndBoring, sndByeBye,
-            sndSameTeam, sndNutter, sndReinforce, sndTraitor, sndRegret,
-            sndEnemyDown, sndCoward, sndHurry, sndWatchIt, sndKamikaze,
-            sndCake, sndOw1, sndOw2, sndOw3, sndOw4, sndFirePunch1, sndFirePunch2,
-            sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6,
-            sndMelon, sndHellish, sndYoohoo, sndRCPlane, sndWhipCrack,
-            sndRideOfTheValkyries, sndDenied, sndPlaced, sndBaseballBat,
-            sndVaporize, sndWarp, sndSuddenDeath, sndMortar, sndShutter,
-            sndHomerun, sndMolotov, sndCover, sndUhOh, sndOops,
-            sndNooo, sndHello, sndRopeShot, sndRopeAttach, sndRopeRelease,
-            sndSwitchHog, sndVictory, sndSniperReload, sndSteps, sndLowGravity,
-            sndHellishImpact1, sndHellishImpact2, sndHellishImpact3, sndHellishImpact4,
-            sndMelonImpact, sndDroplet1, sndDroplet2, sndDroplet3, sndEggBreak, sndDrillRocket,
-            sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater,
-            sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, sndPiano8,
-            sndSkip, sndSineGun, sndOoff1, sndOoff2, sndOoff3, sndWhack,
-            sndComeonthen, sndParachute, sndBump, sndResurrector);
-
-    TAmmoType  = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6
-            amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip, // 13
-            amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch, // 18
-            amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake, // 24
-            amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill, amBallgun, // 30
-            amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35
-            amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42
-            amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48
-            amResurrector, amDrillStrike);
-
-    TCrateType = (HealthCrate, AmmoCrate, UtilityCrate);
-
-    THWFont = (fnt16, fntBig, fntSmall {$IFNDEF IPHONEOS}, CJKfnt16, CJKfntBig, CJKfntSmall{$ENDIF});
-
-    TCapGroup = (capgrpGameState, capgrpAmmoinfo, capgrpVolume,
-            capgrpMessage, capgrpAmmostate);
-
-    TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs,
-            siClanHealth, siTeamStats, siPlayerKills, siMaxTeamDamage,
-            siMaxTeamKills, siMaxTurnSkips );
-
-    TWave = (waveRollup, waveSad, waveWave, waveHurrah, waveLemonade, waveShrug, waveJuggle);
-
-    THHFont = record
-            Handle: PTTF_Font;
-            Height: LongInt;
-            style: LongInt;
-            Name: string[21];
-            end;
-
-    PAmmo = ^TAmmo;
-    TAmmo = record
-            Propz: LongWord;
-            Count: LongWord;
-(* Using for place hedgehogs mode, but for any other situation where the initial count would be needed I guess.
-For example, say, a mode where the weaponset is reset each turn, or on sudden death *)
-            NumPerTurn: LongWord;
-            Timer: LongWord;
-            Pos: LongWord;
-            AmmoType: TAmmoType;
-            AttackVoice: TSound;
-            end;
-
-    TVertex2f = record
-        X, Y: GLfloat;
-        end;
-
-    TVertex2i = record
-        X, Y: GLint;
-        end;
-
-    PTexture = ^TTexture;
-    TTexture = record
-            id: GLuint;
-            w, h, scale: LongInt;
-            rx, ry: GLfloat;
-            priority: GLfloat;
-            vb, tb: array [0..3] of TVertex2f;
-            PrevTexture, NextTexture: PTexture;
-            end;
-
-    THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected);
-
-    TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite);
 const
     sfMax = 1000;
     cDefaultParamNum = 16;
--- a/hedgewars/uGame.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uGame.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -26,7 +26,7 @@
 ////////////////////
    implementation
 ////////////////////
-uses uMisc, uConsts, uKeys, uTeams, uIO, uAI, uGears, uScript, uSound, uMobile, uVisualGears;
+uses uMisc, uKeys, uTeams, uIO, uAI, uGears, uScript, uSound, uMobile, uVisualGears, uTypes;
 
 procedure DoGameTick(Lag: LongInt);
 var i: LongInt;
--- a/hedgewars/uGears.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uGears.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,49 +20,8 @@
 
 unit uGears;
 interface
-uses SDLh, uConsts, uFloat, Math;
-
+uses SDLh, uConsts, uFloat, Math, uTypes;
 
-type
-    PGear = ^TGear;
-    TGearStepProcedure = procedure (Gear: PGear);
-    TGear = record
-            NextGear, PrevGear: PGear;
-            Active: Boolean;
-            AdvBounce: Longword;
-            Invulnerable: Boolean;
-            RenderTimer: Boolean;
-            AmmoType : TAmmoType;
-            State : Longword;
-            X : hwFloat;
-            Y : hwFloat;
-            dX: hwFloat;
-            dY: hwFloat;
-            Kind: TGearType;
-            Pos: Longword;
-            doStep: TGearStepProcedure;
-            Radius: LongInt;
-            Angle, Power : Longword;
-            DirAngle: real;
-            Timer : LongWord;
-            Elasticity: hwFloat;
-            Friction  : hwFloat;
-            Message, MsgParam : Longword;
-            Hedgehog: pointer;
-            Health, Damage, Karma: LongInt;
-            CollisionIndex: LongInt;
-            Tag: LongInt;
-            Tex: PTexture;
-            Z: Longword;
-            IntersectGear: PGear;
-            FlightTime: Longword;
-            uid: Longword;
-            ImpactSound: TSound; // first sound, others have to be after it in the sounds def.
-            nImpactSounds: Word; // count of ImpactSounds
-            SoundChannel: LongInt;
-            PortalCounter: LongWord  // Hopefully temporary, but avoids infinite portal loops in a guaranteed fashion.
-        end;
-    TPGearArray = Array of PGear;
 
 var AllInactive: boolean;
     PrvInactive: boolean;
--- a/hedgewars/uIO.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uIO.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -42,7 +42,7 @@
 procedure NetGetNextCmd;
 
 implementation
-uses uConsole, uConsts, uWorld, uMisc, uLand, uChat, uTeams;
+uses uConsole, uConsts, uWorld, uMisc, uLand, uChat, uTeams, uTypes;
 
 type PCmd = ^TCmd;
      TCmd = packed record
--- a/hedgewars/uLand.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uLand.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -52,7 +52,7 @@
 function  LandBackPixel(x, y: LongInt): LongWord;
 
 implementation
-uses uConsole, uStore, uMisc, uRandom, uTeams, uLandObjects, Adler32, uIO, uLandTexture, sysutils;
+uses uConsole, uStore, uMisc, uRandom, uTeams, uLandObjects, Adler32, uIO, uLandTexture, sysutils, uTypes;
 
 operator=(const a, b: direction) c: Boolean;
 begin
--- a/hedgewars/uLandGraphics.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uLandGraphics.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,7 +20,7 @@
 
 unit uLandGraphics;
 interface
-uses uFloat, uConsts;
+uses uFloat, uConsts, uTypes;
 
 type PRangeArray = ^TRangeArray;
      TRangeArray = array[0..31] of record
--- a/hedgewars/uLandObjects.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uLandObjects.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -29,7 +29,7 @@
 procedure AddOnLandObjects(Surface: PSDL_Surface);
 
 implementation
-uses uLand, uStore, uConsts, uMisc, uConsole, uRandom, uVisualGears, uSound, GLunit;
+uses uLand, uStore, uConsts, uMisc, uConsole, uRandom, uVisualGears, uSound, GLunit, uTypes;
 
 const MaxRects = 512;
       MAXOBJECTRECTS = 16;
--- a/hedgewars/uLandTexture.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uLandTexture.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -28,7 +28,7 @@
 procedure DrawLand(dX, dY: LongInt);
 
 implementation
-uses uMisc, uLand, uStore, uConsts, GLunit;
+uses uMisc, uLand, uStore, uConsts, GLunit, uTypes;
 
 
 const TEXSIZE = 256;
--- a/hedgewars/uMisc.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uMisc.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -21,7 +21,7 @@
 unit uMisc;
 interface
 
-uses    SDLh, uConsts, uFloat, GLunit, Math;
+uses    SDLh, uConsts, uFloat, GLunit, Math, uTypes;
 
 var
 /////// init flags ///////
--- a/hedgewars/uScript.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uScript.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -53,7 +53,8 @@
     uKeys,
     uChat,
     uStats,
-    uRandom;
+    uRandom,
+    uTypes;
 
 var luaState : Plua_State;
     ScriptAmmoLoadout : shortstring;
--- a/hedgewars/uSound.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uSound.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,7 +20,7 @@
 
 unit uSound;
 interface
-uses SDLh, uConsts;
+uses SDLh, uConsts, uTypes;
 
 type PVoicepack = ^TVoicepack;
     TVoicepack = record
--- a/hedgewars/uStats.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uStats.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,7 +20,7 @@
 
 unit uStats;
 interface
-uses uGears, uConsts;
+uses uGears, uConsts, uTypes;
 
 type TStatistics = record
                    DamageRecv,
--- a/hedgewars/uStore.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uStore.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,7 +20,7 @@
 
 unit uStore;
 interface
-uses sysutils, uConsts, uTeams, SDLh, GLunit, uWorld;
+uses sysutils, uConsts, uTeams, SDLh, GLunit, uWorld, uTypes;
 
 
 var PixelFormat: PSDL_PixelFormat;
--- a/hedgewars/uTeams.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uTeams.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,7 +20,7 @@
 
 unit uTeams;
 interface
-uses uConsts, uKeys, uGears, uRandom, uFloat, uStats, uVisualGears, uCollisions, GLunit, uSound;
+uses uConsts, uKeys, uGears, uRandom, uFloat, uStats, uVisualGears, uCollisions, GLunit, uSound, uTypes;
 
 type 
     PHHAmmo = ^THHAmmo;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uTypes.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -0,0 +1,215 @@
+{$INCLUDE "options.inc"}
+
+unit uTypes;
+interface
+
+uses SDLh, uFloat, GLunit;
+
+type
+    HwColor4f = record
+        r, g, b, a: byte
+        end;
+
+    TGameState = (gsLandGen, gsStart, gsGame, gsChat, gsConfirm, gsExit);
+
+    TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtSyntax);
+
+    TPathType = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptTeams, ptMaps,
+            ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts,
+            ptLocale, ptAmmoMenu, ptHedgehog, ptVoices, ptHats, ptFlags, ptMissionMaps);
+
+    TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprFrame,
+            sprLag, sprArrow, sprBazookaShell, sprTargetP, sprBee,
+            sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff,
+            sprMineOn, sprMineDead, sprCase, sprFAid, sprDynamite, sprPower,
+            sprClusterBomb, sprClusterParticle, sprFlame, sprHorizont,
+            sprHorizontL, sprHorizontR, sprSky, sprSkyL,
+            sprSkyR, sprAMBorderHorizontal, sprAMBorderVertical, sprAMSlot, sprAMAmmos,
+            sprAMSlotKeys, sprAMCorners, sprFinger, sprAirBomb,
+            sprAirplane, sprAmAirplane, sprAmGirder, sprHHTelepMask,
+            sprSwitch, sprParachute, sprTarget, sprRopeNode,
+            sprQuestion, sprPowerBar, sprWindBar, sprWindL, sprWindR,
+            sprFlake, sprHandRope, sprHandBazooka, sprHandShotgun,
+            sprHandDEagle, sprHandAirAttack, sprHandBaseball, sprPHammer,
+            sprHandBlowTorch, sprBlowTorch, sprTeleport, sprHHDeath,
+            sprShotgun, sprDEagle, sprHHIdle, sprMortar, sprTurnsLeft,
+            sprKamikaze, sprWhip, sprKowtow, sprSad, sprWave,
+            sprHurrah, sprLemonade, sprShrug, sprJuggle, sprExplPart, sprExplPart2,
+            sprCakeWalk, sprCakeDown, sprAMAmmosBW, sprWatermelon,
+            sprEvilTrace, sprHellishBomb, sprSeduction, sprDress,
+            sprCensored, sprDrill, sprHandDrill, sprHandBallgun, sprBalls,
+            sprPlane, sprHandPlane, sprUtility, sprInvulnerable, sprVampiric, sprGirder,
+            sprSpeechCorner, sprSpeechEdge, sprSpeechTail,
+            sprThoughtCorner, sprThoughtEdge, sprThoughtTail,
+            sprShoutCorner, sprShoutEdge, sprShoutTail,
+            sprSniperRifle, sprBubbles, sprJetpack, sprHealth, sprHandMolotov, sprMolotov,
+            sprSmoke, sprSmokeWhite, sprShell, sprDust, sprExplosives, sprExplosivesRoll,
+            sprAmTeleport, sprSplash, sprDroplet, sprBirdy, sprHandCake, sprHandConstruction,
+            sprHandGrenade, sprHandMelon, sprHandMortar, sprHandSkip, sprHandCluster,
+            sprHandDynamite, sprHandHellish, sprHandMine, sprHandSeduction, sprHandVamp,
+            sprBigExplosion, sprSmokeRing, sprBeeTrace, sprEgg, sprTargetBee, sprHandBee,
+            sprFeather, sprPiano, sprHandSineGun, sprPortalGun, sprPortal,
+            sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk, sprNote,
+            sprSMineOff, sprSMineOn, sprHandSMine, sprHammer,
+            sprHandResurrector, sprCross, sprAirDrill, sprNapalmBomb,
+            sprBulletHit
+            );
+
+    // Gears that interact with other Gears and/or Land
+    TGearType = (gtBomb, gtHedgehog, gtShell, gtGrave, gtBee, // 4
+            gtShotgunShot, gtPickHammer, gtRope, gtMine, gtCase, // 9
+            gtDEagleShot, gtDynamite, gtClusterBomb, gtCluster, gtShover, // 14
+            gtFlame, gtFirePunch, gtATStartGame, gtATSmoothWindCh, // 18
+            gtATFinishGame, gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, // 23
+            gtGirder, gtTeleport, gtSwitcher, gtTarget, gtMortar, // 28
+            gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 34
+            gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 40
+            gtSniperRifleShot, gtJetpack, gtMolotov, gtExplosives, gtBirdy, // 45
+            gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 51
+            gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector, // 56
+            gtNapalmBomb); // 57
+
+    // Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.)
+    TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
+            vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble,
+            vgtSteam, vgtAmmo, vgtSmoke, vgtSmokeWhite, vgtHealth, vgtShell,
+            vgtDust, vgtSplash, vgtDroplet, vgtSmokeRing, vgtBeeTrace, vgtEgg,
+            vgtFeather, vgtHealthTag, vgtSmokeTrace, vgtEvilTrace, vgtExplosion,
+            vgtBigExplosion, vgtChunk, vgtNote, vgtLineTrail,
+            vgtBulletHit);
+
+    TGearsType = set of TGearType;
+
+    TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison);
+
+    TSound = (sndNone,
+            sndGrenadeImpact, sndExplosion, sndThrowPowerUp, sndThrowRelease,
+            sndSplash, sndShotgunReload, sndShotgunFire, sndGraveImpact,
+            sndMineTick, sndPickhammer, sndGun, sndBee, sndJump1, sndJump2,
+            sndJump3, sndYesSir, sndLaugh, sndIllGetYou, sndIncoming,
+            sndMissed, sndStupid, sndFirstBlood, sndBoring, sndByeBye,
+            sndSameTeam, sndNutter, sndReinforce, sndTraitor, sndRegret,
+            sndEnemyDown, sndCoward, sndHurry, sndWatchIt, sndKamikaze,
+            sndCake, sndOw1, sndOw2, sndOw3, sndOw4, sndFirePunch1, sndFirePunch2,
+            sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6,
+            sndMelon, sndHellish, sndYoohoo, sndRCPlane, sndWhipCrack,
+            sndRideOfTheValkyries, sndDenied, sndPlaced, sndBaseballBat,
+            sndVaporize, sndWarp, sndSuddenDeath, sndMortar, sndShutter,
+            sndHomerun, sndMolotov, sndCover, sndUhOh, sndOops,
+            sndNooo, sndHello, sndRopeShot, sndRopeAttach, sndRopeRelease,
+            sndSwitchHog, sndVictory, sndSniperReload, sndSteps, sndLowGravity,
+            sndHellishImpact1, sndHellishImpact2, sndHellishImpact3, sndHellishImpact4,
+            sndMelonImpact, sndDroplet1, sndDroplet2, sndDroplet3, sndEggBreak, sndDrillRocket,
+            sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater,
+            sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, sndPiano8,
+            sndSkip, sndSineGun, sndOoff1, sndOoff2, sndOoff3, sndWhack,
+            sndComeonthen, sndParachute, sndBump, sndResurrector);
+
+    TAmmoType  = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6
+            amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip, // 13
+            amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch, // 18
+            amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake, // 24
+            amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill, amBallgun, // 30
+            amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35
+            amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42
+            amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48
+            amResurrector, amDrillStrike);
+
+    TCrateType = (HealthCrate, AmmoCrate, UtilityCrate);
+
+    THWFont = (fnt16, fntBig, fntSmall {$IFNDEF IPHONEOS}, CJKfnt16, CJKfntBig, CJKfntSmall{$ENDIF});
+
+    TCapGroup = (capgrpGameState, capgrpAmmoinfo, capgrpVolume,
+            capgrpMessage, capgrpAmmostate);
+
+    TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs,
+            siClanHealth, siTeamStats, siPlayerKills, siMaxTeamDamage,
+            siMaxTeamKills, siMaxTurnSkips );
+
+    TWave = (waveRollup, waveSad, waveWave, waveHurrah, waveLemonade, waveShrug, waveJuggle);
+
+    THHFont = record
+            Handle: PTTF_Font;
+            Height: LongInt;
+            style: LongInt;
+            Name: string[21];
+            end;
+
+    PAmmo = ^TAmmo;
+    TAmmo = record
+            Propz: LongWord;
+            Count: LongWord;
+(* Using for place hedgehogs mode, but for any other situation where the initial count would be needed I guess.
+For example, say, a mode where the weaponset is reset each turn, or on sudden death *)
+            NumPerTurn: LongWord;
+            Timer: LongWord;
+            Pos: LongWord;
+            AmmoType: TAmmoType;
+            AttackVoice: TSound;
+            end;
+
+    TVertex2f = record
+        X, Y: GLfloat;
+        end;
+
+    TVertex2i = record
+        X, Y: GLint;
+        end;
+
+    PTexture = ^TTexture;
+    TTexture = record
+            id: GLuint;
+            w, h, scale: LongInt;
+            rx, ry: GLfloat;
+            priority: GLfloat;
+            vb, tb: array [0..3] of TVertex2f;
+            PrevTexture, NextTexture: PTexture;
+            end;
+
+    THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected);
+
+    TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite);
+
+    PGear = ^TGear;
+    TGearStepProcedure = procedure (Gear: PGear);
+    TGear = record
+            NextGear, PrevGear: PGear;
+            Active: Boolean;
+            AdvBounce: Longword;
+            Invulnerable: Boolean;
+            RenderTimer: Boolean;
+            AmmoType : TAmmoType;
+            State : Longword;
+            X : hwFloat;
+            Y : hwFloat;
+            dX: hwFloat;
+            dY: hwFloat;
+            Kind: TGearType;
+            Pos: Longword;
+            doStep: TGearStepProcedure;
+            Radius: LongInt;
+            Angle, Power : Longword;
+            DirAngle: real;
+            Timer : LongWord;
+            Elasticity: hwFloat;
+            Friction  : hwFloat;
+            Message, MsgParam : Longword;
+            Hedgehog: pointer;
+            Health, Damage, Karma: LongInt;
+            CollisionIndex: LongInt;
+            Tag: LongInt;
+            Tex: PTexture;
+            Z: Longword;
+            IntersectGear: PGear;
+            FlightTime: Longword;
+            uid: Longword;
+            ImpactSound: TSound; // first sound, others have to be after it in the sounds def.
+            nImpactSounds: Word; // count of ImpactSounds
+            SoundChannel: LongInt;
+            PortalCounter: LongWord  // Hopefully temporary, but avoids infinite portal loops in a guaranteed fashion.
+        end;
+    TPGearArray = Array of PGear;
+
+implementation
+
+end.
\ No newline at end of file
--- a/hedgewars/uVisualGears.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uVisualGears.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,7 +20,7 @@
 
 unit uVisualGears;
 interface
-uses uConsts, uFloat, Math, GLunit;
+uses uConsts, uFloat, Math, GLunit, uTypes;
 
 type PVisualGear = ^TVisualGear;
     TVGearStepProcedure = procedure (Gear: PVisualGear; Steps: Longword);
--- a/hedgewars/uWorld.pas	Wed Nov 17 16:31:30 2010 +0300
+++ b/hedgewars/uWorld.pas	Wed Nov 17 17:22:36 2010 +0300
@@ -20,7 +20,7 @@
 
 unit uWorld;
 interface
-uses SDLh, uGears, uConsts, uFloat, uRandom;
+uses SDLh, uGears, uConsts, uFloat, uRandom, uTypes;
 
 
 var FollowGear: PGear;