added everything

This commit is contained in:
Metario
2017-04-17 06:17:10 -06:00
commit 9c6ff74f19
6121 changed files with 1625704 additions and 0 deletions

View File

@ -0,0 +1,43 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Utility remap functions:
//------------------------------------------------------------------------------
function ActionMap::copyBind( %this, %otherMap, %command )
{
if ( !isObject( %otherMap ) )
{
error( "ActionMap::copyBind - \"" @ %otherMap @ "\" is not an object!" );
return;
}
%bind = %otherMap.getBinding( %command );
if ( %bind !$= "" )
{
%device = getField( %bind, 0 );
%action = getField( %bind, 1 );
%flags = %otherMap.isInverted( %device, %action ) ? "SDI" : "SD";
%deadZone = %otherMap.getDeadZone( %device, %action );
%scale = %otherMap.getScale( %device, %action );
%this.bind( %device, %action, %flags, %deadZone, %scale, %command );
}
}
//------------------------------------------------------------------------------
function ActionMap::blockBind( %this, %otherMap, %command )
{
if ( !isObject( %otherMap ) )
{
error( "ActionMap::blockBind - \"" @ %otherMap @ "\" is not an object!" );
return;
}
%bind = %otherMap.getBinding( %command );
if ( %bind !$= "" )
%this.bind( getField( %bind, 0 ), getField( %bind, 1 ), "" );
}

Binary file not shown.

50
example/common/client/audio.cs Executable file
View File

@ -0,0 +1,50 @@
//-----------------------------------------------------------------------------
// Torque Engine
//
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
function OpenALInit()
{
OpenALShutdownDriver();
echo("");
echo("OpenAL Driver Init:");
echo ($pref::Audio::driver);
if($pref::Audio::driver $= "OpenAL")
{
if(!OpenALInitDriver())
{
error(" Failed to initialize driver.");
$Audio::initFailed = true;
} else {
// this should go here
echo(" Vendor: " @ alGetString("AL_VENDOR"));
echo(" Version: " @ alGetString("AL_VERSION"));
echo(" Renderer: " @ alGetString("AL_RENDERER"));
echo(" Extensions: " @ alGetString("AL_EXTENSIONS"));
alxListenerf( AL_GAIN_LINEAR, $pref::Audio::masterVolume );
for (%channel=1; %channel <= 8; %channel++)
alxSetChannelVolume(%channel, $pref::Audio::channelVolume[%channel]);
echo("");
}
}
}
//--------------------------------------------------------------------------
function OpenALShutdown()
{
OpenALShutdownDriver();
//alxStopAll();
//AudioGui.delete();
//sButtonDown.delete();
//sButtonOver.delete();
}

Binary file not shown.

65
example/common/client/canvas.cs Executable file
View File

@ -0,0 +1,65 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Function to construct and initialize the default canvas window
// used by the games
function initCanvas(%windowName, %effectCanvas)
{
videoSetGammaCorrection($pref::OpenGL::gammaCorrection);
if( %effectCanvas )
%canvasCreate = createEffectCanvas( %windowName );
else
%canvasCreate = createCanvas( %windowName );
if( !%canvasCreate )
{
quitWithErrorMessage("Copy of Torque is already running; exiting.");
return;
}
setOpenGLTextureCompressionHint( $pref::OpenGL::compressionHint );
setOpenGLAnisotropy( $pref::OpenGL::textureAnisotropy );
setOpenGLMipReduction( $pref::OpenGL::mipReduction );
setOpenGLInteriorMipReduction( $pref::OpenGL::interiorMipReduction );
setOpenGLSkyMipReduction( $pref::OpenGL::skyMipReduction );
// Declare default GUI Profiles.
exec("~/ui/defaultProfiles.cs");
// Common GUI's
exec("~/ui/ConsoleDlg.gui");
exec("~/ui/LoadFileDlg.gui");
exec("~/ui/ColorPickerDlg.gui");
exec("~/ui/SaveFileDlg.gui");
exec("~/ui/MessageBoxOkDlg.gui");
exec("~/ui/MessageBoxYesNoDlg.gui");
exec("~/ui/MessageBoxOKCancelDlg.gui");
exec("~/ui/MessagePopupDlg.gui");
exec("~/ui/HelpDlg.gui");
exec("~/ui/RecordingsDlg.gui");
exec("~/ui/NetGraphGui.gui");
// Commonly used helper scripts
exec("./metrics.cs");
exec("./messageBox.cs");
exec("./screenshot.cs");
exec("./cursor.cs");
exec("./help.cs");
exec("./recordings.cs");
// Init the audio system
OpenALInit();
}
function resetCanvas()
{
if (isObject(Canvas))
{
Canvas.repaint();
}
}

Binary file not shown.

98
example/common/client/cursor.cs Executable file
View File

@ -0,0 +1,98 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Cursor Control
//------------------------------------------------------------------------------
$cursorControlled = true;
function cursorOff()
{
if ( $cursorControlled )
lockMouse(true);
Canvas.cursorOff();
}
function cursorOn()
{
if ( $cursorControlled )
lockMouse(false);
Canvas.cursorOn();
Canvas.setCursor(DefaultCursor);
}
// In the CanvasCursor package we add some additional functionality to the
// built-in GuiCanvas class, of which the global Canvas object is an instance.
// In this case, the behavior we want is for the cursor to automatically display,
// except when the only guis visible want no cursor - most notably,
// in the case of the example, the play gui.
// In order to override or extend an existing class, we use the script package
// feature.
package CanvasCursor
{
// The checkCursor method iterates through all the root controls on the canvas
// (basically the content control and any visible dialogs). If all of them
// have the .noCursor attribute set, the cursor is turned off, otherwise it is
// turned on.
function GuiCanvas::checkCursor(%this)
{
%cursorShouldBeOn = false;
for(%i = 0; %i < %this.getCount(); %i++)
{
%control = %this.getObject(%i);
if(%control.noCursor == 0)
{
%cursorShouldBeOn = true;
break;
}
}
if(%cursorShouldBeOn != %this.isCursorOn())
{
if(%cursorShouldBeOn)
cursorOn();
else
cursorOff();
}
}
// below, all functions which can alter which content controls are visible
// are extended to call the checkCursor function. For package'd functions,
// the Parent:: call refers to the original implementation of that function,
// or a version that was declared in a previously activated package.
// In this case the parent calls should point to the built in versions
// of GuiCanvas functions.
function GuiCanvas::setContent(%this, %ctrl)
{
Parent::setContent(%this, %ctrl);
%this.checkCursor();
}
function GuiCanvas::pushDialog(%this, %ctrl, %layer)
{
Parent::pushDialog(%this, %ctrl, %layer);
%this.checkCursor();
}
function GuiCanvas::popDialog(%this, %ctrl)
{
Parent::popDialog(%this, %ctrl);
%this.checkCursor();
}
function GuiCanvas::popLayer(%this, %layer)
{
Parent::popLayer(%this, %layer);
%this.checkCursor();
}
};
// activate the package when the script loads.
activatePackage(CanvasCursor);

Binary file not shown.

74
example/common/client/help.cs Executable file
View File

@ -0,0 +1,74 @@
//-----------------------------------------------------------------------------
// Torque Engine
//
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
function HelpDlg::onWake(%this)
{
HelpFileList.entryCount = 0;
HelpFileList.clear();
for(%file = findFirstFile("*.hfl"); %file !$= ""; %file = findNextFile("*.hfl"))
{
HelpFileList.fileName[HelpFileList.entryCount] = %file;
HelpFileList.addRow(HelpFileList.entryCount, fileBase(%file));
HelpFileList.entryCount++;
}
HelpFileList.sortNumerical(0);
for(%i = 0; %i < HelpFileList.entryCount; %i++)
{
%rowId = HelpFileList.getRowId(%i);
%text = HelpFileList.getRowTextById(%rowId);
%text = %i + 1 @ ". " @ restWords(%text);
HelpFileList.setRowById(%rowId, %text);
}
HelpFileList.setSelectedRow(0);
}
function HelpFileList::onSelect(%this, %row)
{
%fo = new FileObject();
%fo.openForRead(%this.fileName[%row]);
%text = "";
while(!%fo.isEOF())
%text = %text @ %fo.readLine() @ "\n";
%fo.delete();
HelpText.setText(%text);
}
function getHelp(%helpName)
{
Canvas.pushDialog(HelpDlg);
if(%helpName !$= "")
{
%index = HelpFileList.findTextIndex(%helpName);
HelpFileList.setSelectedRow(%index);
}
}
function contextHelp()
{
for(%i = 0; %i < Canvas.getCount(); %i++)
{
if(Canvas.getObject(%i).getName() $= HelpDlg)
{
Canvas.popDialog(HelpDlg);
return;
}
}
%content = Canvas.getContent();
%helpPage = %content.getHelpPage();
getHelp(%helpPage);
}
function GuiControl::getHelpPage(%this)
{
return %this.helpPage;
}
function GuiMLTextCtrl::onURL(%this, %url)
{
gotoWebPage( %url );
}

BIN
example/common/client/help.cs.dso Executable file

Binary file not shown.

View File

@ -0,0 +1,79 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Functions that process commands sent from the server.
// This function is for chat messages only; it is invoked on the client when
// the server does a commandToClient with the tag ChatMessage. (Cf. the
// functions chatMessage* in common/server/message.cs.)
// This just invokes onChatMessage, which the mod code must define.
function clientCmdChatMessage(%sender, %voice, %pitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
{
onChatMessage(detag(%msgString), %voice, %pitch);
}
// Game event descriptions, which may or may not include text messages, can be
// sent using the message* functions in common/server/message.cs. Those
// functions do commandToClient with the tag ServerMessage, which invokes the
// function below.
// For ServerMessage messages, the client can install callbacks that will be
// run, according to the "type" of the message.
function clientCmdServerMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
{
// Get the message type; terminates at any whitespace.
%tag = getWord(%msgType, 0);
// First see if there is a callback installed that doesn't have a type;
// if so, that callback is always executed when a message arrives.
for (%i = 0; (%func = $MSGCB["", %i]) !$= ""; %i++) {
call(%func, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
}
// Next look for a callback for this particular type of ServerMessage.
if (%tag !$= "") {
for (%i = 0; (%func = $MSGCB[%tag, %i]) !$= ""; %i++) {
call(%func, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
}
}
}
// Called by the client to install a callback for a particular type of
// ServerMessage.
function addMessageCallback(%msgType, %func)
{
for (%i = 0; (%afunc = $MSGCB[%msgType, %i]) !$= ""; %i++) {
// If it already exists as a callback for this type,
// nothing to do.
if (%afunc $= %func) {
return;
}
}
// Set it up.
$MSGCB[%msgType, %i] = %func;
}
// The following is the callback that will be executed for every ServerMessage,
// because we're going to install it without a specified type. Any type-
// specific callbacks will be executed afterward.
// This just invokes onServerMessage, which the mod code must define.
function defaultMessageCallback(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
{
onServerMessage(detag(%msgString));
}
// Register that default message handler now.
addMessageCallback("", defaultMessageCallback);

Binary file not shown.

View File

@ -0,0 +1,108 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
function MessageCallback(%dlg,%callback)
{
Canvas.popDialog(%dlg);
eval(%callback);
}
// MBSetText resizes the message window, based on the change in size of the text
// area.
function MBSetText(%text, %frame, %msg)
{
%ext = %text.getExtent();
%text.setText("<just:center>" @ %msg);
%text.forceReflow();
%newExtent = %text.getExtent();
%deltaY = getWord(%newExtent, 1) - getWord(%ext, 1);
%windowPos = %frame.getPosition();
%windowExt = %frame.getExtent();
%frame.resize(getWord(%windowPos, 0), getWord(%windowPos, 1) - (%deltaY / 2), getWord(%windowExt, 0), getWord(%windowExt, 1) + %deltaY);
}
//-----------------------------------------------------------------------------
// MessageBox OK
//-----------------------------------------------------------------------------
function MessageBoxOK( %title, %message, %callback )
{
MBOKFrame.setText( %title );
Canvas.pushDialog( MessageBoxOKDlg );
MBSetText(MBOKText, MBOKFrame, %message);
MessageBoxOKDlg.callback = %callback;
}
//------------------------------------------------------------------------------
function MessageBoxOKDlg::onSleep( %this )
{
%this.callback = "";
}
//------------------------------------------------------------------------------
// MessageBox OK/Cancel dialog:
//------------------------------------------------------------------------------
function MessageBoxOKCancel( %title, %message, %callback, %cancelCallback )
{
MBOKCancelFrame.setText( %title );
Canvas.pushDialog( MessageBoxOKCancelDlg );
MBSetText(MBOKCancelText, MBOKCancelFrame, %message);
MessageBoxOKCancelDlg.callback = %callback;
MessageBoxOKCancelDlg.cancelCallback = %cancelCallback;
}
//------------------------------------------------------------------------------
function MessageBoxOKCancelDlg::onSleep( %this )
{
%this.callback = "";
}
//------------------------------------------------------------------------------
// MessageBox Yes/No dialog:
//------------------------------------------------------------------------------
function MessageBoxYesNo( %title, %message, %yesCallback, %noCallback )
{
MBYesNoFrame.setText( %title );
Canvas.pushDialog( MessageBoxYesNoDlg );
MBSetText(MBYesNoText, MBYesNoFrame, %message);
MessageBoxYesNoDlg.yesCallBack = %yesCallback;
MessageBoxYesNoDlg.noCallback = %noCallBack;
}
//------------------------------------------------------------------------------
function MessageBoxYesNoDlg::onSleep( %this )
{
%this.yesCallback = "";
%this.noCallback = "";
}
//------------------------------------------------------------------------------
// Message popup dialog:
//------------------------------------------------------------------------------
function MessagePopup( %title, %message, %delay )
{
// Currently two lines max.
MessagePopFrame.setText( %title );
Canvas.pushDialog( MessagePopupDlg );
MBSetText(MessagePopText, MessagePopFrame, %message);
if ( %delay !$= "" )
schedule( %delay, 0, CloseMessagePopup );
}
//------------------------------------------------------------------------------
function CloseMessagePopup()
{
Canvas.popDialog( MessagePopupDlg );
}

Binary file not shown.

157
example/common/client/metrics.cs Executable file
View File

@ -0,0 +1,157 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
// load gui used to display various metric outputs
exec("~/ui/FrameOverlayGui.gui");
function fpsMetricsCallback()
{
return " FPS: " @ $fps::real @
" mspf: " @ 1000 / $fps::real;
}
function terrainMetricsCallback()
{
return fpsMetricsCallback() @
" Terrain -" @
" L0: " @ $T2::levelZeroCount @
" FMC: " @ $T2::fullMipCount @
" DTC: " @ $T2::dynamicTextureCount @
" UNU: " @ $T2::unusedTextureCount @
" STC: " @ $T2::staticTextureCount @
" DTSU: " @ $T2::textureSpaceUsed @
" STSU: " @ $T2::staticTSU @
" FRB: " @ $T2::FogRejections;
}
function videoMetricsCallback()
{
return fpsMetricsCallback() @
" Video -" @
" TC: " @ $OpenGL::triCount0 + $OpenGL::triCount1 + $OpenGL::triCount2 + $OpenGL::triCount3 @
" PC: " @ $OpenGL::primCount0 + $OpenGL::primCount1 + $OpenGL::primCount2 + $OpenGL::primCount3 @
" T_T: " @ $OpenGL::triCount1 @
" T_P: " @ $OpenGL::primCount1 @
" I_T: " @ $OpenGL::triCount2 @
" I_P: " @ $OpenGL::primCount2 @
" TS_T: " @ $OpenGL::triCount3 @
" TS_P: " @ $OpenGL::primCount3 @
" ?_T: " @ $OpenGL::triCount0 @
" ?_P: " @ $OpenGL::primCount0;
}
function interiorMetricsCallback()
{
return fpsMetricsCallback() @
" Interior --" @
" NTL: " @ $Video::numTexelsLoaded @
" TRP: " @ $Video::texResidentPercentage @
" INP: " @ $Metrics::Interior::numPrimitives @
" INT: " @ $Matrics::Interior::numTexturesUsed @
" INO: " @ $Metrics::Interior::numInteriors;
}
function textureMetricsCallback()
{
return fpsMetricsCallback() @
" Texture --"@
" NTL: " @ $Video::numTexelsLoaded @
" TRP: " @ $Video::texResidentPercentage @
" TCM: " @ $Video::textureCacheMisses;
}
function waterMetricsCallback()
{
return fpsMetricsCallback() @
" Water --"@
" Tri#: " @ $T2::waterTriCount @
" Pnt#: " @ $T2::waterPointCount @
" Hz#: " @ $T2::waterHazePointCount;
}
function timeMetricsCallback()
{
return fpsMetricsCallback() @
" Time -- " @
" Sim Time: " @ getSimTime() @
" Mod: " @ getSimTime() % 32;
}
function vehicleMetricsCallback()
{
return fpsMetricsCallback() @
" Vehicle --"@
" R: " @ $Vehicle::retryCount @
" C: " @ $Vehicle::searchCount @
" P: " @ $Vehicle::polyCount @
" V: " @ $Vehicle::vertexCount;
}
function audioMetricsCallback()
{
return fpsMetricsCallback() @
" Audio --"@
" OH: " @ $Audio::numOpenHandles @
" OLH: " @ $Audio::numOpenLoopingHandles @
" AS: " @ $Audio::numActiveStreams @
" NAS: " @ $Audio::numNullActiveStreams @
" LAS: " @ $Audio::numActiveLoopingStreams @
" LS: " @ $Audio::numLoopingStreams @
" ILS: " @ $Audio::numInactiveLoopingStreams @
" CLS: " @ $Audio::numCulledLoopingStreams;
}
function debugMetricsCallback()
{
return fpsMetricsCallback() @
" Debug --"@
" NTL: " @ $Video::numTexelsLoaded @
" TRP: " @ $Video::texResidentPercentage @
" NP: " @ $Metrics::numPrimitives @
" NT: " @ $Metrics::numTexturesUsed @
" NO: " @ $Metrics::numObjectsRendered;
}
function metrics(%expr)
{
switch$(%expr)
{
case "audio": %cb = "audioMetricsCallback()";
case "debug": %cb = "debugMetricsCallback()";
case "interior":
$fps::virtual = 0;
$Interior::numPolys = 0;
$Interior::numTextures = 0;
$Interior::numTexels = 0;
$Interior::numLightmaps = 0;
$Interior::numLumels = 0;
%cb = "interiorMetricsCallback()";
case "fps": %cb = "fpsMetricsCallback()";
case "time": %cb = "timeMetricsCallback()";
case "terrain": %cb = "terrainMetricsCallback()";
case "texture":
GLEnableMetrics(true);
%cb = "textureMetricsCallback()";
case "video": %cb = "videoMetricsCallback()";
case "vehicle": %cb = "vehicleMetricsCallback()";
case "water": %cb = "waterMetricsCallback()";
}
if (%cb !$= "")
{
Canvas.pushDialog(FrameOverlayGui, 1000);
TextOverlayControl.setValue(%cb);
}
else
{
GLEnableMetrics(false);
Canvas.popDialog(FrameOverlayGui);
}
}

Binary file not shown.

View File

@ -0,0 +1,26 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// Mission start / end events sent from the server
//----------------------------------------------------------------------------
function clientCmdMissionStart(%seq)
{
// The client recieves a mission start right before
// being dropped into the game.
}
function clientCmdMissionEnd(%seq)
{
// Recieved when the current mission is ended.
alxStopAll();
// Disable mission lighting if it's going, this is here
// in case the mission ends while we are in the process
// of loading it.
$lightingMission = false;
$sceneLighting::terminateLighting = true;
}

Binary file not shown.

View File

@ -0,0 +1,110 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// Mission Loading
// Server download handshaking. This produces a number of onPhaseX
// calls so the game scripts can update the game's GUI.
//
// Loading Phases:
// Phase 1: Download Datablocks
// Phase 2: Download Ghost Objects
// Phase 3: Scene Lighting
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// Phase 1
//----------------------------------------------------------------------------
function clientCmdMissionStartPhase1(%seq, %missionName, %musicTrack)
{
// These need to come after the cls.
echo ("*** New Mission: " @ %missionName);
echo ("*** Phase 1: Download Datablocks & Targets");
onMissionDownloadPhase1(%missionName, %musicTrack);
commandToServer('MissionStartPhase1Ack', %seq);
}
function onDataBlockObjectReceived(%index, %total)
{
onPhase1Progress(%index / %total);
}
//----------------------------------------------------------------------------
// Phase 2
//----------------------------------------------------------------------------
function clientCmdMissionStartPhase2(%seq,%missionName)
{
onPhase1Complete();
echo ("*** Phase 2: Download Ghost Objects");
purgeResources();
onMissionDownloadPhase2(%missionName);
commandToServer('MissionStartPhase2Ack', %seq);
}
function onGhostAlwaysStarted(%ghostCount)
{
$ghostCount = %ghostCount;
$ghostsRecvd = 0;
}
function onGhostAlwaysObjectReceived()
{
$ghostsRecvd++;
onPhase2Progress($ghostsRecvd / $ghostCount);
}
//----------------------------------------------------------------------------
// Phase 3
//----------------------------------------------------------------------------
function clientCmdMissionStartPhase3(%seq,%missionName)
{
onPhase2Complete();
StartClientReplication();
StartFoliageReplication();
echo ("*** Phase 3: Mission Lighting");
$MSeq = %seq;
$Client::MissionFile = %missionName;
// Need to light the mission before we are ready.
// The sceneLightingComplete function will complete the handshake
// once the scene lighting is done.
if (lightScene("sceneLightingComplete", ""))
{
error("Lighting mission....");
schedule(1, 0, "updateLightingProgress");
onMissionDownloadPhase3(%missionName);
$lightingMission = true;
}
}
function updateLightingProgress()
{
onPhase3Progress($SceneLighting::lightingProgress);
if ($lightingMission)
$lightingProgressThread = schedule(1, 0, "updateLightingProgress");
}
function sceneLightingComplete()
{
echo("Mission lighting done");
onPhase3Complete();
// The is also the end of the mission load cycle.
onMissionDownloadComplete();
commandToServer('MissionStartPhase3Ack', $MSeq);
}
//----------------------------------------------------------------------------
// Helper functions
//----------------------------------------------------------------------------
function connect(%server)
{
%conn = new GameConnection();
%conn.connect(%server);
}

Binary file not shown.

126
example/common/client/prefs.cs Executable file
View File

@ -0,0 +1,126 @@
$pref::Audio::channelVolume1 = 0.8;
$pref::Audio::channelVolume2 = 0.8;
$pref::Audio::channelVolume3 = 0.8;
$pref::Audio::channelVolume4 = 0.8;
$pref::Audio::channelVolume5 = 0.8;
$pref::Audio::channelVolume6 = 0.8;
$pref::Audio::channelVolume7 = 0.8;
$pref::Audio::channelVolume8 = 0.8;
$pref::Audio::driver = "OpenAL";
$pref::Audio::environmentEnabled = 0;
$pref::Audio::forceMaxDistanceUpdate = 0;
$pref::Audio::masterVolume = 0.8;
$pref::backgroundSleepTime = "3000";
$pref::ChatHudLength = 1;
$pref::CloudsOn = "1";
$pref::Console::extent = "500 300";
$pref::Console::position = "0 0";
$pref::Decal::decalTimeout = "5000";
$pref::Decal::maxNumDecals = "256";
$pref::decalsOn = "1";
$pref::Editor::visibleDistance = "2100";
$pref::enableBadWordFilter = "1";
$pref::environmentMaps = "1";
$pref::HudMessageLogSize = 40;
$pref::Input::JoystickEnabled = "0";
$pref::Input::KeyboardEnabled = "1";
$pref::Input::KeyboardTurnSpeed = 0.1;
$pref::Input::LinkMouseSensitivity = 1;
$pref::Input::MouseEnabled = "1";
$pref::Interior::detailAdjust = "1";
$pref::Interior::DynamicLights = "1";
$pref::Interior::LightUpdatePeriod = "66";
$pref::Interior::lockArrays = "1";
$pref::Interior::sgDetailMaps = "1";
$pref::Interior::ShowEnvironmentMaps = "1";
$pref::Interior::TexturedFog = "0";
$pref::Interior::VertexLighting = "0";
$pref::LightManager::sgBlendedTerrainDynamicLighting = "1";
$pref::LightManager::sgDynamicLightingOcclusionQuality = "1";
$pref::LightManager::sgDynamicParticleSystemLighting = "1";
$pref::LightManager::sgDynamicShadowQuality = "0";
$pref::LightManager::sgLightingProfileAllowShadows = "1";
$pref::LightManager::sgLightingProfileQuality = "0";
$pref::LightManager::sgMaxBestLights = "10";
$pref::LightManager::sgMultipleDynamicShadows = "1";
$pref::LightManager::sgUseDynamicShadows = "1";
$pref::Master0 = "2:master.garagegames.com:28002";
$Pref::Net::LagThreshold = "400";
$pref::Net::PacketRateToClient = "10";
$pref::Net::PacketRateToServer = "32";
$pref::Net::PacketSize = "200";
$pref::NumCloudLayers = "3";
$pref::OpenGL::allowCompression = "0";
$pref::OpenGL::allowTexGen = "1";
$pref::OpenGL::disableARBMultitexture = "0";
$pref::OpenGL::disableARBTextureCompression = "0";
$pref::OpenGL::disableEXTCompiledVertexArray = "0";
$pref::OpenGL::disableEXTFogCoord = "0";
$pref::OpenGL::disableEXTPalettedTexture = "0";
$pref::OpenGL::disableEXTTexEnvCombine = "0";
$pref::OpenGL::disableSubImage = "0";
$pref::OpenGL::force16BitTexture = "0";
$pref::OpenGL::forcePalettedTexture = "0";
$pref::OpenGL::gammaCorrection = "0.5";
$pref::OpenGL::maxHardwareLights = 3;
$pref::OpenGL::noDrawArraysAlpha = "0";
$pref::OpenGL::noEnvColor = "0";
$pref::OpenGL::textureAnisotropy = "0";
$pref::OpenGL::textureTrilinear = "0";
$pref::Player::defaultFov = 90;
$pref::Player::Name = "Test Guy";
$pref::Player::renderMyItems = "1";
$pref::Player::renderMyPlayer = "1";
$pref::Player::zoomSpeed = 0;
$Pref::ResourceManager::excludedDirectories = ".svn;CVS";
$pref::sceneLighting::cacheLighting = 1;
$pref::sceneLighting::cacheSize = 20000;
$pref::sceneLighting::purgeMethod = "lastCreated";
$pref::sceneLighting::terrainGenerateLevel = 1;
$Pref::Server::AdminPassword = "";
$Pref::Server::ConnectionError = "You do not have the correct version of the Torque Game Engine or the related art needed to connect to this server, please contact the server operator to obtain the latest version of this game.";
$Pref::Server::FloodProtectionEnabled = 1;
$Pref::Server::Info = "This is a Torque Game Engine Test Server.";
$Pref::Server::MaxChatLen = 120;
$Pref::Server::MaxPlayers = 64;
$Pref::Server::Name = "Torque TTB Server";
$Pref::Server::Password = "";
$Pref::Server::Port = 28000;
$Pref::Server::RegionMask = 2;
$pref::shadows = "2";
$pref::SkyOn = "1";
$pref::Terrain::dynamicLights = "1";
$pref::Terrain::enableDetails = "1";
$pref::Terrain::enableEmbossBumps = "1";
$pref::Terrain::screenError = "4";
$pref::Terrain::texDetail = "0";
$pref::Terrain::textureCacheSize = "512";
$pref::timeManagerProcessInterval = "0";
$pref::TS::autoDetail = "1";
$pref::TS::detailAdjust = "1";
$pref::TS::fogTexture = "0";
$pref::TS::screenError = "5";
$pref::TS::skipFirstFog = "0";
$pref::TS::skipLoadDLs = "0";
$pref::TS::skipRenderDLs = "0";
$pref::TS::UseTriangles = "0";
$pref::Video::allowD3D = "1";
$pref::Video::allowOpenGL = "1";
$pref::Video::appliedPref = "1";
$pref::Video::clipHigh = "0";
$pref::Video::defaultsRenderer = "ATI Radeon HD 4800 Series";
$pref::Video::defaultsVendor = "ATI Technologies Inc.";
$pref::Video::deleteContext = "1";
$pref::Video::disableVerticalSync = 1;
$pref::Video::displayDevice = "OpenGL";
$pref::Video::fullScreen = "0";
$pref::Video::monitorNum = 0;
$pref::Video::only16 = "0";
$pref::Video::preferOpenGL = "1";
$pref::Video::profiledRenderer = "ATI Radeon HD 4800 Series";
$pref::Video::profiledVendor = "ATI Technologies Inc.";
$pref::Video::resolution = "800 600 32";
$pref::Video::safeModeOn = "1";
$pref::Video::screenShotFormat = "PNG";
$pref::Video::windowedRes = "800 600";
$pref::visibleDistanceMod = "1";

View File

@ -0,0 +1,111 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// RecordingsGui is the main TSControl through which the a demo game recording
// is viewed.
//-----------------------------------------------------------------------------
function recordingsDlg::onWake()
{
RecordingsDlgList.clear();
%i = 0;
%filespec = $currentMod @ "/recordings/*.rec";
echo(%filespec);
for(%file = findFirstFile(%filespec); %file !$= ""; %file = findNextFile(%filespec))
{
%fileName = fileBase(%file);
if (strStr(%file, "/CVS/") == -1)
{
RecordingsDlgList.addRow(%i++, %fileName);
}
}
RecordingsDlgList.sort(0);
RecordingsDlgList.setSelectedRow(0);
RecordingsDlgList.scrollVisible(0);
}
function StartSelectedDemo()
{
// first unit is filename
%sel = RecordingsDlgList.getSelectedId();
%rowText = RecordingsDlgList.getRowTextById(%sel);
%file = $currentMod @ "/recordings/" @ getField(%rowText, 0) @ ".rec";
new GameConnection(ServerConnection);
RootGroup.add(ServerConnection);
if(ServerConnection.playDemo(%file))
{
Canvas.setContent(PlayGui);
Canvas.popDialog(RecordingsDlg);
ServerConnection.prepDemoPlayback();
}
else
{
MessageBoxOK("Playback Failed", "Demo playback failed for file '" @ %file @ "'.");
if (isObject(ServerConnection)) {
ServerConnection.delete();
}
}
}
function startDemoRecord()
{
// make sure that current recording stream is stopped
ServerConnection.stopRecording();
// make sure we aren't playing a demo
if(ServerConnection.isDemoPlaying())
return;
for(%i = 0; %i < 1000; %i++)
{
%num = %i;
if(%num < 10)
%num = "0" @ %num;
if(%num < 100)
%num = "0" @ %num;
%file = $currentMod @ "/recordings/demo" @ %num @ ".rec";
if(!isfile(%file))
break;
}
if(%i == 1000)
return;
$DemoFileName = %file;
ChatHud.AddLine( "\c4Recording to file [\c2" @ $DemoFileName @ "\cr].");
ServerConnection.prepDemoRecord();
ServerConnection.startRecording($DemoFileName);
// make sure start worked
if(!ServerConnection.isDemoRecording())
{
deleteFile($DemoFileName);
ChatHud.AddLine( "\c3 *** Failed to record to file [\c2" @ $DemoFileName @ "\cr].");
$DemoFileName = "";
}
}
function stopDemoRecord()
{
// make sure we are recording
if(ServerConnection.isDemoRecording())
{
ChatHud.AddLine( "\c4Recording file [\c2" @ $DemoFileName @ "\cr] finished.");
ServerConnection.stopRecording();
}
}
function demoPlaybackComplete()
{
disconnect();
Canvas.setContent("MainMenuGui");
Canvas.pushDialog(RecordingsDlg);
}

Binary file not shown.

View File

@ -0,0 +1,80 @@
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
function formatImageNumber(%number)
{
if(%number < 10)
%number = "0" @ %number;
if(%number < 100)
%number = "0" @ %number;
if(%number < 1000)
%number = "0" @ %number;
if(%number < 10000)
%number = "0" @ %number;
return %number;
}
function formatSessionNumber(%number)
{
if(%number < 10)
%number = "0" @ %number;
if(%number < 100)
%number = "0" @ %number;
return %number;
}
//----------------------------------------
function recordMovie(%movieName, %fps)
{
$timeAdvance = 1000 / %fps;
$screenGrabThread = schedule($timeAdvance,0,movieGrabScreen,%movieName,0);
}
function movieGrabScreen(%movieName, %frameNumber)
{
screenshot(%movieName @ formatImageNumber(%frameNumber) @ ".png", "PNG");
$screenGrabThread = schedule($timeAdvance, 0, movieGrabScreen, %movieName, %frameNumber + 1);
}
function stopMovie()
{
$timeAdvance = 0;
cancel($screenGrabThread);
}
//----------------------------------------
$screenshotNumber = 0;
function doScreenShot( %val )
{
if (%val)
{
if ($pref::Video::screenShotSession $= "")
$pref::Video::screenShotSession = 0;
if ($screenshotNumber == 0)
$pref::Video::screenShotSession++;
if ($pref::Video::screenShotSession > 999)
$pref::Video::screenShotSession = 1;
$pref::interior::showdetailmaps = false;
$name = "screenshot_" @ formatSessionNumber($pref::Video::screenShotSession) @ "-" @ formatImageNumber($screenshotNumber++);
if($pref::Video::screenShotFormat $= "JPEG")
screenShot($name @ ".jpg", "JPEG");
else
if($pref::Video::screenShotFormat $= "PNG")
screenShot($name @ ".png", "PNG");
else
screenShot($name @ ".png", "PNG");
}
}
// bind key to take screenshots
GlobalActionMap.bind(keyboard, "ctrl p", doScreenShot);

Binary file not shown.

View File

@ -0,0 +1,19 @@
//-----------------------------------------------------------------------------
// Torque Engine
//
// Copyright (c) 2001 GarageGames.Com
//-----------------------------------------------------------------------------
// Writes out all script functions to a file
function writeOutFunctions() {
new ConsoleLogger( logger, "scriptFunctions.txt", false );
dumpConsoleFunctions();
logger.delete();
}
// Writes out all script classes to a file
function writeOutClasses() {
new ConsoleLogger( logger, "scriptClasses.txt", false );
dumpConsoleClasses();
logger.delete();
}