瀏覽代碼

Merge pull request #2272 from Areloch/CoreModuleification

Core module-ification
Areloch 7 年之前
父節點
當前提交
9ebebc1f5e
共有 100 個文件被更改,包括 335 次插入159 次删除
  1. 143 0
      Templates/BaseGame/game/core/Core.cs
  2. 4 4
      Templates/BaseGame/game/core/Core.module
  3. 0 10
      Templates/BaseGame/game/core/CoreComponents.cs
  4. 2 2
      Templates/BaseGame/game/core/clientServer/Core_ClientServer.cs
  5. 3 3
      Templates/BaseGame/game/core/clientServer/Core_ClientServer.module
  6. 4 4
      Templates/BaseGame/game/core/clientServer/scripts/client/client.cs
  7. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs
  8. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/client/levelDownload.cs
  9. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/client/levelLoad.cs
  10. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/client/message.cs
  11. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/server/audio.cs
  12. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/server/commands.cs
  13. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/server/connectionToClient.cs
  14. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/server/defaults.cs
  15. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/server/kickban.cs
  16. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/server/levelDownload.cs
  17. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/server/levelInfo.cs
  18. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/server/levelLoad.cs
  19. 0 0
      Templates/BaseGame/game/core/clientServer/scripts/server/message.cs
  20. 9 9
      Templates/BaseGame/game/core/clientServer/scripts/server/server.cs
  21. 8 0
      Templates/BaseGame/game/core/components/Core_Components.cs
  22. 14 0
      Templates/BaseGame/game/core/components/Core_Components.module
  23. 0 8
      Templates/BaseGame/game/core/components/collisionComponent.asset.taml
  24. 0 0
      Templates/BaseGame/game/core/components/components/RigidBodyComponent.asset.taml
  25. 0 0
      Templates/BaseGame/game/core/components/components/animationComponent.asset.taml
  26. 0 0
      Templates/BaseGame/game/core/components/components/cameraOrbiterComponent.asset.taml
  27. 8 0
      Templates/BaseGame/game/core/components/components/collisionComponent.asset.taml
  28. 1 1
      Templates/BaseGame/game/core/components/components/game/camera.asset.taml
  29. 0 0
      Templates/BaseGame/game/core/components/components/game/camera.cs
  30. 1 1
      Templates/BaseGame/game/core/components/components/game/controlObject.asset.taml
  31. 0 0
      Templates/BaseGame/game/core/components/components/game/controlObject.cs
  32. 1 1
      Templates/BaseGame/game/core/components/components/game/itemRotate.asset.taml
  33. 0 0
      Templates/BaseGame/game/core/components/components/game/itemRotate.cs
  34. 1 1
      Templates/BaseGame/game/core/components/components/game/playerSpawner.asset.taml
  35. 0 0
      Templates/BaseGame/game/core/components/components/game/playerSpawner.cs
  36. 0 0
      Templates/BaseGame/game/core/components/components/input/fpsControls.asset.taml
  37. 0 0
      Templates/BaseGame/game/core/components/components/input/fpsControls.cs
  38. 0 0
      Templates/BaseGame/game/core/components/components/input/inputManager.cs
  39. 0 0
      Templates/BaseGame/game/core/components/components/meshComponent.asset.taml
  40. 0 0
      Templates/BaseGame/game/core/components/components/playerControllerComponent.asset.taml
  41. 0 0
      Templates/BaseGame/game/core/components/components/soundComponent.asset.taml
  42. 0 0
      Templates/BaseGame/game/core/components/components/stateMachineComponent.asset.taml
  43. 8 0
      Templates/BaseGame/game/core/components/components/triggerComponent.asset.taml
  44. 12 0
      Templates/BaseGame/game/core/console/Core_Console.cs
  45. 10 0
      Templates/BaseGame/game/core/console/Core_Console.module
  46. 0 0
      Templates/BaseGame/game/core/console/guis/console.gui
  47. 0 3
      Templates/BaseGame/game/core/console/scripts/console.cs
  48. 0 0
      Templates/BaseGame/game/core/console/scripts/profiles.cs
  49. 二進制
      Templates/BaseGame/game/core/fonts/Arial 12 (ansi).uft
  50. 二進制
      Templates/BaseGame/game/core/fonts/Arial Bold 16 (ansi).uft
  51. 二進制
      Templates/BaseGame/game/core/fonts/ArialBold 14 (ansi).uft
  52. 二進制
      Templates/BaseGame/game/core/fonts/ArialItalic 14 (ansi).uft
  53. 11 0
      Templates/BaseGame/game/core/gui/Core_GUI.cs
  54. 10 0
      Templates/BaseGame/game/core/gui/Core_GUI.module
  55. 0 0
      Templates/BaseGame/game/core/gui/images/button.png
  56. 0 0
      Templates/BaseGame/game/core/gui/images/checkbox.png
  57. 0 0
      Templates/BaseGame/game/core/gui/images/group-border.png
  58. 0 0
      Templates/BaseGame/game/core/gui/images/inactive-overlay.png
  59. 0 0
      Templates/BaseGame/game/core/gui/images/loadingbar.png
  60. 0 0
      Templates/BaseGame/game/core/gui/images/scrollBar.png
  61. 0 0
      Templates/BaseGame/game/core/gui/images/textEdit.png
  62. 0 0
      Templates/BaseGame/game/core/gui/images/thumbHighlightButton.png
  63. 0 0
      Templates/BaseGame/game/core/gui/images/window.png
  64. 0 0
      Templates/BaseGame/game/core/gui/scripts/canvas.cs
  65. 0 0
      Templates/BaseGame/game/core/gui/scripts/cursor.cs
  66. 二進制
      Templates/BaseGame/game/core/gui/scripts/fonts/Arial 10 (ansi).uft
  67. 二進制
      Templates/BaseGame/game/core/gui/scripts/fonts/Arial 12 (ansi).uft
  68. 二進制
      Templates/BaseGame/game/core/gui/scripts/fonts/Arial 14 (ansi).uft
  69. 二進制
      Templates/BaseGame/game/core/gui/scripts/fonts/Arial 16 (ansi).uft
  70. 二進制
      Templates/BaseGame/game/core/gui/scripts/fonts/Arial 36 (ansi).uft
  71. 二進制
      Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 14 (ansi).uft
  72. 二進制
      Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 16 (ansi).uft
  73. 二進制
      Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 18 (ansi).uft
  74. 二進制
      Templates/BaseGame/game/core/gui/scripts/fonts/ArialItalic 14 (ansi).uft
  75. 二進制
      Templates/BaseGame/game/core/gui/scripts/fonts/Lucida Console 12 (ansi).uft
  76. 6 6
      Templates/BaseGame/game/core/gui/scripts/profiles.cs
  77. 20 0
      Templates/BaseGame/game/core/lighting/Core_Lighting.cs
  78. 9 0
      Templates/BaseGame/game/core/lighting/Core_Lighting.module
  79. 2 2
      Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Init.cs
  80. 0 0
      Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs
  81. 1 1
      Templates/BaseGame/game/core/lighting/scripts/basicLighting_Init.cs
  82. 0 0
      Templates/BaseGame/game/core/lighting/scripts/basicLighting_shadowFilter.cs
  83. 0 0
      Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs
  84. 3 3
      Templates/BaseGame/game/core/lighting/scripts/lighting.cs
  85. 0 0
      Templates/BaseGame/game/core/lighting/scripts/shadowMaps_Init.cs
  86. 0 99
      Templates/BaseGame/game/core/main.cs
  87. 33 0
      Templates/BaseGame/game/core/postFX/Core_PostFX.cs
  88. 10 0
      Templates/BaseGame/game/core/postFX/Core_PostFX.module
  89. 1 1
      Templates/BaseGame/game/core/postFX/guis/postFxManager.gui
  90. 0 0
      Templates/BaseGame/game/core/postFX/images/AreaMap33.dds
  91. 0 0
      Templates/BaseGame/game/core/postFX/images/caustics_1.png
  92. 0 0
      Templates/BaseGame/game/core/postFX/images/caustics_2.png
  93. 二進制
      Templates/BaseGame/game/core/postFX/images/inactive-overlay.png
  94. 0 0
      Templates/BaseGame/game/core/postFX/images/materials.cs
  95. 0 0
      Templates/BaseGame/game/core/postFX/images/missingTexture.png
  96. 0 0
      Templates/BaseGame/game/core/postFX/images/noise.png
  97. 0 0
      Templates/BaseGame/game/core/postFX/images/null_color_ramp.png
  98. 0 0
      Templates/BaseGame/game/core/postFX/images/unavailable.png
  99. 0 0
      Templates/BaseGame/game/core/postFX/images/warnMat.dds
  100. 0 0
      Templates/BaseGame/game/core/postFX/scripts/GammaPostFX.cs

+ 143 - 0
Templates/BaseGame/game/core/Core.cs

@@ -0,0 +1,143 @@
+
+function CoreModule::onCreate(%this)
+{
+   
+   // ----------------------------------------------------------------------------
+   // Initialize core sub system functionality such as audio, the Canvas, PostFX,
+   // rendermanager, light managers, etc.
+   //
+   // Note that not all of these need to be initialized before the client, although
+   // the audio should and the canvas definitely needs to be.  I've put things here
+   // to distinguish between the purpose and functionality of the various client
+   // scripts.  Game specific script isn't needed until we reach the shell menus
+   // and start a game or connect to a server. We get the various subsystems ready
+   // to go, and then use initClient() to handle the rest of the startup sequence.
+   //
+   // If this is too convoluted we can reduce this complexity after futher testing
+   // to find exactly which subsystems should be readied before kicking things off. 
+   // ----------------------------------------------------------------------------
+   
+   ModuleDatabase.LoadExplicit( "Core_Rendering" );
+   ModuleDatabase.LoadExplicit( "Core_Utility" );
+   ModuleDatabase.LoadExplicit( "Core_GUI" );
+   ModuleDatabase.LoadExplicit( "CoreModule" );
+   ModuleDatabase.LoadExplicit( "Core_Lighting" );
+   ModuleDatabase.LoadExplicit( "Core_SFX" );
+   ModuleDatabase.LoadExplicit( "Core_PostFX" );
+   ModuleDatabase.LoadExplicit( "Core_ClientServer" );
+   
+   %prefPath = getPrefpath();
+   if ( isFile( %prefPath @ "/clientPrefs.cs" ) )
+      exec( %prefPath @ "/clientPrefs.cs" );
+   else
+      exec("data/defaults.cs");
+      
+   %der = $pref::Video::displayDevice;
+   
+   //We need to hook the missing/warn material stuff early, so do it here
+   /*$Core::MissingTexturePath = "core/images/missingTexture";
+   $Core::UnAvailableTexturePath = "core/images/unavailable";
+   $Core::WarningTexturePath = "core/images/warnMat";
+   $Core::CommonShaderPath = "core/shaders";
+   
+   /*%classList = enumerateConsoleClasses( "Component" );
+
+   foreach$( %componentClass in %classList )
+   {
+      echo("Native Component of type: " @ %componentClass);
+   }*/
+
+   //exec("./helperFunctions.cs");
+
+   // We need some of the default GUI profiles in order to get the canvas and
+   // other aspects of the GUI system ready.
+   //exec("./profiles.cs");
+
+   //This is a bit of a shortcut, but we'll load the client's default settings to ensure all the prefs get initialized correctly
+   
+
+   // Initialization of the various subsystems requires some of the preferences
+   // to be loaded... so do that first.
+   /*exec("./globals.cs");
+
+   exec("./canvas.cs");
+   exec("./cursor.cs");
+
+   exec("./renderManager.cs");
+   exec("./lighting.cs");
+
+   exec("./audio.cs");
+   exec("./sfx/audioAmbience.cs");
+   exec("./sfx/audioData.cs");
+   exec("./sfx/audioDescriptions.cs");
+   exec("./sfx/audioEnvironments.cs");
+   exec("./sfx/audioStates.cs");
+
+   exec("./parseArgs.cs");
+
+   // Materials and Shaders for rendering various object types
+   exec("./gfxData/commonMaterialData.cs");
+   exec("./gfxData/shaders.cs");
+   exec("./gfxData/terrainBlock.cs");
+   exec("./gfxData/water.cs");
+   exec("./gfxData/scatterSky.cs");
+   exec("./gfxData/clouds.cs");
+
+   // Initialize all core post effects.   
+   exec("./postFx.cs");
+
+   //VR stuff
+   exec("./oculusVR.cs");*/
+
+   // Seed the random number generator.
+   setRandomSeed();
+   
+   // Parse the command line arguments
+   echo("\n--------- Parsing Arguments ---------");
+   parseArgs();
+   
+   // The canvas needs to be initialized before any gui scripts are run since
+   // some of the controls assume that the canvas exists at load time.
+   createCanvas($appName);
+
+   //load canvas
+   //exec("./console/main.cs");
+
+   ModuleDatabase.LoadExplicit( "Core_Console" );
+   
+   // Init the physics plugin.
+   physicsInit();
+
+   sfxStartup();
+
+   // Set up networking.
+   setNetPort(0);
+
+   // Start processing file change events.   
+   startFileChangeNotifications();
+   
+   // If we have editors, initialize them here as well
+   if (isToolBuild())
+   {
+      if(isFile("tools/main.cs") && !$isDedicated)
+         exec("tools/main.cs");
+         
+      ModuleDatabase.scanModules( "tools", false );
+      ModuleDatabase.LoadGroup( "Tools" );
+   }
+}
+
+function CoreModule::onDestroy(%this)
+{
+
+}
+
+//-----------------------------------------------------------------------------
+// Called when the engine is shutting down.
+function onExit() 
+{
+   // Stop file change events.
+   stopFileChangeNotifications();
+   
+   ModuleDatabase.UnloadExplicit( "Game" );
+}

+ 4 - 4
Templates/BaseGame/game/core/CoreComponents.module → Templates/BaseGame/game/core/Core.module

@@ -1,11 +1,11 @@
 <ModuleDefinition
-	ModuleId="CoreComponentsModule"
+	ModuleId="CoreModule"
 	VersionId="1"
-	Description="Module that implements the core engine-level components for the game."
-	ScriptFile="CoreComponents.cs"
+	Description="Module that implements the core engine-level setup for the game."
+	ScriptFile="Core.cs"
 	CreateFunction="onCreate"
 	DestroyFunction="onDestroy"
-	Group="Game">
+	Group="Core">
 	<DeclaredAssets
            canSave="true"
            canSaveDynamicFields="true"

+ 0 - 10
Templates/BaseGame/game/core/CoreComponents.cs

@@ -1,10 +0,0 @@
-
-function CoreComponentsModule::onCreate(%this)
-{
-   %classList = enumerateConsoleClasses( "Component" );
-
-   foreach$( %componentClass in %classList )
-   {
-      echo("Native Component of type: " @ %componentClass);
-   }  
-}

+ 2 - 2
Templates/BaseGame/game/data/clientServer/ClientServer.cs → Templates/BaseGame/game/core/clientServer/Core_ClientServer.cs

@@ -12,7 +12,7 @@
 // When a local game is started - a listen server - via calling StartGame() a server is created and then the client is
 // connected to it via createAndConnectToLocalServer().
 
-function ClientServer::create( %this )
+function Core_ClientServer::create( %this )
 {
    echo("\n--------- Initializing Directory: scripts ---------");
    exec( "./scripts/client/client.cs" );
@@ -35,7 +35,7 @@ function ClientServer::create( %this )
    }
 }
 
-function ClientServer::destroy( %this )
+function Core_ClientServer::destroy( %this )
 {
    // Ensure that we are disconnected and/or the server is destroyed.
    // This prevents crashes due to the SceneGraph being deleted before

+ 3 - 3
Templates/BaseGame/game/data/clientServer/ClientServer.module → Templates/BaseGame/game/core/clientServer/Core_ClientServer.module

@@ -1,9 +1,9 @@
 <ModuleDefinition
-	ModuleId="ClientServer"
+	ModuleId="Core_ClientServer"
 	VersionId="1"
 	Description="Default module for the game."
-	ScriptFile="ClientServer.cs"
+	ScriptFile="Core_ClientServer.cs"
 	CreateFunction="create"
 	DestroyFunction="destroy"
-	Group="Game">
+	Group="Core">
 </ModuleDefinition>

+ 4 - 4
Templates/BaseGame/game/data/clientServer/scripts/client/client.cs → Templates/BaseGame/game/core/clientServer/scripts/client/client.cs

@@ -9,10 +9,10 @@ function initClient()
    $Client::GameTypeQuery = $appName;
    $Client::MissionTypeQuery = "Any";
    
-   exec( "data/clientServer/scripts/client/message.cs" );
-   exec( "data/clientServer/scripts/client/connectionToServer.cs" );
-   exec( "data/clientServer/scripts/client/levelDownload.cs" );
-   exec( "data/clientServer/scripts/client/levelLoad.cs" );
+   exec( "./message.cs" );
+   exec( "./connectionToServer.cs" );
+   exec( "./levelDownload.cs" );
+   exec( "./levelLoad.cs" );
    
    //load prefs
    %prefPath = getPrefpath();

+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/client/connectionToServer.cs → Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs


+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/client/levelDownload.cs → Templates/BaseGame/game/core/clientServer/scripts/client/levelDownload.cs


+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/client/levelLoad.cs → Templates/BaseGame/game/core/clientServer/scripts/client/levelLoad.cs


+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/client/message.cs → Templates/BaseGame/game/core/clientServer/scripts/client/message.cs


+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/server/audio.cs → Templates/BaseGame/game/core/clientServer/scripts/server/audio.cs


+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/server/commands.cs → Templates/BaseGame/game/core/clientServer/scripts/server/commands.cs


+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/server/connectionToClient.cs → Templates/BaseGame/game/core/clientServer/scripts/server/connectionToClient.cs


+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/server/defaults.cs → Templates/BaseGame/game/core/clientServer/scripts/server/defaults.cs


+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/server/kickban.cs → Templates/BaseGame/game/core/clientServer/scripts/server/kickban.cs


+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/server/levelDownload.cs → Templates/BaseGame/game/core/clientServer/scripts/server/levelDownload.cs


+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/server/levelInfo.cs → Templates/BaseGame/game/core/clientServer/scripts/server/levelInfo.cs


+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/server/levelLoad.cs → Templates/BaseGame/game/core/clientServer/scripts/server/levelLoad.cs


+ 0 - 0
Templates/BaseGame/game/data/clientServer/scripts/server/message.cs → Templates/BaseGame/game/core/clientServer/scripts/server/message.cs


+ 9 - 9
Templates/BaseGame/game/data/clientServer/scripts/server/server.cs → Templates/BaseGame/game/core/clientServer/scripts/server/server.cs

@@ -27,21 +27,21 @@ function initServer()
    //load prefs
 
    //Force-load the defaults just so we don't have any mistakes
-   exec( "data/clientServer/scripts/server/defaults.cs" );   
+   exec( "./defaults.cs" );   
    
    //Then, if the user has saved preferences, we load those over-top the defaults
    %prefPath = getPrefpath();
    if ( isFile( %prefPath @ "/serverPrefs.cs" ) )
       exec( %prefPath @ "/serverPrefs.cs" );
    
-   exec( "data/clientServer/scripts/server/audio.cs" );
-   exec( "data/clientServer/scripts/server/commands.cs" );
-   exec( "data/clientServer/scripts/server/kickban.cs" );
-   exec( "data/clientServer/scripts/server/message.cs" );
-   exec( "data/clientServer/scripts/server/levelDownload.cs" );
-   exec( "data/clientServer/scripts/server/levelLoad.cs" );
-   exec( "data/clientServer/scripts/server/levelInfo.cs" );
-   exec( "data/clientServer/scripts/server/connectionToClient.cs" );
+   exec( "./audio.cs" );
+   exec( "./commands.cs" );
+   exec( "./kickban.cs" );
+   exec( "./message.cs" );
+   exec( "./levelDownload.cs" );
+   exec( "./levelLoad.cs" );
+   exec( "./levelInfo.cs" );
+   exec( "./connectionToClient.cs" );
 
    // Server::Status is returned in the Game Info Query and represents the
    // current status of the server. This string sould be very short.

+ 8 - 0
Templates/BaseGame/game/core/components/Core_Components.cs

@@ -0,0 +1,8 @@
+
+function Core_Components::onCreate(%this)
+{
+}
+
+function Core_Components::onDestroy(%this)
+{
+}

+ 14 - 0
Templates/BaseGame/game/core/components/Core_Components.module

@@ -0,0 +1,14 @@
+<ModuleDefinition
+	ModuleId="Core_Components"
+	VersionId="1"
+	Description="Module that implements the core engine-level setup for the game."
+	ScriptFile="Core_Components.cs"
+	CreateFunction="onCreate"
+	DestroyFunction="onDestroy"
+	Group="Core">
+	<DeclaredAssets
+           canSave="true"
+           canSaveDynamicFields="true"
+           Extension="asset.taml"
+           Recurse="true" />
+</ModuleDefinition>

+ 0 - 8
Templates/BaseGame/game/core/components/collisionComponent.asset.taml

@@ -1,8 +0,0 @@
-<ComponentAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="CollisionComponentAsset"
-    componentClass="CollisionComponent"
-    friendlyName="Collision"
-    componentType="Collision"
-    description="Enables an entity to collide with things." />

+ 0 - 0
Templates/BaseGame/game/core/components/RigidBodyComponent.asset.taml → Templates/BaseGame/game/core/components/components/RigidBodyComponent.asset.taml


+ 0 - 0
Templates/BaseGame/game/core/components/animationComponent.asset.taml → Templates/BaseGame/game/core/components/components/animationComponent.asset.taml


+ 0 - 0
Templates/BaseGame/game/core/components/cameraOrbiterComponent.asset.taml → Templates/BaseGame/game/core/components/components/cameraOrbiterComponent.asset.taml


+ 8 - 0
Templates/BaseGame/game/core/components/components/collisionComponent.asset.taml

@@ -0,0 +1,8 @@
+<ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="ShapeCollisionComponentAsset"
+    componentClass="ShapeCollisionComponent"
+    friendlyName="Shape Collision"
+    componentType="Collision"
+    description="Enables an entity to collide with things with bounds, collision or visible meshes" />

+ 1 - 1
Templates/BaseGame/game/core/components/game/camera.asset.taml → Templates/BaseGame/game/core/components/components/game/camera.asset.taml

@@ -6,4 +6,4 @@
     friendlyName="Camera"
     componentType="Game"
     description="Allows the component owner to operate as a camera."
-    scriptFile="core/components/game/camera.cs" />
+    scriptFile="core/components/components/game/camera.cs" />

+ 0 - 0
Templates/BaseGame/game/core/components/game/camera.cs → Templates/BaseGame/game/core/components/components/game/camera.cs


+ 1 - 1
Templates/BaseGame/game/core/components/game/controlObject.asset.taml → Templates/BaseGame/game/core/components/components/game/controlObject.asset.taml

@@ -7,4 +7,4 @@
     friendlyName="Control Object"
     componentType="Game"
     description="Allows the component owner to be controlled by a client."
-    scriptFile="core/components/game/controlObject.cs" />
+    scriptFile="core/components/components/game/controlObject.cs" />

+ 0 - 0
Templates/BaseGame/game/core/components/game/controlObject.cs → Templates/BaseGame/game/core/components/components/game/controlObject.cs


+ 1 - 1
Templates/BaseGame/game/core/components/game/itemRotate.asset.taml → Templates/BaseGame/game/core/components/components/game/itemRotate.asset.taml

@@ -7,4 +7,4 @@
     friendlyName="Item Rotation"
     componentType="Game"
     description="Rotates the entity around an axis, like an item pickup."
-    scriptFile="core/components/game/itemRotate.cs" />
+    scriptFile="core/components/components/game/itemRotate.cs" />

+ 0 - 0
Templates/BaseGame/game/core/components/game/itemRotate.cs → Templates/BaseGame/game/core/components/components/game/itemRotate.cs


+ 1 - 1
Templates/BaseGame/game/core/components/game/playerSpawner.asset.taml → Templates/BaseGame/game/core/components/components/game/playerSpawner.asset.taml

@@ -7,4 +7,4 @@
     friendlyName="Player Spawner"
     componentType="Game"
     description="When a client connects, it spawns a player object for them and attaches them to it."
-    scriptFile="core/components/game/playerSpawner.cs" />
+    scriptFile="core/components/components/game/playerSpawner.cs" />

+ 0 - 0
Templates/BaseGame/game/core/components/game/playerSpawner.cs → Templates/BaseGame/game/core/components/components/game/playerSpawner.cs


+ 0 - 0
Templates/BaseGame/game/core/components/input/fpsControls.asset.taml → Templates/BaseGame/game/core/components/components/input/fpsControls.asset.taml


+ 0 - 0
Templates/BaseGame/game/core/components/input/fpsControls.cs → Templates/BaseGame/game/core/components/components/input/fpsControls.cs


+ 0 - 0
Templates/BaseGame/game/core/components/input/inputManager.cs → Templates/BaseGame/game/core/components/components/input/inputManager.cs


+ 0 - 0
Templates/BaseGame/game/core/components/meshComponent.asset.taml → Templates/BaseGame/game/core/components/components/meshComponent.asset.taml


+ 0 - 0
Templates/BaseGame/game/core/components/playerControllerComponent.asset.taml → Templates/BaseGame/game/core/components/components/playerControllerComponent.asset.taml


+ 0 - 0
Templates/BaseGame/game/core/components/soundComponent.asset.taml → Templates/BaseGame/game/core/components/components/soundComponent.asset.taml


+ 0 - 0
Templates/BaseGame/game/core/components/stateMachineComponent.asset.taml → Templates/BaseGame/game/core/components/components/stateMachineComponent.asset.taml


+ 8 - 0
Templates/BaseGame/game/core/components/components/triggerComponent.asset.taml

@@ -0,0 +1,8 @@
+<ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="TriggerComponentAsset"
+    componentClass="TriggerComponent"
+    friendlyName="Trigger Component"
+    componentType="Collision"
+    description="Enables callback and event behaviors on collision with the entity." />

+ 12 - 0
Templates/BaseGame/game/core/console/Core_Console.cs

@@ -0,0 +1,12 @@
+
+function Core_Console::onCreate(%this)
+{
+    exec("./scripts/profiles.cs");
+    exec("./scripts/console.cs");
+
+    exec("./guis/console.gui");
+}
+
+function Core_Console::onDestroy(%this)
+{
+}

+ 10 - 0
Templates/BaseGame/game/core/console/Core_Console.module

@@ -0,0 +1,10 @@
+<ModuleDefinition
+	ModuleId="Core_Console"
+	VersionId="1"
+	Description="Module that implements the core engine-level setup for the game."
+	ScriptFile="Core_Console.cs"
+	CreateFunction="onCreate"
+	DestroyFunction="onDestroy"
+	Group="Core"
+	Dependencies="Core_GUI=1">
+</ModuleDefinition>

+ 0 - 0
Templates/BaseGame/game/core/console/console.gui → Templates/BaseGame/game/core/console/guis/console.gui


+ 0 - 3
Templates/BaseGame/game/core/console/main.cs → Templates/BaseGame/game/core/console/scripts/console.cs

@@ -20,9 +20,6 @@
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 
-exec("./profiles.cs");
-exec("./console.gui");
-
 GlobalActionMap.bind("keyboard", "tilde", "toggleConsole");
 
 function ConsoleEntry::eval()

+ 0 - 0
Templates/BaseGame/game/core/console/profiles.cs → Templates/BaseGame/game/core/console/scripts/profiles.cs


二進制
Templates/BaseGame/game/core/fonts/Arial 12 (ansi).uft


二進制
Templates/BaseGame/game/core/fonts/Arial Bold 16 (ansi).uft


二進制
Templates/BaseGame/game/core/fonts/ArialBold 14 (ansi).uft


二進制
Templates/BaseGame/game/core/fonts/ArialItalic 14 (ansi).uft


+ 11 - 0
Templates/BaseGame/game/core/gui/Core_GUI.cs

@@ -0,0 +1,11 @@
+
+function Core_GUI::onCreate(%this)
+{
+   exec("./scripts/profiles.cs");
+   exec("./scripts/canvas.cs");
+   exec("./scripts/cursor.cs");
+}
+
+function Core_GUI::onDestroy(%this)
+{
+}

+ 10 - 0
Templates/BaseGame/game/core/gui/Core_GUI.module

@@ -0,0 +1,10 @@
+<ModuleDefinition
+	ModuleId="Core_GUI"
+	VersionId="1"
+	Description="Module that implements the core engine-level setup for the game."
+	ScriptFile="Core_GUI.cs"
+	CreateFunction="onCreate"
+	DestroyFunction="onDestroy"
+	Group="Core"
+	Dependencies="Core_Rendering=1">
+</ModuleDefinition>

+ 0 - 0
Templates/BaseGame/game/core/images/button.png → Templates/BaseGame/game/core/gui/images/button.png


+ 0 - 0
Templates/BaseGame/game/core/images/checkbox.png → Templates/BaseGame/game/core/gui/images/checkbox.png


+ 0 - 0
Templates/BaseGame/game/core/images/group-border.png → Templates/BaseGame/game/core/gui/images/group-border.png


+ 0 - 0
Templates/BaseGame/game/core/images/inactive-overlay.png → Templates/BaseGame/game/core/gui/images/inactive-overlay.png


+ 0 - 0
Templates/BaseGame/game/core/images/loadingbar.png → Templates/BaseGame/game/core/gui/images/loadingbar.png


+ 0 - 0
Templates/BaseGame/game/core/images/scrollBar.png → Templates/BaseGame/game/core/gui/images/scrollBar.png


+ 0 - 0
Templates/BaseGame/game/core/images/textEdit.png → Templates/BaseGame/game/core/gui/images/textEdit.png


+ 0 - 0
Templates/BaseGame/game/core/images/thumbHighlightButton.png → Templates/BaseGame/game/core/gui/images/thumbHighlightButton.png


+ 0 - 0
Templates/BaseGame/game/core/images/window.png → Templates/BaseGame/game/core/gui/images/window.png


+ 0 - 0
Templates/BaseGame/game/core/canvas.cs → Templates/BaseGame/game/core/gui/scripts/canvas.cs


+ 0 - 0
Templates/BaseGame/game/core/cursor.cs → Templates/BaseGame/game/core/gui/scripts/cursor.cs


二進制
Templates/BaseGame/game/core/gui/scripts/fonts/Arial 10 (ansi).uft


二進制
Templates/BaseGame/game/core/gui/scripts/fonts/Arial 12 (ansi).uft


二進制
Templates/BaseGame/game/core/gui/scripts/fonts/Arial 14 (ansi).uft


二進制
Templates/BaseGame/game/core/gui/scripts/fonts/Arial 16 (ansi).uft


二進制
Templates/BaseGame/game/core/gui/scripts/fonts/Arial 36 (ansi).uft


二進制
Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 14 (ansi).uft


二進制
Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 16 (ansi).uft


二進制
Templates/BaseGame/game/core/gui/scripts/fonts/Arial Bold 18 (ansi).uft


二進制
Templates/BaseGame/game/core/gui/scripts/fonts/ArialItalic 14 (ansi).uft


二進制
Templates/BaseGame/game/core/gui/scripts/fonts/Lucida Console 12 (ansi).uft


+ 6 - 6
Templates/BaseGame/game/core/profiles.cs → Templates/BaseGame/game/core/gui/scripts/profiles.cs

@@ -107,7 +107,7 @@ new GuiControlProfile (GuiWindowProfile)
    bevelColorHL = "255 255 255";
    bevelColorLL = "0 0 0";
    text = "untitled";
-   bitmap = "./images/window";
+   bitmap = "core/gui/images/window";
    textOffset = "8 4";
    hasBitmapArray = true;
    justify = "left";
@@ -119,7 +119,7 @@ if(!isObject(GuiTextEditProfile))
 new GuiControlProfile(GuiTextEditProfile)
 {
    opaque = true;
-   bitmap = "./images/textEdit";
+   bitmap = "core/gui/images/textEdit";
    hasBitmapArray = true; 
    border = -2;
    fillColor = "242 241 240 0";
@@ -145,7 +145,7 @@ new GuiControlProfile(GuiScrollProfile)
    fontColor = "0 0 0";
    fontColorHL = "150 150 150";
    border = true;
-   bitmap = "./images/scrollBar";
+   bitmap = "core/gui/images/scrollBar";
    hasBitmapArray = true;
    category = "Core";
 };
@@ -173,7 +173,7 @@ new GuiControlProfile(GuiCheckBoxProfile)
 	fontColorNA = "200 200 200";
    fixedExtent = true;
    justify = "left";
-   bitmap = "./images/checkbox";
+   bitmap = "core/gui/images/checkbox";
    hasBitmapArray = true;
    category = "Tools";
 };
@@ -193,7 +193,7 @@ new GuiControlProfile( GuiProgressBitmapProfile )
 {
    border = false;
    hasBitmapArray = true;
-   bitmap = "./images/loadingbar";
+   bitmap = "core/gui/images/loadingbar";
    category = "Core";
 };
 
@@ -220,7 +220,7 @@ new GuiControlProfile( GuiButtonProfile )
    fixedExtent = false;
    justify = "center";
    canKeyFocus = false;
-	bitmap = "./images/button";
+	bitmap = "core/gui/images/button";
    hasBitmapArray = false;
    category = "Core";
 };

+ 20 - 0
Templates/BaseGame/game/core/lighting/Core_Lighting.cs

@@ -0,0 +1,20 @@
+
+function Core_Lighting::onCreate(%this)
+{
+   exec("./scripts/lighting.cs");
+   
+   //Advanced/Deferred
+   exec("./scripts/advancedLighting_Shaders.cs");
+   exec("./scripts/deferredShading.cs");
+   exec("./scripts/advancedLighting_Init.cs");
+   
+   //Basic/Forward
+   exec("./scripts/basicLighting_shadowFilter.cs");
+   exec("./scripts/shadowMaps_Init.cs");
+   exec("./scripts/basicLighting_Init.cs");
+   
+}
+
+function Core_Lighting::onDestroy(%this)
+{
+}

+ 9 - 0
Templates/BaseGame/game/core/lighting/Core_Lighting.module

@@ -0,0 +1,9 @@
+<ModuleDefinition
+	ModuleId="Core_Lighting"
+	VersionId="1"
+	Description="Module that implements the core engine-level setup for the game."
+	ScriptFile="Core_Lighting.cs"
+	CreateFunction="onCreate"
+	DestroyFunction="onDestroy"
+	Group="Core">
+</ModuleDefinition>

+ 2 - 2
Templates/BaseGame/game/core/lighting/advanced/init.cs → Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Init.cs

@@ -39,8 +39,8 @@ $pref::LightManager::sgUseDynamicShadows = "1";
 $pref::LightManager::sgUseToneMapping = "";
 */
 
-exec( "./shaders.cs" );
-exec( "./deferredShading.cs" );
+//exec( "./shaders.cs" );
+//exec( "./deferredShading.cs" );
 
 function onActivateAdvancedLM()
 {

+ 0 - 0
Templates/BaseGame/game/core/lighting/advanced/shaders.cs → Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs


+ 1 - 1
Templates/BaseGame/game/core/lighting/basic/init.cs → Templates/BaseGame/game/core/lighting/scripts/basicLighting_Init.cs

@@ -20,7 +20,7 @@
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 
-exec( "./shadowFilter.cs" );
+//exec( "./shadowFilter.cs" );
 
 singleton GFXStateBlockData( BL_ProjectedShadowSBData )
 {

+ 0 - 0
Templates/BaseGame/game/core/lighting/basic/shadowFilter.cs → Templates/BaseGame/game/core/lighting/scripts/basicLighting_shadowFilter.cs


+ 0 - 0
Templates/BaseGame/game/core/lighting/advanced/deferredShading.cs → Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs


+ 3 - 3
Templates/BaseGame/game/core/lighting.cs → Templates/BaseGame/game/core/lighting/scripts/lighting.cs

@@ -26,12 +26,12 @@ function initLightingSystems(%manager)
 
    // First exec the scripts for the different light managers
    // in the lighting folder.
-   %pattern = "./lighting/*/init.cs";   
+   /*%pattern = "./lighting/*//*init.cs";   
    %file = findFirstFile( %pattern );
    if ( %file $= "" )
    {
       // Try for DSOs next.
-      %pattern = "./lighting/*/init.cs.dso";
+      %pattern = "./lighting/*//*init.cs.dso";
       %file = findFirstFile( %pattern );
    }
 
@@ -39,7 +39,7 @@ function initLightingSystems(%manager)
    {      
       exec( %file );
       %file = findNextFile( %pattern );
-   }
+   }*/
 
    // Try the perfered one first.
    %success = setLightManager(%manager);

+ 0 - 0
Templates/BaseGame/game/core/lighting/shadowMaps/init.cs → Templates/BaseGame/game/core/lighting/scripts/shadowMaps_Init.cs


+ 0 - 99
Templates/BaseGame/game/core/main.cs

@@ -1,99 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-// ----------------------------------------------------------------------------
-// Initialize core sub system functionality such as audio, the Canvas, PostFX,
-// rendermanager, light managers, etc.
-//
-// Note that not all of these need to be initialized before the client, although
-// the audio should and the canvas definitely needs to be.  I've put things here
-// to distinguish between the purpose and functionality of the various client
-// scripts.  Game specific script isn't needed until we reach the shell menus
-// and start a game or connect to a server. We get the various subsystems ready
-// to go, and then use initClient() to handle the rest of the startup sequence.
-//
-// If this is too convoluted we can reduce this complexity after futher testing
-// to find exactly which subsystems should be readied before kicking things off. 
-// ----------------------------------------------------------------------------
-
-//We need to hook the missing/warn material stuff early, so do it here
-$Core::MissingTexturePath = "core/images/missingTexture";
-$Core::UnAvailableTexturePath = "core/images/unavailable";
-$Core::WarningTexturePath = "core/images/warnMat";
-$Core::CommonShaderPath = "core/shaders";
-
-ModuleDatabase.setModuleExtension("module");
-
-//Core components
-ModuleDatabase.scanModules( "core", false );
-ModuleDatabase.LoadExplicit( "CoreComponentsModule" );
-
-exec("./helperFunctions.cs");
-
-// We need some of the default GUI profiles in order to get the canvas and
-// other aspects of the GUI system ready.
-exec("./profiles.cs");
-
-//This is a bit of a shortcut, but we'll load the client's default settings to ensure all the prefs get initialized correctly
-%prefPath = getPrefpath();
-if ( isFile( %prefPath @ "/clientPrefs.cs" ) )
-   exec( %prefPath @ "/clientPrefs.cs" );
-else
-   exec("data/defaults.cs");
-   
-%der = $pref::Video::displayDevice;
-
-// Initialization of the various subsystems requires some of the preferences
-// to be loaded... so do that first.
-exec("./globals.cs");
-
-exec("./canvas.cs");
-exec("./cursor.cs");
-
-exec("./renderManager.cs");
-exec("./lighting.cs");
-
-exec("./audio.cs");
-exec("./sfx/audioAmbience.cs");
-exec("./sfx/audioData.cs");
-exec("./sfx/audioDescriptions.cs");
-exec("./sfx/audioEnvironments.cs");
-exec("./sfx/audioStates.cs");
-
-exec("./parseArgs.cs");
-
-// Materials and Shaders for rendering various object types
-exec("./gfxData/commonMaterialData.cs");
-exec("./gfxData/shaders.cs");
-exec("./gfxData/terrainBlock.cs");
-exec("./gfxData/water.cs");
-exec("./gfxData/scatterSky.cs");
-exec("./gfxData/clouds.cs");
-
-// Initialize all core post effects.   
-exec("./postFx.cs");
-
-//VR stuff
-exec("./oculusVR.cs");
-
-// Seed the random number generator.
-setRandomSeed();

+ 33 - 0
Templates/BaseGame/game/core/postFX/Core_PostFX.cs

@@ -0,0 +1,33 @@
+
+function Core_PostFX::onCreate(%this)
+{
+   //
+   exec("./scripts/postFx.cs");
+   /*exec("./scripts/postFxManager.gui.cs");
+   exec("./scripts/postFxManager.gui.settings.cs");
+   exec("./scripts/postFxManager.persistance.cs");
+   
+   exec("./scripts/default.postfxpreset.cs");
+   
+   exec("./scripts/caustics.cs");
+   exec("./scripts/chromaticLens.cs");
+   exec("./scripts/dof.cs");
+   exec("./scripts/edgeAA.cs");
+   exec("./scripts/flash.cs");
+   exec("./scripts/fog.cs");
+   exec("./scripts/fxaa.cs");
+   exec("./scripts/GammaPostFX.cs");
+   exec("./scripts/glow.cs");
+   exec("./scripts/hdr.cs");
+   exec("./scripts/lightRay.cs");
+   exec("./scripts/MLAA.cs");
+   exec("./scripts/MotionBlurFx.cs");
+   exec("./scripts/ovrBarrelDistortion.cs");
+   exec("./scripts/ssao.cs");
+   exec("./scripts/turbulence.cs");
+   exec("./scripts/vignette.cs");*/
+}
+
+function Core_PostFX::onDestroy(%this)
+{
+}

+ 10 - 0
Templates/BaseGame/game/core/postFX/Core_PostFX.module

@@ -0,0 +1,10 @@
+<ModuleDefinition
+	ModuleId="Core_PostFX"
+	VersionId="1"
+	Description="Module that implements the core engine-level setup for the game."
+	ScriptFile="Core_PostFX.cs"
+	CreateFunction="onCreate"
+	DestroyFunction="onDestroy"
+	Group="Core"
+	Dependencies="Core_Rendering=1,Core_Lighting=1">
+</ModuleDefinition>

+ 1 - 1
Templates/BaseGame/game/core/postFX/postFxManager.gui → Templates/BaseGame/game/core/postFX/guis/postFxManager.gui

@@ -2526,7 +2526,7 @@
                sinkAllKeyEvents = "0";
                password = "0";
                passwordMask = "*";
-               text = "core/images/null_color_ramp.png";
+               text = "core/postFX/images/null_color_ramp.png";
                maxLength = "1024";
                margin = "0 0 0 0";
                padding = "0 0 0 0";

+ 0 - 0
Templates/BaseGame/game/core/images/AreaMap33.dds → Templates/BaseGame/game/core/postFX/images/AreaMap33.dds


+ 0 - 0
Templates/BaseGame/game/core/images/caustics_1.png → Templates/BaseGame/game/core/postFX/images/caustics_1.png


+ 0 - 0
Templates/BaseGame/game/core/images/caustics_2.png → Templates/BaseGame/game/core/postFX/images/caustics_2.png


二進制
Templates/BaseGame/game/core/postFX/images/inactive-overlay.png


+ 0 - 0
Templates/BaseGame/game/core/images/materials.cs → Templates/BaseGame/game/core/postFX/images/materials.cs


+ 0 - 0
Templates/BaseGame/game/core/images/missingTexture.png → Templates/BaseGame/game/core/postFX/images/missingTexture.png


+ 0 - 0
Templates/BaseGame/game/core/images/noise.png → Templates/BaseGame/game/core/postFX/images/noise.png


+ 0 - 0
Templates/BaseGame/game/core/images/null_color_ramp.png → Templates/BaseGame/game/core/postFX/images/null_color_ramp.png


+ 0 - 0
Templates/BaseGame/game/core/images/unavailable.png → Templates/BaseGame/game/core/postFX/images/unavailable.png


+ 0 - 0
Templates/BaseGame/game/core/images/warnMat.dds → Templates/BaseGame/game/core/postFX/images/warnMat.dds


+ 0 - 0
Templates/BaseGame/game/core/postFX/GammaPostFX.cs → Templates/BaseGame/game/core/postFX/scripts/GammaPostFX.cs


Some files were not shown because too many files changed in this diff