Merge branch 'development' into SnapToMenu
87
Templates/BaseGame/game/core/Core.cs
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
|
||||
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( "Core_Lighting" );
|
||||
ModuleDatabase.LoadExplicit( "Core_SFX" );
|
||||
ModuleDatabase.LoadExplicit( "Core_PostFX" );
|
||||
ModuleDatabase.LoadExplicit( "Core_Components" );
|
||||
ModuleDatabase.LoadExplicit( "Core_GameObjects" );
|
||||
ModuleDatabase.LoadExplicit( "Core_ClientServer" );
|
||||
|
||||
%prefPath = getPrefpath();
|
||||
if ( isFile( %prefPath @ "/clientPrefs.cs" ) )
|
||||
exec( %prefPath @ "/clientPrefs.cs" );
|
||||
else
|
||||
exec("data/defaults.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" );
|
||||
}
|
||||
8
Templates/BaseGame/game/core/Core.module
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<ModuleDefinition
|
||||
ModuleId="CoreModule"
|
||||
VersionId="1"
|
||||
Description="Module that implements the core engine-level setup for the game."
|
||||
ScriptFile="Core.cs"
|
||||
CreateFunction="onCreate"
|
||||
DestroyFunction="onDestroy"
|
||||
Group="Core"/>
|
||||
|
|
@ -12,13 +12,13 @@
|
|||
// 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" );
|
||||
exec( "./scripts/server/server.cs" );
|
||||
|
||||
$Game::MissionGroup = "MissionGroup";
|
||||
$Game::MainScene = getScene(0);
|
||||
|
||||
initServer();
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -46,7 +46,7 @@ function ClientServer::destroy( %this )
|
|||
disconnect();
|
||||
|
||||
// Destroy the physics plugin.
|
||||
physicsDestroy();
|
||||
//physicsDestroy();
|
||||
|
||||
sfxShutdown();
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -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();
|
||||
|
|
@ -43,7 +43,7 @@ function GameConnection::initialControlSet(%this)
|
|||
// first check if the editor is active
|
||||
if (!isToolBuild() || !isMethod("Editor", "checkActiveLoadDone") || !Editor::checkActiveLoadDone())
|
||||
{
|
||||
if (Canvas.getContent() != PlayGui.getId())
|
||||
if (isObject(PlayGui) && Canvas.getContent() != PlayGui.getId())
|
||||
Canvas.setContent(PlayGui);
|
||||
}
|
||||
}
|
||||
|
|
@ -132,6 +132,23 @@ function isNameUnique(%name)
|
|||
//
|
||||
function GameConnection::onDrop(%client, %reason)
|
||||
{
|
||||
%entityIds = parseMissionGroupForIds("Entity", "");
|
||||
%entityCount = getWordCount(%entityIds);
|
||||
|
||||
for(%i=0; %i < %entityCount; %i++)
|
||||
{
|
||||
%entity = getWord(%entityIds, %i);
|
||||
|
||||
for(%e=0; %e < %entity.getCount(); %e++)
|
||||
{
|
||||
%child = %entity.getObject(%e);
|
||||
if(%child.getClassName() $= "Entity")
|
||||
%entityIds = %entityIds SPC %child.getID();
|
||||
}
|
||||
|
||||
%entity.notify("onClientDisconnect", %client);
|
||||
}
|
||||
|
||||
if($missionRunning)
|
||||
theLevelInfo.onClientLeaveGame();
|
||||
|
||||
|
|
@ -131,6 +131,22 @@ function serverCmdMissionStartPhase3Ack(%client, %seq)
|
|||
%client.currentPhase = 3;
|
||||
|
||||
// Server is ready to drop into the game
|
||||
%entityIds = parseMissionGroupForIds("Entity", "");
|
||||
%entityCount = getWordCount(%entityIds);
|
||||
|
||||
for(%i=0; %i < %entityCount; %i++)
|
||||
{
|
||||
%entity = getWord(%entityIds, %i);
|
||||
|
||||
for(%e=0; %e < %entity.getCount(); %e++)
|
||||
{
|
||||
%child = %entity.getObject(%e);
|
||||
if(%child.getCLassName() $= "Entity")
|
||||
%entityIds = %entityIds SPC %child.getID();
|
||||
}
|
||||
|
||||
%entity.notify("onClientConnect", %client);
|
||||
}
|
||||
|
||||
//Have any special game-play handling here
|
||||
if(theLevelInfo.isMethod("onClientEnterGame"))
|
||||
|
|
@ -151,7 +167,7 @@ function serverCmdMissionStartPhase3Ack(%client, %seq)
|
|||
};
|
||||
}
|
||||
|
||||
if (isDefined("$Game::DefaultCameraClass"))
|
||||
//if (isDefined("$Game::DefaultCameraClass"))
|
||||
%client.camera = spawnObject("Camera", Observer);
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ function sendLoadInfoToClient( %client )
|
|||
function parseMissionGroup( %className, %childGroup )
|
||||
{
|
||||
if( getWordCount( %childGroup ) == 0)
|
||||
%currentGroup = "MissionGroup";
|
||||
%currentGroup = getScene(0);
|
||||
else
|
||||
%currentGroup = %childGroup;
|
||||
|
||||
|
|
@ -136,7 +136,7 @@ function parseMissionGroup( %className, %childGroup )
|
|||
function parseMissionGroupForIds( %className, %childGroup )
|
||||
{
|
||||
if( getWordCount( %childGroup ) == 0)
|
||||
%currentGroup = $Game::MissionGroup;
|
||||
%currentGroup = getScene(0);
|
||||
else
|
||||
%currentGroup = %childGroup;
|
||||
|
||||
|
|
@ -98,9 +98,9 @@ function loadMissionStage2()
|
|||
// Exec the mission. The MissionGroup (loaded components) is added to the ServerGroup
|
||||
exec(%file);
|
||||
|
||||
if( !isObject(MissionGroup) )
|
||||
if( !isObject(getScene(0)) )
|
||||
{
|
||||
$Server::LoadFailMsg = "No 'MissionGroup' found in mission \"" @ %file @ "\".";
|
||||
$Server::LoadFailMsg = "No Scene found in level \"" @ %file @ "\".";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -141,7 +141,7 @@ function loadMissionStage2()
|
|||
|
||||
function endMission()
|
||||
{
|
||||
if (!isObject( MissionGroup ))
|
||||
if (!isObject( getScene(0) ))
|
||||
return;
|
||||
|
||||
echo("*** ENDING MISSION");
|
||||
|
|
@ -159,7 +159,7 @@ function endMission()
|
|||
}
|
||||
|
||||
// Delete everything
|
||||
MissionGroup.delete();
|
||||
getScene(0).delete();
|
||||
MissionCleanup.delete();
|
||||
|
||||
clearServerPaths();
|
||||
|
|
@ -25,20 +25,23 @@ function initServer()
|
|||
echo("\n--------- Initializing " @ $appName @ ": Server Scripts ---------");
|
||||
|
||||
//load prefs
|
||||
|
||||
//Force-load the defaults just so we don't have any mistakes
|
||||
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" );
|
||||
else
|
||||
exec( "data/clientServer/scripts/server/defaults.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.
|
||||
|
|
@ -99,6 +102,11 @@ function createAndConnectToLocalServer( %serverType, %level )
|
|||
{
|
||||
%conn.delete();
|
||||
destroyServer();
|
||||
|
||||
MessageBoxOK("Error starting local server!", "There was an error when trying to connect to the local server.");
|
||||
|
||||
if(isObject(MainMenuGui))
|
||||
Canvas.setContent(MainMenuGui);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -201,7 +209,7 @@ function destroyServer()
|
|||
// End any running levels and shut down the physics sim
|
||||
onServerDestroyed();
|
||||
|
||||
physicsDestroy();
|
||||
//physicsDestroy();
|
||||
|
||||
// Delete all the server objects
|
||||
if (isObject(ServerGroup))
|
||||
|
|
@ -235,7 +243,7 @@ function onServerDestroyed()
|
|||
{
|
||||
physicsStopSimulation("server");
|
||||
|
||||
if (!isObject( MissionGroup ))
|
||||
if (!isObject( getScene(0) ))
|
||||
return;
|
||||
|
||||
echo("*** ENDING MISSION");
|
||||
|
|
@ -254,7 +262,7 @@ function onServerDestroyed()
|
|||
}
|
||||
|
||||
// Delete everything
|
||||
MissionGroup.delete();
|
||||
getScene(0).delete();
|
||||
MissionCleanup.delete();
|
||||
|
||||
clearServerPaths();
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
function Core_Components::onCreate(%this)
|
||||
{
|
||||
}
|
||||
|
||||
function Core_Components::onDestroy(%this)
|
||||
{
|
||||
}
|
||||
|
|
@ -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,0 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="RigidBodyComponentAsset"
|
||||
componentClass="RigidBodyComponent"
|
||||
friendlyName="Rigid Body"
|
||||
componentType="Physics"
|
||||
description="Allows an entity to have rigid body physics." />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="ActionAnimationComponentAsset"
|
||||
componentClass="ActionAnimationComponent"
|
||||
friendlyName="Action Animation"
|
||||
componentType="animation"
|
||||
description="Allows a mesh component to be animated." />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="AIControllerComponentAsset"
|
||||
componentClass="AIControllerComponent"
|
||||
friendlyName="AI Player Controller"
|
||||
componentType="Game"
|
||||
description="Enables an entity to move like a player object." />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="AnimationComponentAsset"
|
||||
componentClass="AnimationComponent"
|
||||
friendlyName="animation"
|
||||
componentType="animation"
|
||||
description="Allows a mesh component to be animated." />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="ArmAnimationComponentAsset"
|
||||
componentClass="ArmAnimationComponent"
|
||||
friendlyName="Arm Animation"
|
||||
componentType="animation"
|
||||
description="Allows a mesh component to be animated." />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="CameraOrbiterComponentAsset"
|
||||
componentClass="CameraOrbiterComponent"
|
||||
friendlyName="Camera Orbiter"
|
||||
componentType="Game"
|
||||
description="Acts as a boon arm for a camera component." />
|
||||
|
|
@ -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" />
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="CameraComponentAsset"
|
||||
componentClass="CameraComponent"
|
||||
friendlyName="Camera"
|
||||
componentType="Game"
|
||||
description="Allows the component owner to operate as a camera."
|
||||
scriptFile="core/components/components/game/camera.cs" />
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function CameraComponent::onAdd(%this)
|
||||
{
|
||||
%this.addComponentField(clientOwner, "The client that views this camera", "int", "1", "");
|
||||
|
||||
%test = %this.clientOwner;
|
||||
|
||||
%barf = ClientGroup.getCount();
|
||||
|
||||
%clientID = %this.getClientID();
|
||||
if(%clientID && !isObject(%clientID.camera))
|
||||
{
|
||||
%this.scopeToClient(%clientID);
|
||||
%this.setDirty();
|
||||
|
||||
%clientID.setCameraObject(%this.owner);
|
||||
%clientID.setControlCameraFov(%this.FOV);
|
||||
|
||||
%clientID.camera = %this.owner;
|
||||
}
|
||||
|
||||
%res = $pref::Video::mode;
|
||||
%derp = 0;
|
||||
}
|
||||
|
||||
function CameraComponent::onRemove(%this)
|
||||
{
|
||||
%clientID = %this.getClientID();
|
||||
if(%clientID)
|
||||
%clientID.clearCameraObject();
|
||||
}
|
||||
|
||||
function CameraComponent::onInspectorUpdate(%this)
|
||||
{
|
||||
//if(%this.clientOwner)
|
||||
//%this.clientOwner.setCameraObject(%this.owner);
|
||||
}
|
||||
|
||||
function CameraComponent::getClientID(%this)
|
||||
{
|
||||
return ClientGroup.getObject(%this.clientOwner-1);
|
||||
}
|
||||
|
||||
function CameraComponent::isClientCamera(%this, %client)
|
||||
{
|
||||
%clientID = ClientGroup.getObject(%this.clientOwner-1);
|
||||
|
||||
if(%client.getID() == %clientID)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function CameraComponent::onClientConnect(%this, %client)
|
||||
{
|
||||
//if(%this.isClientCamera(%client) && !isObject(%client.camera))
|
||||
//{
|
||||
%this.scopeToClient(%client);
|
||||
%this.setDirty();
|
||||
|
||||
%client.setCameraObject(%this.owner);
|
||||
%client.setControlCameraFov(%this.FOV);
|
||||
|
||||
%client.camera = %this.owner;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// echo("CONNECTED CLIENT IS NOT CAMERA OWNER!");
|
||||
//}
|
||||
}
|
||||
|
||||
function CameraComponent::onClientDisconnect(%this, %client)
|
||||
{
|
||||
Parent::onClientDisconnect(%this, %client);
|
||||
|
||||
if(isClientCamera(%client)){
|
||||
%this.clearScopeToClient(%client);
|
||||
%client.clearCameraObject();
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
|
||||
function VRCameraComponent::onAdd(%this)
|
||||
{
|
||||
%this.addComponentField(clientOwner, "The client that views this camera", "int", "1", "");
|
||||
|
||||
%test = %this.clientOwner;
|
||||
|
||||
%barf = ClientGroup.getCount();
|
||||
|
||||
%clientID = %this.getClientID();
|
||||
if(%clientID && !isObject(%clientID.camera))
|
||||
{
|
||||
%this.scopeToClient(%clientID);
|
||||
%this.setDirty();
|
||||
|
||||
%clientID.setCameraObject(%this.owner);
|
||||
%clientID.setControlCameraFov(%this.FOV);
|
||||
|
||||
%clientID.camera = %this.owner;
|
||||
}
|
||||
|
||||
%res = $pref::Video::mode;
|
||||
%derp = 0;
|
||||
}
|
||||
|
||||
function VRCameraComponent::onRemove(%this)
|
||||
{
|
||||
%clientID = %this.getClientID();
|
||||
if(%clientID)
|
||||
%clientID.clearCameraObject();
|
||||
}
|
||||
|
||||
function CameraComponent::onInspectorUpdate(%this)
|
||||
{
|
||||
//if(%this.clientOwner)
|
||||
//%this.clientOwner.setCameraObject(%this.owner);
|
||||
}
|
||||
|
||||
function VRCameraComponent::getClientID(%this)
|
||||
{
|
||||
return ClientGroup.getObject(%this.clientOwner-1);
|
||||
}
|
||||
|
||||
function VRCameraComponent::isClientCamera(%this, %client)
|
||||
{
|
||||
%clientID = ClientGroup.getObject(%this.clientOwner-1);
|
||||
|
||||
if(%client.getID() == %clientID)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function VRCameraComponent::onClientConnect(%this, %client)
|
||||
{
|
||||
//if(%this.isClientCamera(%client) && !isObject(%client.camera))
|
||||
//{
|
||||
%this.scopeToClient(%client);
|
||||
%this.setDirty();
|
||||
|
||||
%client.setCameraObject(%this.owner);
|
||||
%client.setControlCameraFov(%this.FOV);
|
||||
|
||||
%client.camera = %this.owner;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// echo("CONNECTED CLIENT IS NOT CAMERA OWNER!");
|
||||
//}
|
||||
}
|
||||
|
||||
function VRCameraComponent::onClientDisconnect(%this, %client)
|
||||
{
|
||||
Parent::onClientDisconnect(%this, %client);
|
||||
|
||||
if(isClientCamera(%client)){
|
||||
%this.clearScopeToClient(%client);
|
||||
%client.clearCameraObject();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="ControlObjectComponentAsset"
|
||||
componentName="ControlObjectComponent"
|
||||
componentClass="Component"
|
||||
friendlyName="Control Object"
|
||||
componentType="Game"
|
||||
description="Allows the component owner to be controlled by a client."
|
||||
scriptFile="core/components/components/game/controlObject.cs" />
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="ItemRotationComponentAsset"
|
||||
componentName="ItemRotationComponent"
|
||||
componentClass="Component"
|
||||
friendlyName="Item Rotation"
|
||||
componentType="Game"
|
||||
description="Rotates the entity around an axis, like an item pickup."
|
||||
scriptFile="core/components/components/game/itemRotate.cs" />
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//registerComponent("ItemRotationComponent", "Component", "Item Rotation", "Game", false, "Rotates the entity around the z axis, like an item pickup.");
|
||||
|
||||
function ItemRotationComponent::onAdd(%this)
|
||||
{
|
||||
%this.addComponentField(rotationsPerMinute, "Number of rotations per minute", "float", "5", "");
|
||||
%this.addComponentField(forward, "Rotate forward or backwards", "bool", "1", "");
|
||||
%this.addComponentField(horizontal, "Rotate horizontal or verticle, true for horizontal", "bool", "1", "");
|
||||
}
|
||||
|
||||
function ItemRotationComponent::Update(%this)
|
||||
{
|
||||
%tickRate = 0.032;
|
||||
|
||||
//Rotations per second is calculated based on a standard update tick being 32ms. So we scale by the tick speed, then add that to our rotation to
|
||||
//get a nice rotation speed.
|
||||
if(%this.horizontal)
|
||||
{
|
||||
if(%this.forward)
|
||||
%this.owner.rotation.z += ( ( 360 * %this.rotationsPerMinute ) / 60 ) * %tickRate;
|
||||
else
|
||||
%this.owner.rotation.z -= ( ( 360 * %this.rotationsPerMinute ) / 60 ) * %tickRate;
|
||||
}
|
||||
else
|
||||
{
|
||||
%this.owner.rotation.x += ( ( 360 * %this.rotationsPerMinute ) / 60 ) * %tickRate;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="PlayerSpawnerComponentAsset"
|
||||
componentName="PlayerSpawner"
|
||||
componentClass="Component"
|
||||
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/components/game/playerSpawner.cs" />
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//registerComponent("PlayerSpawner", "Component",
|
||||
// "Player Spawner", "Game", false, "When a client connects, it spawns a player object for them and attaches them to it");
|
||||
|
||||
function PlayerSpawner::onAdd(%this)
|
||||
{
|
||||
%this.clientCount = 1;
|
||||
%this.friendlyName = "Player Spawner";
|
||||
%this.componentType = "Spawner";
|
||||
|
||||
%this.addComponentField("GameObjectName", "The name of the game object we spawn for the players", "gameObject", "PlayerObject");
|
||||
}
|
||||
|
||||
function PlayerSpawner::onClientConnect(%this, %client)
|
||||
{
|
||||
%playerObj = spawnGameObject(%this.GameObjectName, false);
|
||||
|
||||
if(!isObject(%playerObj))
|
||||
return;
|
||||
|
||||
%playerObj.position = %this.owner.position;
|
||||
|
||||
%playerObj.notify("onClientConnect", %client);
|
||||
|
||||
switchControlObject(%client, %playerObj);
|
||||
switchCamera(%client, %playerObj);
|
||||
|
||||
%client.player = %playerObj;
|
||||
%client.camera = %playerObj;
|
||||
|
||||
%inventory = %playerObj.getComponent(InventoryController);
|
||||
|
||||
if(isObject(%inventory))
|
||||
{
|
||||
for(%i=0; %i<5; %i++)
|
||||
{
|
||||
%arrow = spawnGameObject(ArrowProjectile, false);
|
||||
|
||||
%inventory.addItem(%arrow);
|
||||
}
|
||||
}
|
||||
|
||||
%playerObj.position = %this.owner.position;
|
||||
%playerObj.rotation = "0 0 0";
|
||||
|
||||
%this.clientCount++;
|
||||
}
|
||||
|
||||
function PlayerSpawner::onClientDisConnect(%this, %client)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function PlayerSpawner::getClientID(%this)
|
||||
{
|
||||
return ClientGroup.getObject(%this.clientOwner-1);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="FPSControlsComponentAsset"
|
||||
componentName="FPSControls"
|
||||
componentClass="Component"
|
||||
friendlyName="FPS Controls"
|
||||
componentType="Input"
|
||||
description="First Person Shooter-type controls." />
|
||||
|
|
@ -0,0 +1,247 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//registerComponent("FPSControls", "Component", "FPS Controls", "Input", false, "First Person Shooter-type controls");
|
||||
|
||||
function FPSControls::onAdd(%this)
|
||||
{
|
||||
//
|
||||
%this.beginGroup("Keys");
|
||||
%this.addComponentField(forwardKey, "Key to bind to vertical thrust", keybind, "keyboard w");
|
||||
%this.addComponentField(backKey, "Key to bind to vertical thrust", keybind, "keyboard s");
|
||||
%this.addComponentField(leftKey, "Key to bind to horizontal thrust", keybind, "keyboard a");
|
||||
%this.addComponentField(rightKey, "Key to bind to horizontal thrust", keybind, "keyboard d");
|
||||
|
||||
%this.addComponentField(jump, "Key to bind to horizontal thrust", keybind, "keyboard space");
|
||||
%this.endGroup();
|
||||
|
||||
%this.beginGroup("Mouse");
|
||||
%this.addComponentField(pitchAxis, "Key to bind to horizontal thrust", keybind, "mouse yaxis");
|
||||
%this.addComponentField(yawAxis, "Key to bind to horizontal thrust", keybind, "mouse xaxis");
|
||||
%this.endGroup();
|
||||
|
||||
%this.addComponentField(moveSpeed, "Horizontal thrust force", float, 300.0);
|
||||
%this.addComponentField(jumpStrength, "Vertical thrust force", float, 3.0);
|
||||
//
|
||||
|
||||
%control = %this.owner.getComponent( ControlObjectComponent );
|
||||
if(!%control)
|
||||
return echo("SPECTATOR CONTROLS: No Control Object behavior!");
|
||||
|
||||
//%this.Physics = %this.owner.getComponent( PlayerPhysicsComponent );
|
||||
|
||||
//%this.Animation = %this.owner.getComponent( AnimationComponent );
|
||||
|
||||
//%this.Camera = %this.owner.getComponent( MountedCameraComponent );
|
||||
|
||||
//%this.Animation.playThread(0, "look");
|
||||
|
||||
%this.setupControls(%control.getClientID());
|
||||
}
|
||||
|
||||
function FPSControls::onRemove(%this)
|
||||
{
|
||||
Parent::onBehaviorRemove(%this);
|
||||
|
||||
commandToClient(%control.clientOwnerID, 'removeInput', %this.forwardKey);
|
||||
commandToClient(%control.clientOwnerID, 'removeInput', %this.backKey);
|
||||
commandToClient(%control.clientOwnerID, 'removeInput', %this.leftKey);
|
||||
commandToClient(%control.clientOwnerID, 'removeInput', %this.rightKey);
|
||||
|
||||
commandToClient(%control.clientOwnerID, 'removeInput', %this.pitchAxis);
|
||||
commandToClient(%control.clientOwnerID, 'removeInput', %this.yawAxis);
|
||||
}
|
||||
|
||||
function FPSControls::onBehaviorFieldUpdate(%this, %field)
|
||||
{
|
||||
%controller = %this.owner.getBehavior( ControlObjectBehavior );
|
||||
commandToClient(%controller.clientOwnerID, 'updateInput', %this.getFieldValue(%field), %field);
|
||||
}
|
||||
|
||||
function FPSControls::onClientConnect(%this, %client)
|
||||
{
|
||||
%this.setupControls(%client);
|
||||
}
|
||||
|
||||
|
||||
function FPSControls::setupControls(%this, %client)
|
||||
{
|
||||
%control = %this.owner.getComponent( ControlObjectComponent );
|
||||
if(!%control.isControlClient(%client))
|
||||
{
|
||||
echo("FPS CONTROLS: Client Did Not Match");
|
||||
return;
|
||||
}
|
||||
|
||||
%inputCommand = "FPSControls";
|
||||
|
||||
%test = %this.forwardKey;
|
||||
|
||||
/*SetInput(%client, %this.forwardKey.x, %this.forwardKey.y, %inputCommand@"_forwardKey");
|
||||
SetInput(%client, %this.backKey.x, %this.backKey.y, %inputCommand@"_backKey");
|
||||
SetInput(%client, %this.leftKey.x, %this.leftKey.y, %inputCommand@"_leftKey");
|
||||
SetInput(%client, %this.rightKey.x, %this.rightKey.y, %inputCommand@"_rightKey");
|
||||
|
||||
SetInput(%client, %this.jump.x, %this.jump.y, %inputCommand@"_jump");
|
||||
|
||||
SetInput(%client, %this.pitchAxis.x, %this.pitchAxis.y, %inputCommand@"_pitchAxis");
|
||||
SetInput(%client, %this.yawAxis.x, %this.yawAxis.y, %inputCommand@"_yawAxis");*/
|
||||
|
||||
SetInput(%client, "keyboard", "w", %inputCommand@"_forwardKey");
|
||||
SetInput(%client, "keyboard", "s", %inputCommand@"_backKey");
|
||||
SetInput(%client, "keyboard", "a", %inputCommand@"_leftKey");
|
||||
SetInput(%client, "keyboard", "d", %inputCommand@"_rightKey");
|
||||
|
||||
SetInput(%client, "keyboard", "space", %inputCommand@"_jump");
|
||||
|
||||
SetInput(%client, "mouse", "yaxis", %inputCommand@"_pitchAxis");
|
||||
SetInput(%client, "mouse", "xaxis", %inputCommand@"_yawAxis");
|
||||
|
||||
SetInput(%client, "keyboard", "f", %inputCommand@"_flashlight");
|
||||
|
||||
}
|
||||
|
||||
function FPSControls::onMoveTrigger(%this, %triggerID)
|
||||
{
|
||||
//check if our jump trigger was pressed!
|
||||
if(%triggerID == 2)
|
||||
{
|
||||
%this.owner.applyImpulse("0 0 0", "0 0 " @ %this.jumpStrength);
|
||||
}
|
||||
}
|
||||
|
||||
function FPSControls::Update(%this)
|
||||
{
|
||||
return;
|
||||
|
||||
%moveVector = %this.owner.getMoveVector();
|
||||
%moveRotation = %this.owner.getMoveRotation();
|
||||
|
||||
%this.Physics.moveVector = "0 0 0";
|
||||
|
||||
if(%moveVector.x != 0)
|
||||
{
|
||||
%fv = VectorNormalize(%this.owner.getRightVector());
|
||||
|
||||
%forMove = VectorScale(%fv, (%moveVector.x));// * (%this.moveSpeed * 0.032)));
|
||||
|
||||
//%this.Physics.velocity = VectorAdd(%this.Physics.velocity, %forMove);
|
||||
|
||||
%this.Physics.moveVector = VectorAdd(%this.Physics.moveVector, %forMove);
|
||||
|
||||
//if(%forMove > 0)
|
||||
// %this.Animation.playThread(1, "run");
|
||||
}
|
||||
/*else
|
||||
{
|
||||
%fv = VectorNormalize(%this.owner.getRightVector());
|
||||
|
||||
%forMove = VectorScale(%fv, (%moveVector.x * (%this.moveSpeed * 0.032)));
|
||||
|
||||
if(%forMove <= 0)
|
||||
%this.Animation.stopThread(1);
|
||||
|
||||
}*/
|
||||
|
||||
if(%moveVector.y != 0)
|
||||
{
|
||||
%fv = VectorNormalize(%this.owner.getForwardVector());
|
||||
|
||||
%forMove = VectorScale(%fv, (%moveVector.y));// * (%this.moveSpeed * 0.032)));
|
||||
|
||||
//%this.Physics.velocity = VectorAdd(%this.Physics.velocity, %forMove);
|
||||
|
||||
%this.Physics.moveVector = VectorAdd(%this.Physics.moveVector, %forMove);
|
||||
|
||||
//if(VectorLen(%this.Physics.velocity) < 2)
|
||||
// %this.Physics.velocity = VectorAdd(%this.Physics.velocity, %forMove);
|
||||
}
|
||||
|
||||
/*if(%moveVector.z)
|
||||
{
|
||||
%fv = VectorNormalize(%this.owner.getUpVector());
|
||||
|
||||
%forMove = VectorScale(%fv, (%moveVector.z * (%this.moveSpeed * 0.032)));
|
||||
|
||||
%this.Physics.velocity = VectorAdd(%this.Physics.velocity, %forMove);
|
||||
}*/
|
||||
|
||||
if(%moveRotation.x != 0)
|
||||
{
|
||||
%look = mRadToDeg(%moveRotation.x) / 180;
|
||||
|
||||
//%this.Animation.setThreadPos(0, %look);
|
||||
|
||||
%this.owner.getComponent( MountedCameraComponent ).rotationOffset.x += mRadToDeg(%moveRotation.x);
|
||||
|
||||
//%this.Camera.rotationOffset.x += mRadToDeg(%moveRotation.x);
|
||||
}
|
||||
// %this.owner.rotation.x += mRadToDeg(%moveRotation.x);
|
||||
|
||||
if(%moveRotation.z != 0)
|
||||
{
|
||||
%zrot = mRadToDeg(%moveRotation.z);
|
||||
%this.owner.getComponent( MountedCameraComponent ).rotationOffset.z += %zrot;
|
||||
//%this.owner.rotation.z += %zrot;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
function FPSControls_forwardKey(%val)
|
||||
{
|
||||
$mvForwardAction = %val;
|
||||
}
|
||||
|
||||
function FPSControls_backKey(%val)
|
||||
{
|
||||
$mvBackwardAction = %val;
|
||||
}
|
||||
|
||||
function FPSControls_leftKey(%val)
|
||||
{
|
||||
$mvLeftAction = %val;
|
||||
}
|
||||
|
||||
function FPSControls_rightKey(%val)
|
||||
{
|
||||
$mvRightAction = %val;
|
||||
}
|
||||
|
||||
function FPSControls_yawAxis(%val)
|
||||
{
|
||||
$mvYaw += getMouseAdjustAmount(%val);
|
||||
}
|
||||
|
||||
function FPSControls_pitchAxis(%val)
|
||||
{
|
||||
$mvPitch += getMouseAdjustAmount(%val);
|
||||
}
|
||||
|
||||
function FPSControls_jump(%val)
|
||||
{
|
||||
$mvTriggerCount2++;
|
||||
}
|
||||
|
||||
function FPSControls_flashLight(%val)
|
||||
{
|
||||
$mvTriggerCount3++;
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function SetInput(%client, %device, %key, %command, %bindMap, %behav)
|
||||
{
|
||||
commandToClient(%client, 'SetInput', %device, %key, %command, %bindMap, %behav);
|
||||
}
|
||||
|
||||
function RemoveInput(%client, %device, %key, %command, %bindMap)
|
||||
{
|
||||
commandToClient(%client, 'removeInput', %device, %key, %command, %bindMap);
|
||||
}
|
||||
|
||||
function clientCmdSetInput(%device, %key, %command, %bindMap, %behav)
|
||||
{
|
||||
//if we're requesting a custom bind map, set that up
|
||||
if(%bindMap $= "")
|
||||
%bindMap = moveMap;
|
||||
|
||||
if (!isObject(%bindMap)){
|
||||
new ActionMap(moveMap);
|
||||
moveMap.push();
|
||||
}
|
||||
|
||||
//get our local
|
||||
//%localID = ServerConnection.resolveGhostID(%behav);
|
||||
|
||||
//%tmpl = %localID.getTemplate();
|
||||
//%tmpl.insantiateNamespace(%tmpl.getName());
|
||||
|
||||
//first, check if we have an existing command
|
||||
%oldBind = %bindMap.getBinding(%command);
|
||||
if(%oldBind !$= "")
|
||||
%bindMap.unbind(getField(%oldBind, 0), getField(%oldBind, 1));
|
||||
|
||||
//now, set the requested bind
|
||||
%bindMap.bind(%device, %key, %command);
|
||||
}
|
||||
|
||||
function clientCmdRemoveSpecCtrlInput(%device, %key, %bindMap)
|
||||
{
|
||||
//if we're requesting a custom bind map, set that up
|
||||
if(%bindMap $= "")
|
||||
%bindMap = moveMap;
|
||||
|
||||
if (!isObject(%bindMap))
|
||||
return;
|
||||
|
||||
%bindMap.unbind(%device, %key);
|
||||
}
|
||||
|
||||
function clientCmdSetupClientBehavior(%bhvrGstID)
|
||||
{
|
||||
%localID = ServerConnection.resolveGhostID(%bhvrGstID);
|
||||
%tmpl = %localID.getTemplate();
|
||||
%tmpl.insantiateNamespace(%tmpl.getName());
|
||||
}
|
||||
|
||||
function getMouseAdjustAmount(%val)
|
||||
{
|
||||
// based on a default camera FOV of 90'
|
||||
return(%val * ($cameraFov / 90) * 0.01) * $pref::Input::LinkMouseSensitivity;
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="MeshComponentAsset"
|
||||
componentClass="MeshComponent"
|
||||
friendlyName="mesh"
|
||||
componentType="Render"
|
||||
description="Enables an entity to render a shape." />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="PlayerControllerComponentAsset"
|
||||
componentClass="PlayerControllerComponent"
|
||||
friendlyName="Player Controller"
|
||||
componentType="Game"
|
||||
description="Enables an entity to move like a player object." />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="SoundComponentAsset"
|
||||
componentClass="SoundComponent"
|
||||
friendlyName="Sound(Component)"
|
||||
componentType="sound"
|
||||
description="Stores up to 4 sounds for playback." />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="StateMachineComponentAsset"
|
||||
componentClass="StateMachineComponent"
|
||||
friendlyName="State Machine"
|
||||
componentType="Game"
|
||||
description="Enables a state machine on the entity." />
|
||||
|
|
@ -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
Templates/BaseGame/game/core/console/Core_Console.cs
Normal file
|
|
@ -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
Templates/BaseGame/game/core/console/Core_Console.module
Normal file
|
|
@ -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>
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
new GuiControl(ConsoleDlg) {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiConsoleEditCtrl(ConsoleEntry) {
|
||||
profile = "ConsoleTextEditProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "top";
|
||||
position = "0 462";
|
||||
extent = "640 18";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
altCommand = "ConsoleEntry::eval();";
|
||||
helpTag = "0";
|
||||
maxLength = "255";
|
||||
historySize = "40";
|
||||
password = "0";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "1";
|
||||
useSiblingScroller = "1";
|
||||
};
|
||||
new GuiScrollCtrl() {
|
||||
internalName = "Scroll";
|
||||
profile = "ConsoleScrollProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "0 0";
|
||||
extent = "640 462";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOn";
|
||||
vScrollBar = "alwaysOn";
|
||||
lockHorizScroll = "false";
|
||||
lockVertScroll = "false";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiConsole( ConsoleMessageLogView ) {
|
||||
profile = "GuiConsoleProfile";
|
||||
position = "0 0";
|
||||
};
|
||||
};
|
||||
};
|
||||
191
Templates/BaseGame/game/core/console/guis/console.gui
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(ConsoleDlg) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiConsoleEditCtrl(ConsoleEntry) {
|
||||
useSiblingScroller = "1";
|
||||
historySize = "40";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "1";
|
||||
password = "0";
|
||||
passwordMask = "*";
|
||||
maxLength = "255";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "0 750";
|
||||
extent = "1024 18";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "width";
|
||||
vertSizing = "top";
|
||||
profile = "ConsoleTextEditProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
altCommand = "ConsoleEntry::eval();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiContainer() {
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "1 728";
|
||||
extent = "1024 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "top";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiBitmapCtrl() {
|
||||
bitmap = "data/ui/art/hudfill.png";
|
||||
color = "255 255 255 255";
|
||||
wrap = "0";
|
||||
position = "0 0";
|
||||
extent = "1024 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiCheckBoxCtrl(ConsoleDlgErrorFilterBtn) {
|
||||
text = "Errors";
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
position = "2 2";
|
||||
extent = "113 20";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiCheckBoxProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiCheckBoxCtrl(ConsoleDlgWarnFilterBtn) {
|
||||
text = "Warnings";
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
position = "119 2";
|
||||
extent = "113 20";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiCheckBoxProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiCheckBoxCtrl(ConsoleDlgNormalFilterBtn) {
|
||||
text = "Normal Messages";
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
position = "236 2";
|
||||
extent = "113 20";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiCheckBoxProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
new GuiScrollCtrl() {
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOn";
|
||||
vScrollBar = "alwaysOn";
|
||||
lockHorizScroll = "0";
|
||||
lockVertScroll = "0";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
mouseWheelScrollSpeed = "-1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "0 0";
|
||||
extent = "1024 730";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "ConsoleScrollProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "Scroll";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiConsole(ConsoleMessageLogView) {
|
||||
position = "1 1";
|
||||
extent = "622 324";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiConsoleProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
@ -20,9 +20,6 @@
|
|||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
exec("./profiles.cs");
|
||||
exec("./console.gui");
|
||||
|
||||
GlobalActionMap.bind("keyboard", "tilde", "toggleConsole");
|
||||
|
||||
function ConsoleEntry::eval()
|
||||
|
|
@ -99,6 +96,15 @@ function ConsoleDlg::showWindow(%this)
|
|||
%this-->Scroll.setVisible(true);
|
||||
}
|
||||
|
||||
function ConsoleDlg::onWake(%this)
|
||||
{
|
||||
ConsoleDlgErrorFilterBtn.setStateOn(ConsoleMessageLogView.getErrorFilter());
|
||||
ConsoleDlgWarnFilterBtn.setStateOn(ConsoleMessageLogView.getWarnFilter());
|
||||
ConsoleDlgNormalFilterBtn.setStateOn(ConsoleMessageLogView.getNormalFilter());
|
||||
|
||||
ConsoleMessageLogView.refresh();
|
||||
}
|
||||
|
||||
function ConsoleDlg::setAlpha( %this, %alpha)
|
||||
{
|
||||
if (%alpha $= "")
|
||||
|
|
@ -106,3 +112,26 @@ function ConsoleDlg::setAlpha( %this, %alpha)
|
|||
else
|
||||
ConsoleScrollProfile.fillColor = getWords($ConsoleDefaultFillColor, 0, 2) SPC %alpha * 255.0;
|
||||
}
|
||||
|
||||
function ConsoleDlgErrorFilterBtn::onClick(%this)
|
||||
{
|
||||
ConsoleMessageLogView.toggleErrorFilter();
|
||||
}
|
||||
|
||||
function ConsoleDlgWarnFilterBtn::onClick(%this)
|
||||
{
|
||||
|
||||
ConsoleMessageLogView.toggleWarnFilter();
|
||||
}
|
||||
|
||||
function ConsoleDlgNormalFilterBtn::onClick(%this)
|
||||
{
|
||||
ConsoleMessageLogView.toggleNormalFilter();
|
||||
}
|
||||
|
||||
function ConsoleMessageLogView::onNewMessage(%this, %errorCount, %warnCount, %normalCount)
|
||||
{
|
||||
ConsoleDlgErrorFilterBtn.setText("(" @ %errorCount @ ") Errors");
|
||||
ConsoleDlgWarnFilterBtn.setText("(" @ %warnCount @ ") Warnings");
|
||||
ConsoleDlgNormalFilterBtn.setText("(" @ %normalCount @ ") Messages");
|
||||
}
|
||||
11
Templates/BaseGame/game/core/gui/Core_GUI.cs
Normal file
|
|
@ -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
Templates/BaseGame/game/core/gui/Core_GUI.module
Normal file
|
|
@ -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>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 635 B After Width: | Height: | Size: 635 B |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
|
Before Width: | Height: | Size: 778 B After Width: | Height: | Size: 778 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
|
@ -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
Templates/BaseGame/game/core/lighting/Core_Lighting.cs
Normal file
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
@ -39,20 +39,11 @@ $pref::LightManager::sgUseDynamicShadows = "1";
|
|||
$pref::LightManager::sgUseToneMapping = "";
|
||||
*/
|
||||
|
||||
exec( "./shaders.cs" );
|
||||
exec( "./deferredShading.cs" );
|
||||
//exec( "./shaders.cs" );
|
||||
//exec( "./deferredShading.cs" );
|
||||
|
||||
function onActivateAdvancedLM()
|
||||
{
|
||||
// Don't allow the offscreen target on OSX.
|
||||
if ( $platform $= "macos" )
|
||||
return;
|
||||
|
||||
// On the Xbox360 we know what will be enabled so don't do any trickery to
|
||||
// disable MSAA
|
||||
if ( $platform $= "xenon" )
|
||||
return;
|
||||
|
||||
// Enable the offscreen target so that AL will work
|
||||
// with MSAA back buffers and for HDR rendering.
|
||||
AL_FormatToken.enable();
|
||||
|
|
@ -36,7 +36,7 @@ new GFXStateBlockData( AL_VectorLightState )
|
|||
|
||||
samplersDefined = true;
|
||||
samplerStates[0] = SamplerClampPoint; // G-buffer
|
||||
mSamplerNames[0] = "prePassBuffer";
|
||||
mSamplerNames[0] = "deferredBuffer";
|
||||
samplerStates[1] = SamplerClampPoint; // Shadow Map (Do not change this to linear, as all cards can not filter equally.)
|
||||
mSamplerNames[1] = "shadowMap";
|
||||
samplerStates[2] = SamplerClampPoint; // Shadow Map (Do not change this to linear, as all cards can not filter equally.)
|
||||
|
|
@ -66,7 +66,7 @@ new ShaderData( AL_VectorLightShader )
|
|||
OGLVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/gl/farFrustumQuadV.glsl";
|
||||
OGLPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/gl/vectorLightP.glsl";
|
||||
|
||||
samplerNames[0] = "$prePassBuffer";
|
||||
samplerNames[0] = "$deferredBuffer";
|
||||
samplerNames[1] = "$shadowMap";
|
||||
samplerNames[2] = "$dynamicShadowMap";
|
||||
samplerNames[3] = "$ssaoMask";
|
||||
|
|
@ -83,7 +83,7 @@ new CustomMaterial( AL_VectorLightMaterial )
|
|||
shader = AL_VectorLightShader;
|
||||
stateBlock = AL_VectorLightState;
|
||||
|
||||
sampler["prePassBuffer"] = "#deferred";
|
||||
sampler["deferredBuffer"] = "#deferred";
|
||||
sampler["shadowMap"] = "$dynamiclight";
|
||||
sampler["dynamicShadowMap"] = "$dynamicShadowMap";
|
||||
sampler["ssaoMask"] = "#ssaoMask";
|
||||
|
|
@ -114,7 +114,7 @@ new GFXStateBlockData( AL_ConvexLightState )
|
|||
|
||||
samplersDefined = true;
|
||||
samplerStates[0] = SamplerClampPoint; // G-buffer
|
||||
mSamplerNames[0] = "prePassBuffer";
|
||||
mSamplerNames[0] = "deferredBuffer";
|
||||
samplerStates[1] = SamplerClampPoint; // Shadow Map (Do not use linear, these are perspective projections)
|
||||
mSamplerNames[1] = "shadowMap";
|
||||
samplerStates[2] = SamplerClampPoint; // Shadow Map (Do not use linear, these are perspective projections)
|
||||
|
|
@ -143,7 +143,7 @@ new ShaderData( AL_PointLightShader )
|
|||
OGLVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/gl/convexGeometryV.glsl";
|
||||
OGLPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/gl/pointLightP.glsl";
|
||||
|
||||
samplerNames[0] = "$prePassBuffer";
|
||||
samplerNames[0] = "$deferredBuffer";
|
||||
samplerNames[1] = "$shadowMap";
|
||||
samplerNames[2] = "$dynamicShadowMap";
|
||||
samplerNames[3] = "$cookieMap";
|
||||
|
|
@ -160,7 +160,7 @@ new CustomMaterial( AL_PointLightMaterial )
|
|||
shader = AL_PointLightShader;
|
||||
stateBlock = AL_ConvexLightState;
|
||||
|
||||
sampler["prePassBuffer"] = "#deferred";
|
||||
sampler["deferredBuffer"] = "#deferred";
|
||||
sampler["shadowMap"] = "$dynamiclight";
|
||||
sampler["dynamicShadowMap"] = "$dynamicShadowMap";
|
||||
sampler["cookieMap"] = "$dynamiclightmask";
|
||||
|
|
@ -182,7 +182,7 @@ new ShaderData( AL_SpotLightShader )
|
|||
OGLVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/gl/convexGeometryV.glsl";
|
||||
OGLPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/gl/spotLightP.glsl";
|
||||
|
||||
samplerNames[0] = "$prePassBuffer";
|
||||
samplerNames[0] = "$deferredBuffer";
|
||||
samplerNames[1] = "$shadowMap";
|
||||
samplerNames[2] = "$dynamicShadowMap";
|
||||
samplerNames[3] = "$cookieMap";
|
||||
|
|
@ -199,7 +199,7 @@ new CustomMaterial( AL_SpotLightMaterial )
|
|||
shader = AL_SpotLightShader;
|
||||
stateBlock = AL_ConvexLightState;
|
||||
|
||||
sampler["prePassBuffer"] = "#deferred";
|
||||
sampler["deferredBuffer"] = "#deferred";
|
||||
sampler["shadowMap"] = "$dynamiclight";
|
||||
sampler["dynamicShadowMap"] = "$dynamicShadowMap";
|
||||
sampler["cookieMap"] = "$dynamiclightmask";
|
||||
|
|
@ -259,7 +259,7 @@ new ShaderData( AL_ParticlePointLightShader )
|
|||
OGLVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/gl/convexGeometryV.glsl";
|
||||
OGLPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/gl/pointLightP.glsl";
|
||||
|
||||
samplerNames[0] = "$prePassBuffer";
|
||||
samplerNames[0] = "$deferredBuffer";
|
||||
|
||||
pixVersion = 3.0;
|
||||
};
|
||||
|
|
@ -269,7 +269,7 @@ new CustomMaterial( AL_ParticlePointLightMaterial )
|
|||
shader = AL_ParticlePointLightShader;
|
||||
stateBlock = AL_ConvexLightState;
|
||||
|
||||
sampler["prePassBuffer"] = "#deferred";
|
||||
sampler["deferredBuffer"] = "#deferred";
|
||||
target = "lightinfo";
|
||||
|
||||
pixVersion = 3.0;
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
exec( "./shadowFilter.cs" );
|
||||
//exec( "./shadowFilter.cs" );
|
||||
|
||||
singleton GFXStateBlockData( BL_ProjectedShadowSBData )
|
||||
{
|
||||
|
|
@ -35,6 +35,7 @@ new GFXStateBlockData( AL_DeferredShadingState : PFX_DefaultStateBlock )
|
|||
samplerStates[1] = SamplerWrapLinear;
|
||||
samplerStates[2] = SamplerWrapLinear;
|
||||
samplerStates[3] = SamplerWrapLinear;
|
||||
samplerStates[4] = SamplerWrapLinear;
|
||||
};
|
||||
|
||||
new ShaderData( AL_DeferredShader )
|
||||
|
|
@ -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);
|
||||
|
|
@ -1,93 +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";
|
||||
|
||||
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();
|
||||
|
|
@ -1,248 +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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Only load these functions if an Oculus VR device is present
|
||||
if(!isFunction(isOculusVRDeviceActive))
|
||||
return;
|
||||
|
||||
function setupOculusActionMaps()
|
||||
{
|
||||
if (isObject(OculusWarningMap))
|
||||
return;
|
||||
|
||||
new ActionMap(OculusWarningMap);
|
||||
new ActionMap(OculusCanvasMap);
|
||||
|
||||
OculusWarningMap.bind(keyboard, space, dismissOculusVRWarnings);
|
||||
|
||||
OculusCanvasMap.bind( mouse, xaxis, oculusYaw );
|
||||
OculusCanvasMap.bind( mouse, yaxis, oculusPitch );
|
||||
OculusCanvasMap.bind( mouse, button0, oculusClick );
|
||||
}
|
||||
|
||||
function oculusYaw(%val)
|
||||
{
|
||||
OculusCanvas.cursorNudge(%val * 0.10, 0);
|
||||
}
|
||||
|
||||
function oculusPitch(%val)
|
||||
{
|
||||
OculusCanvas.cursorNudge(0, %val * 0.10);
|
||||
}
|
||||
|
||||
function oculusClick(%active)
|
||||
{
|
||||
OculusCanvas.cursorClick(0, %active);
|
||||
}
|
||||
|
||||
function GuiOffscreenCanvas::checkCursor(%this)
|
||||
{
|
||||
%count = %this.getCount();
|
||||
for(%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%control = %this.getObject(%i);
|
||||
if ((%control.noCursor $= "") || !%control.noCursor)
|
||||
{
|
||||
%this.cursorOn();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// If we get here, every control requested a hidden cursor, so we oblige.
|
||||
|
||||
%this.cursorOff();
|
||||
return false;
|
||||
}
|
||||
|
||||
function GuiOffscreenCanvas::pushDialog(%this, %ctrl, %layer, %center)
|
||||
{
|
||||
Parent::pushDialog(%this, %ctrl, %layer, %center);
|
||||
%cursorVisible = %this.checkCursor();
|
||||
|
||||
if (%cursorVisible)
|
||||
{
|
||||
echo("OffscreenCanvas visible");
|
||||
OculusCanvasMap.pop();
|
||||
OculusCanvasMap.push();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo("OffscreenCanvas not visible");
|
||||
OculusCanvasMap.pop();
|
||||
}
|
||||
}
|
||||
|
||||
function GuiOffscreenCanvas::popDialog(%this, %ctrl)
|
||||
{
|
||||
Parent::popDialog(%this, %ctrl);
|
||||
%cursorVisible = %this.checkCursor();
|
||||
|
||||
if (%cursorVisible)
|
||||
{
|
||||
echo("OffscreenCanvas visible");
|
||||
OculusCanvasMap.pop();
|
||||
OculusCanvasMap.push();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo("OffscreenCanvas not visible");
|
||||
OculusCanvasMap.pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function oculusSensorMetricsCallback()
|
||||
{
|
||||
return ovrDumpMetrics(0);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
function onOculusStatusUpdate(%status)
|
||||
{
|
||||
$LastOculusTrackingState = %status;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Call this function from createCanvas() to have the Canvas attach itself
|
||||
// to the Rift's display. The Canvas' window will still open on the primary
|
||||
// display if that is different from the Rift, but it will move to the Rift
|
||||
// when it goes full screen. If the Rift is not connected then nothing
|
||||
// will happen.
|
||||
function pointCanvasToOculusVRDisplay()
|
||||
{
|
||||
$pref::Video::displayOutputDevice = getOVRHMDDisplayDeviceName(0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Call this function from GameConnection::initialControlSet() just before
|
||||
// your "Canvas.setContent(PlayGui);" call, or at any time you wish to switch
|
||||
// to a side-by-side rendering and the appropriate barrel distortion. This
|
||||
// will turn on side-by-side rendering and tell the GameConnection to use the
|
||||
// Rift as its display device.
|
||||
// Parameters:
|
||||
// %gameConnection - The client GameConnection instance
|
||||
// %trueStereoRendering - If true will enable stereo rendering with an eye
|
||||
// offset for each viewport. This will render each frame twice. If false
|
||||
// then a pseudo stereo rendering is done with only a single render per frame.
|
||||
function enableOculusVRDisplay(%gameConnection, %trueStereoRendering)
|
||||
{
|
||||
setOVRHMDAsGameConnectionDisplayDevice(%gameConnection);
|
||||
PlayGui.renderStyle = "stereo side by side";
|
||||
setOptimalOVRCanvasSize(Canvas);
|
||||
|
||||
if (!isObject(OculusCanvas))
|
||||
{
|
||||
new GuiOffscreenCanvas(OculusCanvas) {
|
||||
targetSize = "512 512";
|
||||
targetName = "oculusCanvas";
|
||||
dynamicTarget = true;
|
||||
};
|
||||
}
|
||||
|
||||
if (!isObject(OculusVROverlay))
|
||||
{
|
||||
exec("./oculusVROverlay.gui");
|
||||
}
|
||||
|
||||
OculusCanvas.setContent(OculusVROverlay);
|
||||
OculusCanvas.setCursor(DefaultCursor);
|
||||
PlayGui.setStereoGui(OculusCanvas);
|
||||
OculusCanvas.setCursorPos("128 128");
|
||||
OculusCanvas.cursorOff();
|
||||
$GameCanvas = OculusCanvas;
|
||||
|
||||
%ext = Canvas.getExtent();
|
||||
$OculusMouseScaleX = 512.0 / 1920.0;
|
||||
$OculusMouseScaleY = 512.0 / 1060.0;
|
||||
|
||||
//$gfx::wireframe = true;
|
||||
// Reset all sensors
|
||||
ovrResetAllSensors();
|
||||
}
|
||||
|
||||
// Call this function when ever you wish to turn off the stereo rendering
|
||||
// and barrel distortion for the Rift.
|
||||
function disableOculusVRDisplay(%gameConnection)
|
||||
{
|
||||
OculusCanvas.popDialog();
|
||||
OculusWarningMap.pop();
|
||||
$GameCanvas = Canvas;
|
||||
|
||||
if (isObject(gameConnection))
|
||||
{
|
||||
%gameConnection.clearDisplayDevice();
|
||||
}
|
||||
PlayGui.renderStyle = "standard";
|
||||
}
|
||||
|
||||
// Helper function to set the standard Rift control scheme. You could place
|
||||
// this function in GameConnection::initialControlSet() at the same time
|
||||
// you call enableOculusVRDisplay().
|
||||
function setStandardOculusVRControlScheme(%gameConnection)
|
||||
{
|
||||
if($OculusVR::SimulateInput)
|
||||
{
|
||||
// We are simulating a HMD so allow the mouse and gamepad to control
|
||||
// both yaw and pitch.
|
||||
%gameConnection.setControlSchemeParameters(true, true, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// A HMD is connected so have the mouse and gamepad only add to yaw
|
||||
%gameConnection.setControlSchemeParameters(true, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Helper function to set the resolution for the Rift.
|
||||
// Parameters:
|
||||
// %fullscreen - If true then the display will be forced to full screen. If
|
||||
// pointCanvasToOculusVRDisplay() was called before the Canvas was created, then
|
||||
// the full screen display will appear on the Rift.
|
||||
function setVideoModeForOculusVRDisplay(%fullscreen)
|
||||
{
|
||||
%res = getOVRHMDResolution(0);
|
||||
Canvas.setVideoMode(%res.x, %res.y, %fullscreen, 32, 4);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Reset all Oculus Rift sensors. This will make the Rift's current heading
|
||||
// be considered the origin.
|
||||
function resetOculusVRSensors()
|
||||
{
|
||||
ovrResetAllSensors();
|
||||
}
|
||||
|
||||
function dismissOculusVRWarnings(%value)
|
||||
{
|
||||
//if (%value)
|
||||
//{
|
||||
ovrDismissWarnings();
|
||||
OculusWarningMap.pop();
|
||||
//}
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = singleton GuiControl(OculusVROverlay) {
|
||||
canSaveDynamicFields = "0";
|
||||
Enabled = "1";
|
||||
isContainer = "1";
|
||||
Profile = "GuiContentProfile";
|
||||
HorizSizing = "width";
|
||||
VertSizing = "height";
|
||||
Position = "0 0";
|
||||
Extent = "512 512";
|
||||
MinExtent = "8 8";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
tooltipprofile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
useVariable = "0";
|
||||
tile = "0";
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
33
Templates/BaseGame/game/core/postFX/Core_PostFX.cs
Normal file
|
|
@ -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
Templates/BaseGame/game/core/postFX/Core_PostFX.module
Normal file
|
|
@ -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>
|
||||
|
|
@ -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";
|
||||
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
BIN
Templates/BaseGame/game/core/postFX/images/inactive-overlay.png
Normal file
|
After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |