From 170cdadf6000a55f2f3f4fab6bb0fcd659aaa599 Mon Sep 17 00:00:00 2001 From: Areloch Date: Thu, 22 Dec 2016 00:52:34 -0600 Subject: [PATCH 01/26] Fixes window icons with SDL, hooking it through the var $Core::windowIcon as the path. Also adjusted the splash window icon to use the var $Core::splashWindowImage for it's path. --- Engine/source/console/consoleFunctions.cpp | 7 ++- .../source/windowManager/sdl/sdlWindowMgr.cpp | 46 +++++++++++++++++++ Templates/Empty/game/main.cs | 2 + Templates/Full/game/main.cs | 2 + 4 files changed, 56 insertions(+), 1 deletion(-) diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index 7f8fbf1c0..76b3f3d9f 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -2141,13 +2141,18 @@ DefineEngineFunction( gotoWebPage, void, ( const char* address ),, //----------------------------------------------------------------------------- -DefineEngineFunction( displaySplashWindow, bool, (const char* path), ("art/gui/splash.bmp"), +DefineEngineFunction( displaySplashWindow, bool, (const char* path), (""), "Display a startup splash window suitable for showing while the engine still starts up.\n\n" "@note This is currently only implemented on Windows.\n\n" "@param path relative path to splash screen image to display.\n" "@return True if the splash window could be successfully initialized.\n\n" "@ingroup Platform" ) { + if (path == "") + { + path = Con::getVariable("$Core::splashWindowImage"); + } + return Platform::displaySplashWindow(path); } diff --git a/Engine/source/windowManager/sdl/sdlWindowMgr.cpp b/Engine/source/windowManager/sdl/sdlWindowMgr.cpp index 9dbe1708d..6157374dd 100644 --- a/Engine/source/windowManager/sdl/sdlWindowMgr.cpp +++ b/Engine/source/windowManager/sdl/sdlWindowMgr.cpp @@ -24,6 +24,7 @@ #include "gfx/gfxDevice.h" #include "core/util/journal/process.h" #include "core/strings/unicode.h" +#include "gfx/bitmap/gBitmap.h" #include "SDL.h" @@ -165,6 +166,51 @@ PlatformWindow *PlatformWindowManagerSDL::createWindow(GFXDevice *device, const window->mOwningManager = this; mWindowMap[ window->mWindowId ] = window; + //Now, fetch our window icon, if any + Torque::Path iconPath = Torque::Path(Con::getVariable( "$Core::windowIcon" )); + Resource bmp = GBitmap::load(iconPath); + if (bmp != NULL) + { + U32 pitch; + U32 width = bmp->getWidth(); + bool hasAlpha = bmp->getHasTransparency(); + U32 depth; + + if (hasAlpha) + { + pitch = 4 * width; + depth = 32; + } + else + { + pitch = 3 * width; + depth = 24; + } + + Uint32 rmask, gmask, bmask, amask; + if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + { + S32 shift = hasAlpha ? 8 : 0; + rmask = 0xff000000 >> shift; + gmask = 0x00ff0000 >> shift; + bmask = 0x0000ff00 >> shift; + amask = 0x000000ff >> shift; + } + else + { + rmask = 0x000000ff; + gmask = 0x0000ff00; + bmask = 0x00ff0000; + amask = hasAlpha ? 0xff000000 : 0; + } + + SDL_Surface* iconSurface = SDL_CreateRGBSurfaceFrom(bmp->getAddress(0, 0), bmp->getWidth(), bmp->getHeight(), depth, pitch, rmask, gmask, bmask, amask); + + SDL_SetWindowIcon(window->mWindowHandle, iconSurface); + + SDL_FreeSurface(iconSurface); + } + if(device) { window->mDevice = device; diff --git a/Templates/Empty/game/main.cs b/Templates/Empty/game/main.cs index 22a3ab2ff..87daf9770 100644 --- a/Templates/Empty/game/main.cs +++ b/Templates/Empty/game/main.cs @@ -28,6 +28,8 @@ $defaultGame = "scripts"; // Set profile directory $Pref::Video::ProfilePath = "core/profile"; +$Core::windowIcon = "core/torque.png"; +$Core::splashWindowImage = "art/gui/splash.bmp"; function createCanvas(%windowTitle) { diff --git a/Templates/Full/game/main.cs b/Templates/Full/game/main.cs index 2a261201d..d4a6656e0 100644 --- a/Templates/Full/game/main.cs +++ b/Templates/Full/game/main.cs @@ -28,6 +28,8 @@ $defaultGame = "scripts"; // Set profile directory $Pref::Video::ProfilePath = "core/profile"; +$Core::windowIcon = "core/torque.png"; +$Core::splashWindowImage = "art/gui/splash.bmp"; function createCanvas(%windowTitle) { From 5e47c018b2f8ea5dacb42a0bc3fdbabca361e5d2 Mon Sep 17 00:00:00 2001 From: Johxz Date: Sun, 1 Jan 2017 21:40:41 -0600 Subject: [PATCH 02/26] enable video recording --- .../game/core/scripts/client/screenshot.cs | 15 +++++++ .../Empty/game/scripts/client/default.bind.cs | 43 +++++++++++++++++++ .../game/core/scripts/client/screenshot.cs | 15 +++++++ .../Full/game/scripts/client/default.bind.cs | 43 +++++++++++++++++++ 4 files changed, 116 insertions(+) diff --git a/Templates/Empty/game/core/scripts/client/screenshot.cs b/Templates/Empty/game/core/scripts/client/screenshot.cs index 897325a1a..3c78aa2cd 100644 --- a/Templates/Empty/game/core/scripts/client/screenshot.cs +++ b/Templates/Empty/game/core/scripts/client/screenshot.cs @@ -55,6 +55,9 @@ function formatSessionNumber(%number) // Records a movie file from the Canvas content using the specified fps. // Possible encoder values are "PNG" and "THEORA" (default). //--------------------------------------------------------------------------------------------- + +$RecordingMovie = false; + function recordMovie(%movieName, %fps, %encoder) { // If the canvas doesn't exist yet, setup a flag so it'll @@ -65,12 +68,24 @@ function recordMovie(%movieName, %fps, %encoder) if (%encoder $= "") %encoder = "THEORA"; %resolution = Canvas.getVideoMode(); + + // Start the movie recording + ChatHud.AddLine( "\c4Recording movie file to [\c2" @ %movieName @ "\cr].ogv."); + echo("Recording movie to: " @ %movieName); startVideoCapture(Canvas, %movieName, %encoder, %fps); + + $RecordingMovie = true; } function stopMovie() { + // Stop the current recording + ChatHud.AddLine( "\c4Recording movie file finished."); + echo("Stopped movie recording"); + stopVideoCapture(); + + $RecordingMovie = false; } /// This is bound in initializeCommon() to take diff --git a/Templates/Empty/game/scripts/client/default.bind.cs b/Templates/Empty/game/scripts/client/default.bind.cs index 51dc53d4b..b4216a33d 100644 --- a/Templates/Empty/game/scripts/client/default.bind.cs +++ b/Templates/Empty/game/scripts/client/default.bind.cs @@ -409,6 +409,49 @@ function stopRecordingDemo( %val ) moveMap.bind( keyboard, F3, startRecordingDemo ); moveMap.bind( keyboard, F4, stopRecordingDemo ); +//------------------------------------------------------------------------------ +// Theora Video Capture (Records a movie file) +//------------------------------------------------------------------------------ + +function toggleMovieRecording(%val) +{ + if (!%val) + return; + + %movieEncodingType = "THEORA"; // Valid encoder values are "PNG" and "THEORA" (default). + %movieFPS = 30; // video capture frame rate. + + if (!$RecordingMovie) + { + // locate a non-existent filename to use + for(%i = 0; %i < 1000; %i++) + { + %num = %i; + if(%num < 10) + %num = "0" @ %num; + if(%num < 100) + %num = "0" @ %num; + + %filePath = "movies/movie" @ %num; + if(!isfile(%filePath)) + break; + } + if(%i == 1000) + return; + + // Start the movie recording + recordMovie(%filePath, %movieFPS, %movieEncodingType); + + } + else + { + // Stop the current recording + stopMovie(); + } +} + +// Key binding works at any time and not just while in a game. +GlobalActionMap.bind(keyboard, "alt m", toggleMovieRecording); //------------------------------------------------------------------------------ // Helper Functions diff --git a/Templates/Full/game/core/scripts/client/screenshot.cs b/Templates/Full/game/core/scripts/client/screenshot.cs index 897325a1a..3c78aa2cd 100644 --- a/Templates/Full/game/core/scripts/client/screenshot.cs +++ b/Templates/Full/game/core/scripts/client/screenshot.cs @@ -55,6 +55,9 @@ function formatSessionNumber(%number) // Records a movie file from the Canvas content using the specified fps. // Possible encoder values are "PNG" and "THEORA" (default). //--------------------------------------------------------------------------------------------- + +$RecordingMovie = false; + function recordMovie(%movieName, %fps, %encoder) { // If the canvas doesn't exist yet, setup a flag so it'll @@ -65,12 +68,24 @@ function recordMovie(%movieName, %fps, %encoder) if (%encoder $= "") %encoder = "THEORA"; %resolution = Canvas.getVideoMode(); + + // Start the movie recording + ChatHud.AddLine( "\c4Recording movie file to [\c2" @ %movieName @ "\cr].ogv."); + echo("Recording movie to: " @ %movieName); startVideoCapture(Canvas, %movieName, %encoder, %fps); + + $RecordingMovie = true; } function stopMovie() { + // Stop the current recording + ChatHud.AddLine( "\c4Recording movie file finished."); + echo("Stopped movie recording"); + stopVideoCapture(); + + $RecordingMovie = false; } /// This is bound in initializeCommon() to take diff --git a/Templates/Full/game/scripts/client/default.bind.cs b/Templates/Full/game/scripts/client/default.bind.cs index 1af881a81..ed804bbb2 100644 --- a/Templates/Full/game/scripts/client/default.bind.cs +++ b/Templates/Full/game/scripts/client/default.bind.cs @@ -583,6 +583,49 @@ function stopRecordingDemo( %val ) moveMap.bind( keyboard, F3, startRecordingDemo ); moveMap.bind( keyboard, F4, stopRecordingDemo ); +//------------------------------------------------------------------------------ +// Theora Video Capture (Records a movie file) +//------------------------------------------------------------------------------ + +function toggleMovieRecording(%val) +{ + if (!%val) + return; + + %movieEncodingType = "THEORA"; // Valid encoder values are "PNG" and "THEORA" (default). + %movieFPS = 30; // video capture frame rate. + + if (!$RecordingMovie) + { + // locate a non-existent filename to use + for(%i = 0; %i < 1000; %i++) + { + %num = %i; + if(%num < 10) + %num = "0" @ %num; + if(%num < 100) + %num = "0" @ %num; + + %filePath = "movies/movie" @ %num; + if(!isfile(%filePath)) + break; + } + if(%i == 1000) + return; + + // Start the movie recording + recordMovie(%filePath, %movieFPS, %movieEncodingType); + + } + else + { + // Stop the current recording + stopMovie(); + } +} + +// Key binding works at any time and not just while in a game. +GlobalActionMap.bind(keyboard, "alt m", toggleMovieRecording); //------------------------------------------------------------------------------ // Helper Functions From bfa2b5e9638b8f915303476e8dde999ded4fe13d Mon Sep 17 00:00:00 2001 From: Azaezel Date: Tue, 10 Jan 2017 08:02:08 -0600 Subject: [PATCH 03/26] adress #1914 --- Engine/source/renderInstance/renderMeshMgr.cpp | 2 +- Engine/source/renderInstance/renderPrePassMgr.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/renderInstance/renderMeshMgr.cpp b/Engine/source/renderInstance/renderMeshMgr.cpp index 476c5e9b8..ce27a09c2 100644 --- a/Engine/source/renderInstance/renderMeshMgr.cpp +++ b/Engine/source/renderInstance/renderMeshMgr.cpp @@ -245,7 +245,7 @@ void RenderMeshMgr::render(SceneRenderState * state) if ( passRI->accuTex != lastAccuTex ) { sgData.accuTex = passRI->accuTex; - lastAccuTex = lastAccuTex; + lastAccuTex = passRI->accuTex; dirty = true; } diff --git a/Engine/source/renderInstance/renderPrePassMgr.cpp b/Engine/source/renderInstance/renderPrePassMgr.cpp index 2c3f2c4c2..23e44f6ed 100644 --- a/Engine/source/renderInstance/renderPrePassMgr.cpp +++ b/Engine/source/renderInstance/renderPrePassMgr.cpp @@ -480,7 +480,7 @@ void RenderPrePassMgr::render( SceneRenderState *state ) if (passRI->accuTex != lastAccuTex) { sgData.accuTex = passRI->accuTex; - lastAccuTex = lastAccuTex; + lastAccuTex = passRI->accuTex; dirty = true; } From bcc5459818e6c57decbd68af4cf55f299ffad93c Mon Sep 17 00:00:00 2001 From: "Thomas \"elfprince13\" Dickerson" Date: Wed, 11 Jan 2017 23:34:46 -0500 Subject: [PATCH 04/26] whitespace --- Engine/source/console/fieldBrushObject.cpp | 24 +- Engine/source/console/fileSystemFunctions.cpp | 150 ++-- Engine/source/console/persistenceManager.cpp | 62 +- Engine/source/console/scriptFilename.cpp | 22 +- Engine/source/console/scriptObjects.cpp | 84 +-- Engine/source/console/sim.cpp | 22 +- Engine/source/console/simDictionary.cpp | 8 +- Engine/source/console/simDictionary.h | 2 +- Engine/source/console/simEvents.cpp | 8 +- Engine/source/console/simManager.cpp | 10 +- Engine/source/console/simObject.cpp | 20 +- Engine/source/console/simObject.h | 2 +- Engine/source/console/simObjectMemento.cpp | 46 +- Engine/source/console/simObjectMemento.h | 2 +- Engine/source/console/simPersistSet.cpp | 14 +- Engine/source/console/simSerialize.cpp | 14 +- Engine/source/console/stringStack.cpp | 2 +- Engine/source/console/telnetConsole.cpp | 12 +- Engine/source/console/telnetDebugger.cpp | 30 +- Engine/source/console/typeValidators.cpp | 56 +- Engine/source/environment/river.cpp | 228 +++---- Engine/source/gfx/gl/gfxGLStateBlock.cpp | 32 +- Engine/source/gfx/video/videoCapture.cpp | 2 +- .../source/gui/buttons/guiIconButtonCtrl.cpp | 32 +- .../gui/buttons/guiToggleButtonCtrl.cpp | 2 +- Engine/source/gui/containers/guiFormCtrl.cpp | 2 +- Engine/source/gui/containers/guiPaneCtrl.cpp | 16 +- .../source/gui/containers/guiRolloutCtrl.cpp | 14 +- .../source/gui/containers/guiWindowCtrl.cpp | 16 +- Engine/source/gui/controls/guiListBoxCtrl.cpp | 134 ++-- Engine/source/gui/controls/guiMLTextCtrl.cpp | 52 +- Engine/source/gui/controls/guiPopUpCtrl.cpp | 162 ++--- Engine/source/gui/controls/guiPopUpCtrlEx.cpp | 298 ++++---- Engine/source/gui/controls/guiTextCtrl.cpp | 40 +- .../source/gui/controls/guiTextEditCtrl.cpp | 136 ++-- .../source/gui/controls/guiTreeViewCtrl.cpp | 364 +++++----- Engine/source/gui/core/guiCanvas.cpp | 488 ++++++------- Engine/source/gui/editor/guiEditCtrl.cpp | 24 +- Engine/source/gui/editor/guiMenuBar.cpp | 248 +++---- .../gui/editor/guiParticleGraphCtrl.cpp | 640 +++++++++--------- .../source/gui/game/guiChunkedBitmapCtrl.cpp | 4 +- Engine/source/gui/worldEditor/undoActions.cpp | 22 +- Engine/source/lighting/lightManager.cpp | 14 +- Engine/source/navigation/navMesh.cpp | 8 +- Engine/source/platform/menus/popupMenu.cpp | 18 +- Engine/source/platform/profiler.cpp | 44 +- Engine/source/platformMac/macFileIO.mm | 2 +- .../renderInstance/renderPrePassMgr.cpp | 2 +- Engine/source/scene/sceneContainer.cpp | 6 +- Engine/source/sim/actionMap.cpp | 582 ++++++++-------- 50 files changed, 2111 insertions(+), 2111 deletions(-) diff --git a/Engine/source/console/fieldBrushObject.cpp b/Engine/source/console/fieldBrushObject.cpp index d0eaf541c..484178dec 100644 --- a/Engine/source/console/fieldBrushObject.cpp +++ b/Engine/source/console/fieldBrushObject.cpp @@ -109,15 +109,15 @@ void FieldBrushObject::destroyFields() static char replacebuf[1024]; static char* suppressSpaces(const char* in_pname) { - U32 i = 0; - char chr; - do - { - chr = in_pname[i]; - replacebuf[i++] = (chr != 32) ? chr : '_'; - } while(chr); + U32 i = 0; + char chr; + do + { + chr = in_pname[i]; + replacebuf[i++] = (chr != 32) ? chr : '_'; + } while(chr); - return replacebuf; + return replacebuf; } //----------------------------------------------------------------------------- @@ -125,7 +125,7 @@ static char* suppressSpaces(const char* in_pname) //----------------------------------------------------------------------------- DefineConsoleMethod(FieldBrushObject, queryGroups, const char*, (const char* simObjName), , "(simObject) Query available static-field groups for selected object./\n" "@param simObject Object to query static-field groups on.\n" - "@return Space-seperated static-field group list.") + "@return Space-seperated static-field group list.") { // Fetch selected object. SimObject* pSimObject = dynamic_cast( Sim::findObject( simObjName ) ); @@ -194,7 +194,7 @@ DefineConsoleMethod(FieldBrushObject, queryGroups, const char*, (const char* sim DefineConsoleMethod(FieldBrushObject, queryFields, const char*, (const char* simObjName, const char* groupList), (""), "(simObject, [groupList]) Query available static-fields for selected object./\n" "@param simObject Object to query static-fields on.\n" "@param groupList groups to filter static-fields against.\n" - "@return Space-seperated static-field list.") + "@return Space-seperated static-field list.") { // Fetch selected object. SimObject* pSimObject = dynamic_cast( Sim::findObject( simObjName ) ); @@ -369,7 +369,7 @@ DefineConsoleMethod(FieldBrushObject, queryFields, const char*, (const char* sim DefineConsoleMethod(FieldBrushObject, copyFields, void, (const char* simObjName, const char* pFieldList), (""), "(simObject, [fieldList]) Copy selected static-fields for selected object./\n" "@param simObject Object to copy static-fields from.\n" "@param fieldList fields to filter static-fields against.\n" - "@return No return value.") + "@return No return value.") { // Fetch selected object. SimObject* pSimObject = dynamic_cast( Sim::findObject( simObjName ) ); @@ -502,7 +502,7 @@ void FieldBrushObject::copyFields( SimObject* pSimObject, const char* fieldList //----------------------------------------------------------------------------- DefineConsoleMethod(FieldBrushObject, pasteFields, void, (const char* simObjName), , "(simObject) Paste copied static-fields to selected object./\n" "@param simObject Object to paste static-fields to.\n" - "@return No return value.") + "@return No return value.") { // Fetch selected object. SimObject* pSimObject = dynamic_cast( Sim::findObject( simObjName ) ); diff --git a/Engine/source/console/fileSystemFunctions.cpp b/Engine/source/console/fileSystemFunctions.cpp index d5ee048ca..d8531ff7c 100644 --- a/Engine/source/console/fileSystemFunctions.cpp +++ b/Engine/source/console/fileSystemFunctions.cpp @@ -210,7 +210,7 @@ DefineEngineFunction( findNextFile, String, ( const char* pattern ), ( "" ), //----------------------------------------------------------------------------- DefineEngineFunction( getFileCount, S32, ( const char* pattern, bool recurse ), ( "", true ), - "@brief Returns the number of files in the directory tree that match the given patterns\n\n" + "@brief Returns the number of files in the directory tree that match the given patterns\n\n" "This function differs from getFileCountMultiExpr() in that it supports a single search " "pattern being passed in.\n\n" @@ -246,7 +246,7 @@ DefineEngineFunction( getFileCount, S32, ( const char* pattern, bool recurse ), //----------------------------------------------------------------------------- DefineEngineFunction(findFirstFileMultiExpr, String, ( const char* pattern, bool recurse ), ( "", true), - "@brief Returns the first file in the directory system matching the given patterns.\n\n" + "@brief Returns the first file in the directory system matching the given patterns.\n\n" "Use the corresponding findNextFileMultiExpr() to step through " "the results. If you're only interested in the number of files returned by the " @@ -259,10 +259,10 @@ DefineEngineFunction(findFirstFileMultiExpr, String, ( const char* pattern, bool "call to findFirstFile() and findFirstFileMultiExpr() initiates a new search and renders " "a previous search invalid.\n\n" - "@param pattern The path and file name pattern to match against, such as *.cs. Separate " + "@param pattern The path and file name pattern to match against, such as *.cs. Separate " "multiple patterns with TABs. For example: \"*.cs\" TAB \"*.dso\"\n" - "@param recurse If true, the search will exhaustively recurse into subdirectories " - "of the given path and match the given filename patterns.\n" + "@param recurse If true, the search will exhaustively recurse into subdirectories " + "of the given path and match the given filename patterns.\n" "@return String of the first matching file path, or an empty string if no matching " "files were found.\n\n" @@ -280,7 +280,7 @@ DefineEngineFunction(findFirstFileMultiExpr, String, ( const char* pattern, bool "@see findNextFileMultiExpr()" "@see getFileCountMultiExpr()" "@see findFirstFile()" - "@ingroup FileSearches") + "@ingroup FileSearches") { S32 numResults = buildFileList(pattern, recurse, true); @@ -302,7 +302,7 @@ DefineEngineFunction(findFirstFileMultiExpr, String, ( const char* pattern, bool DefineEngineFunction(findNextFileMultiExpr, String, ( const char* pattern ), (""), "@brief Returns the next file matching a search begun in findFirstFileMultiExpr().\n\n" - "@param pattern The path and file name pattern to match against. This is optional " + "@param pattern The path and file name pattern to match against. This is optional " "and may be left out as it is not used by the code. It is here for legacy reasons.\n" "@return String of the next matching file path, or an empty string if no matching " "files were found.\n\n" @@ -319,7 +319,7 @@ DefineEngineFunction(findNextFileMultiExpr, String, ( const char* pattern ), ("" "@endtsexample\n\n" "@see findFirstFileMultiExpr()" - "@ingroup FileSearches") + "@ingroup FileSearches") { if ( sgFindFilesPos + 1 > sgFindFilesResults.size() ) return String(); @@ -328,16 +328,16 @@ DefineEngineFunction(findNextFileMultiExpr, String, ( const char* pattern ), ("" } DefineEngineFunction(getFileCountMultiExpr, S32, ( const char* pattern, bool recurse ), ( "", true), - "@brief Returns the number of files in the directory tree that match the given patterns\n\n" + "@brief Returns the number of files in the directory tree that match the given patterns\n\n" "If you're interested in a list of files that match the given patterns and not just " "the number of files, use findFirstFileMultiExpr() and findNextFileMultiExpr().\n\n" - "@param pattern The path and file name pattern to match against, such as *.cs. Separate " + "@param pattern The path and file name pattern to match against, such as *.cs. Separate " "multiple patterns with TABs. For example: \"*.cs\" TAB \"*.dso\"\n" - "@param recurse If true, the search will exhaustively recurse into subdirectories " - "of the given path and match the given filename pattern.\n" - "@return Number of files located using the patterns\n\n" + "@param recurse If true, the search will exhaustively recurse into subdirectories " + "of the given path and match the given filename pattern.\n" + "@return Number of files located using the patterns\n\n" "@tsexample\n" "// Count all DTS or Collada models\n" @@ -347,7 +347,7 @@ DefineEngineFunction(getFileCountMultiExpr, S32, ( const char* pattern, bool rec "@see findFirstFileMultiExpr()" "@see findNextFileMultiExpr()" - "@ingroup FileSearches") + "@ingroup FileSearches") { S32 numResults = buildFileList(pattern, recurse, true); @@ -399,14 +399,14 @@ DefineEngineFunction(isFile, bool, ( const char* fileName ),, } DefineEngineFunction( IsDirectory, bool, ( const char* directory ),, - "@brief Determines if a specified directory exists or not\n\n" + "@brief Determines if a specified directory exists or not\n\n" - "@param directory String containing path in the form of \"foo/bar\"\n" + "@param directory String containing path in the form of \"foo/bar\"\n" "@return Returns true if the directory was found.\n" - "@note Do not include a trailing slash '/'.\n" + "@note Do not include a trailing slash '/'.\n" - "@ingroup FileSystem") + "@ingroup FileSystem") { String dir(Torque::Path::CleanSeparators(directory)); Con::expandScriptFilename(sgScriptFilenameBuffer, sizeof(sgScriptFilenameBuffer), dir.c_str()); @@ -416,12 +416,12 @@ DefineEngineFunction( IsDirectory, bool, ( const char* directory ),, } DefineEngineFunction(isWriteableFileName, bool, ( const char* fileName ),, - "@brief Determines if a file name can be written to using File I/O\n\n" + "@brief Determines if a file name can be written to using File I/O\n\n" - "@param fileName Name and path of file to check\n" - "@return Returns true if the file can be written to.\n" + "@param fileName Name and path of file to check\n" + "@return Returns true if the file can be written to.\n" - "@ingroup FileSystem") + "@ingroup FileSystem") { String filename(Torque::Path::CleanSeparators(fileName)); Con::expandScriptFilename(sgScriptFilenameBuffer, sizeof(sgScriptFilenameBuffer), filename.c_str()); @@ -434,32 +434,32 @@ DefineEngineFunction(isWriteableFileName, bool, ( const char* fileName ),, } DefineEngineFunction(startFileChangeNotifications, void, (),, - "@brief Start watching resources for file changes\n\n" + "@brief Start watching resources for file changes\n\n" "Typically this is called during initializeCore().\n\n" "@see stopFileChangeNotifications()\n" - "@ingroup FileSystem") + "@ingroup FileSystem") { Torque::FS::StartFileChangeNotifications(); } DefineEngineFunction(stopFileChangeNotifications, void, (),, - "@brief Stop watching resources for file changes\n\n" + "@brief Stop watching resources for file changes\n\n" "Typically this is called during shutdownCore().\n\n" "@see startFileChangeNotifications()\n" - "@ingroup FileSystem") + "@ingroup FileSystem") { Torque::FS::StopFileChangeNotifications(); } DefineEngineFunction(getDirectoryList, String, ( const char* path, S32 depth ), ( "", 0 ), - "@brief Gathers a list of directories starting at the given path.\n\n" + "@brief Gathers a list of directories starting at the given path.\n\n" - "@param path String containing the path of the directory\n" - "@param depth Depth of search, as in how many subdirectories to parse through\n" - "@return Tab delimited string containing list of directories found during search, \"\" if no files were found\n" + "@param path String containing the path of the directory\n" + "@param depth Depth of search, as in how many subdirectories to parse through\n" + "@return Tab delimited string containing list of directories found during search, \"\" if no files were found\n" - "@ingroup FileSystem") + "@ingroup FileSystem") { // Grab the full path. char fullpath[1024]; @@ -508,23 +508,23 @@ DefineEngineFunction(getDirectoryList, String, ( const char* path, S32 depth ), } DefineEngineFunction(fileSize, S32, ( const char* fileName ),, - "@brief Determines the size of a file on disk\n\n" + "@brief Determines the size of a file on disk\n\n" - "@param fileName Name and path of the file to check\n" - "@return Returns filesize in bytes, or -1 if no file\n" + "@param fileName Name and path of the file to check\n" + "@return Returns filesize in bytes, or -1 if no file\n" - "@ingroup FileSystem") + "@ingroup FileSystem") { Con::expandScriptFilename(sgScriptFilenameBuffer, sizeof(sgScriptFilenameBuffer), fileName); return Platform::getFileSize( sgScriptFilenameBuffer ); } DefineEngineFunction( fileModifiedTime, String, ( const char* fileName ),, - "@brief Returns a platform specific formatted string with the last modified time for the file.\n\n" + "@brief Returns a platform specific formatted string with the last modified time for the file.\n\n" - "@param fileName Name and path of file to check\n" - "@return Formatted string (OS specific) containing modified time, \"9/3/2010 12:33:47 PM\" for example\n" - "@ingroup FileSystem") + "@param fileName Name and path of file to check\n" + "@return Formatted string (OS specific) containing modified time, \"9/3/2010 12:33:47 PM\" for example\n" + "@ingroup FileSystem") { Con::expandScriptFilename(sgScriptFilenameBuffer, sizeof(sgScriptFilenameBuffer), fileName); @@ -566,12 +566,12 @@ DefineEngineFunction( fileCreatedTime, String, ( const char* fileName ),, } DefineEngineFunction(fileDelete, bool, ( const char* path ),, - "@brief Delete a file from the hard drive\n\n" + "@brief Delete a file from the hard drive\n\n" - "@param path Name and path of the file to delete\n" - "@note THERE IS NO RECOVERY FROM THIS. Deleted file is gone for good.\n" - "@return True if file was successfully deleted\n" - "@ingroup FileSystem") + "@param path Name and path of the file to delete\n" + "@note THERE IS NO RECOVERY FROM THIS. Deleted file is gone for good.\n" + "@return True if file was successfully deleted\n" + "@ingroup FileSystem") { static char fileName[1024]; static char sandboxFileName[1024]; @@ -586,11 +586,11 @@ DefineEngineFunction(fileDelete, bool, ( const char* path ),, //---------------------------------------------------------------- DefineEngineFunction(fileExt, String, ( const char* fileName ),, - "@brief Get the extension of a file\n\n" + "@brief Get the extension of a file\n\n" - "@param fileName Name and path of file\n" - "@return String containing the extension, such as \".exe\" or \".cs\"\n" - "@ingroup FileSystem") + "@param fileName Name and path of file\n" + "@return String containing the extension, such as \".exe\" or \".cs\"\n" + "@ingroup FileSystem") { const char *ret = dStrrchr(fileName, '.'); if(ret) @@ -626,11 +626,11 @@ DefineEngineFunction(fileBase, String, ( const char* fileName ),, } DefineEngineFunction(fileName, String, ( const char* fileName ),, - "@brief Get only the file name of a path and file name string (removes path)\n\n" + "@brief Get only the file name of a path and file name string (removes path)\n\n" - "@param fileName Name and path of file to check\n" - "@return String containing the file name, minus the path\n" - "@ingroup FileSystem") + "@param fileName Name and path of file to check\n" + "@return String containing the file name, minus the path\n" + "@ingroup FileSystem") { S32 pathLen = dStrlen( fileName ); FrameTemp szPathCopy( pathLen + 1); @@ -649,11 +649,11 @@ DefineEngineFunction(fileName, String, ( const char* fileName ),, } DefineEngineFunction(filePath, String, ( const char* fileName ),, - "@brief Get the path of a file (removes name and extension)\n\n" + "@brief Get the path of a file (removes name and extension)\n\n" - "@param fileName Name and path of file to check\n" - "@return String containing the path, minus name and extension\n" - "@ingroup FileSystem") + "@param fileName Name and path of file to check\n" + "@return String containing the path, minus name and extension\n" + "@ingroup FileSystem") { S32 pathLen = dStrlen( fileName ); FrameTemp szPathCopy( pathLen + 1); @@ -672,10 +672,10 @@ DefineEngineFunction(filePath, String, ( const char* fileName ),, } DefineEngineFunction(getWorkingDirectory, String, (),, - "@brief Reports the current directory\n\n" + "@brief Reports the current directory\n\n" - "@return String containing full file path of working directory\n" - "@ingroup FileSystem") + "@return String containing full file path of working directory\n" + "@ingroup FileSystem") { return Platform::getCurrentDirectory(); } @@ -687,13 +687,13 @@ DefineEngineFunction(getWorkingDirectory, String, (),, // are not currently built with TORQUE_TOOLS defined. DefineEngineFunction(makeFullPath, String, ( const char* path, const char* cwd ), ( "", ""), - "@brief Converts a relative file path to a full path\n\n" + "@brief Converts a relative file path to a full path\n\n" - "For example, \"./console.log\" becomes \"C:/Torque/t3d/examples/FPS Example/game/console.log\"\n" - "@param path Name of file or path to check\n" + "For example, \"./console.log\" becomes \"C:/Torque/t3d/examples/FPS Example/game/console.log\"\n" + "@param path Name of file or path to check\n" "@param cwd Optional current working directory from which to build the full path.\n" - "@return String containing non-relative directory of path\n" - "@ingroup FileSystem") + "@return String containing non-relative directory of path\n" + "@ingroup FileSystem") { static const U32 bufSize = 512; char *buf = Con::getReturnBuffer(bufSize); @@ -702,25 +702,25 @@ DefineEngineFunction(makeFullPath, String, ( const char* path, const char* cwd ) } DefineEngineFunction(makeRelativePath, String, ( const char* path, const char* to ), ( "", ""), - "@brief Turns a full or local path to a relative one\n\n" + "@brief Turns a full or local path to a relative one\n\n" "For example, \"./game/art\" becomes \"game/art\"\n" "@param path Full path (may include a file) to convert\n" "@param to Optional base path used for the conversion. If not supplied the current " "working directory is used.\n" - "@returns String containing relative path\n" - "@ingroup FileSystem") + "@returns String containing relative path\n" + "@ingroup FileSystem") { return Platform::makeRelativePathName( path, dStrlen(to) > 1 ? to : NULL ); } DefineEngineFunction(pathConcat, String, ( const char* path, const char* file), ( "", ""), - "@brief Combines two separate strings containing a file path and file name together into a single string\n\n" + "@brief Combines two separate strings containing a file path and file name together into a single string\n\n" - "@param path String containing file path\n" - "@param file String containing file name\n" - "@return String containing concatenated file name and path\n" - "@ingroup FileSystem") + "@param path String containing file path\n" + "@param file String containing file name\n" + "@return String containing concatenated file name and path\n" + "@ingroup FileSystem") { static const U32 bufSize = 1024; char *buf = Con::getReturnBuffer(bufSize); @@ -731,10 +731,10 @@ DefineEngineFunction(pathConcat, String, ( const char* path, const char* file), //----------------------------------------------------------------------------- DefineEngineFunction(getExecutableName, String, (),, - "@brief Gets the name of the game's executable\n\n" + "@brief Gets the name of the game's executable\n\n" - "@return String containing this game's executable name\n" - "@ingroup FileSystem") + "@return String containing this game's executable name\n" + "@ingroup FileSystem") { return Platform::getExecutableName(); } diff --git a/Engine/source/console/persistenceManager.cpp b/Engine/source/console/persistenceManager.cpp index 322626801..7db907475 100644 --- a/Engine/source/console/persistenceManager.cpp +++ b/Engine/source/console/persistenceManager.cpp @@ -34,22 +34,22 @@ IMPLEMENT_CONOBJECT(PersistenceManager); ConsoleDocClass( PersistenceManager, - "@brief this class manages updating SimObjects in the file they were " - "created in non-destructively (mostly aimed at datablocks and materials).\n\n" + "@brief this class manages updating SimObjects in the file they were " + "created in non-destructively (mostly aimed at datablocks and materials).\n\n" - "Basic scripting interface:\n\n" - " - Creation: new PersistenceManager(FooManager);\n" - " - Flag objects as dirty: FooManager.setDirty();\n" - " - Remove objects from dirty list: FooManager.removeDirty();\n" - " - List all currently dirty objects: FooManager.listDirty();\n" - " - Check to see if an object is dirty: FooManager.isDirty();\n" - " - Save dirty objects to their files: FooManager.saveDirty();\n\n" - "@note Dirty objects don't update their files until saveDirty() is " - "called so you can change their properties after you flag them as dirty\n\n" - "@note Currently only used by editors, not intended for actual game development\n\n" - "@ingroup Console\n" - "@ingroup Editors\n" - "@internal"); + "Basic scripting interface:\n\n" + " - Creation: new PersistenceManager(FooManager);\n" + " - Flag objects as dirty: FooManager.setDirty();\n" + " - Remove objects from dirty list: FooManager.removeDirty();\n" + " - List all currently dirty objects: FooManager.listDirty();\n" + " - Check to see if an object is dirty: FooManager.isDirty();\n" + " - Save dirty objects to their files: FooManager.saveDirty();\n\n" + "@note Dirty objects don't update their files until saveDirty() is " + "called so you can change their properties after you flag them as dirty\n\n" + "@note Currently only used by editors, not intended for actual game development\n\n" + "@ingroup Console\n" + "@ingroup Editors\n" + "@internal"); PersistenceManager::PersistenceManager() { @@ -890,7 +890,7 @@ PersistenceManager::ParsedObject* PersistenceManager::findParsedObject(SimObject { const ParsedProperty &prop = testObj->properties[j]; - if ( dStrcmp( prop.name, "internalName" ) == 0 && + if ( dStrcmp( prop.name, "internalName" ) == 0 && dStrcmp( prop.value, object->getInternalName() ) == 0 ) return testObj; else if ( dStrcmp(prop.name, "internalName") == 0) @@ -2037,24 +2037,24 @@ bool PersistenceManager::saveDirtyObject(SimObject* object) const char *name = object->getName(); if (name) { - Con::errorf("PersistenceManager::saveDirtyObject(): Unable to open %s to save %s %s (%d)", - dirtyObject.fileName, object->getClassName(), name, object->getId()); - } - else - { - Con::errorf("PersistenceManager::saveDirtyObject(): Unable to open %s to save %s (%d)", - dirtyObject.fileName, object->getClassName(), object->getId()); - } + Con::errorf("PersistenceManager::saveDirtyObject(): Unable to open %s to save %s %s (%d)", + dirtyObject.fileName, object->getClassName(), name, object->getId()); + } + else + { + Con::errorf("PersistenceManager::saveDirtyObject(): Unable to open %s to save %s (%d)", + dirtyObject.fileName, object->getClassName(), object->getId()); + } - return false; - } + return false; + } // if the file exists then lets update and save - if(mCurrentFile) - { - updateObject(object); + if(mCurrentFile) + { + updateObject(object); saveDirtyFile(); - } + } break; } @@ -2230,7 +2230,7 @@ DefineConsoleMethod( PersistenceManager, removeDirty, void, ( const char * objNa "Remove a SimObject from the dirty list.") { SimObject *dirtyObject = NULL; - if (dStrcmp( objName,"")!=0) + if (dStrcmp( objName,"")!=0) { if (!Sim::findObject(objName, dirtyObject)) { diff --git a/Engine/source/console/scriptFilename.cpp b/Engine/source/console/scriptFilename.cpp index 60c81f200..7a72756af 100644 --- a/Engine/source/console/scriptFilename.cpp +++ b/Engine/source/console/scriptFilename.cpp @@ -343,10 +343,10 @@ bool collapseScriptFilename(char *filename, U32 size, const char *src) //----------------------------------------------------------------------------- ConsoleFunction(expandFilename, const char*, 2, 2, "(string filename)" - "@brief Grabs the full path of a specified file\n\n" - "@param filename Name of the local file to locate\n" - "@return String containing the full filepath on disk\n" - "@ingroup FileSystem") + "@brief Grabs the full path of a specified file\n\n" + "@param filename Name of the local file to locate\n" + "@return String containing the full filepath on disk\n" + "@ingroup FileSystem") { TORQUE_UNUSED(argc); static const U32 bufSize = 1024; @@ -356,9 +356,9 @@ ConsoleFunction(expandFilename, const char*, 2, 2, "(string filename)" } ConsoleFunction(expandOldFilename, const char*, 2, 2, "(string filename)" - "@brief Retrofits a filepath that uses old Torque style\n\n" - "@return String containing filepath with new formatting\n" - "@ingroup FileSystem") + "@brief Retrofits a filepath that uses old Torque style\n\n" + "@return String containing filepath with new formatting\n" + "@ingroup FileSystem") { TORQUE_UNUSED(argc); static const U32 bufSize = 1024; @@ -372,7 +372,7 @@ ConsoleFunction(expandOldFilename, const char*, 2, 2, "(string filename)" //----------------------------------------------------------------------------- ConsoleToolFunction(collapseFilename, const char*, 2, 2, "(string filename)" - "@internal Editor use only") + "@internal Editor use only") { TORQUE_UNUSED(argc); static const U32 bufSize = 1024; @@ -382,7 +382,7 @@ ConsoleToolFunction(collapseFilename, const char*, 2, 2, "(string filename)" } ConsoleToolFunction(setScriptPathExpando, void, 3, 4, "(string expando, string path[, bool toolsOnly])" - "@internal Editor use only") + "@internal Editor use only") { if(argc == 4) Con::setScriptPathExpando(argv[1], argv[2], dAtob(argv[3])); @@ -391,13 +391,13 @@ ConsoleToolFunction(setScriptPathExpando, void, 3, 4, "(string expando, string p } ConsoleToolFunction(removeScriptPathExpando, void, 2, 2, "(string expando)" - "@internal Editor use only") + "@internal Editor use only") { Con::removeScriptPathExpando(argv[1]); } ConsoleToolFunction(isScriptPathExpando, bool, 2, 2, "(string expando)" - "@internal Editor use only") + "@internal Editor use only") { return Con::isScriptPathExpando(argv[1]); } diff --git a/Engine/source/console/scriptObjects.cpp b/Engine/source/console/scriptObjects.cpp index e5916fb64..6218e4e3d 100644 --- a/Engine/source/console/scriptObjects.cpp +++ b/Engine/source/console/scriptObjects.cpp @@ -53,13 +53,13 @@ ConsoleDocClass( ScriptObject, ); IMPLEMENT_CALLBACK( ScriptObject, onAdd, void, ( SimObjectId ID ), ( ID ), - "Called when this ScriptObject is added to the system.\n" - "@param ID Unique object ID assigned when created (%this in script).\n" + "Called when this ScriptObject is added to the system.\n" + "@param ID Unique object ID assigned when created (%this in script).\n" ); IMPLEMENT_CALLBACK( ScriptObject, onRemove, void, ( SimObjectId ID ), ( ID ), - "Called when this ScriptObject is removed from the system.\n" - "@param ID Unique object ID assigned when created (%this in script).\n" + "Called when this ScriptObject is removed from the system.\n" + "@param ID Unique object ID assigned when created (%this in script).\n" ); ScriptObject::ScriptObject() @@ -105,18 +105,18 @@ ConsoleDocClass( ScriptTickObject, ); IMPLEMENT_CALLBACK( ScriptTickObject, onInterpolateTick, void, ( F32 delta ), ( delta ), - "This is called every frame, but only if the object is set to process ticks.\n" - "@param delta The time delta for this frame.\n" + "This is called every frame, but only if the object is set to process ticks.\n" + "@param delta The time delta for this frame.\n" ); IMPLEMENT_CALLBACK( ScriptTickObject, onProcessTick, void, (), (), - "Called once every 32ms if this object is set to process ticks.\n" + "Called once every 32ms if this object is set to process ticks.\n" ); IMPLEMENT_CALLBACK( ScriptTickObject, onAdvanceTime, void, ( F32 timeDelta ), ( timeDelta ), - "This is called every frame regardless if the object is set to process ticks, but only " + "This is called every frame regardless if the object is set to process ticks, but only " "if the callOnAdvanceTime property is set to true.\n" - "@param timeDelta The time delta for this frame.\n" + "@param timeDelta The time delta for this frame.\n" "@see callOnAdvanceTime\n" ); @@ -188,37 +188,37 @@ DefineEngineMethod( ScriptTickObject, isProcessingTicks, bool, ( ),, IMPLEMENT_CONOBJECT(ScriptGroup); ConsoleDocClass( ScriptGroup, - "@brief Essentially a SimGroup, but with onAdd and onRemove script callbacks.\n\n" + "@brief Essentially a SimGroup, but with onAdd and onRemove script callbacks.\n\n" - "@tsexample\n" - "// First container, SimGroup containing a ScriptGroup\n" - "new SimGroup(Scenes)\n" - "{\n" - " // Subcontainer, ScriptGroup containing variables\n" - " // related to a cut scene and a starting WayPoint\n" - " new ScriptGroup(WelcomeScene)\n" - " {\n" - " class = \"Scene\";\n" - " pathName = \"Pathx\";\n" - " description = \"A small orc village set in the Hardesty mountains. This town and its surroundings will be used to illustrate some the Torque Game Engine\'s features.\";\n" - " pathTime = \"0\";\n" - " title = \"Welcome to Orc Town\";\n\n" - " new WayPoint(start)\n" - " {\n" - " position = \"163.873 -103.82 208.354\";\n" - " rotation = \"0.136165 -0.0544916 0.989186 44.0527\";\n" - " scale = \"1 1 1\";\n" - " dataBlock = \"WayPointMarker\";\n" - " team = \"0\";\n" - " };\n" - " };\n" - "};\n" - "@endtsexample\n\n" + "@tsexample\n" + "// First container, SimGroup containing a ScriptGroup\n" + "new SimGroup(Scenes)\n" + "{\n" + " // Subcontainer, ScriptGroup containing variables\n" + " // related to a cut scene and a starting WayPoint\n" + " new ScriptGroup(WelcomeScene)\n" + " {\n" + " class = \"Scene\";\n" + " pathName = \"Pathx\";\n" + " description = \"A small orc village set in the Hardesty mountains. This town and its surroundings will be used to illustrate some the Torque Game Engine\'s features.\";\n" + " pathTime = \"0\";\n" + " title = \"Welcome to Orc Town\";\n\n" + " new WayPoint(start)\n" + " {\n" + " position = \"163.873 -103.82 208.354\";\n" + " rotation = \"0.136165 -0.0544916 0.989186 44.0527\";\n" + " scale = \"1 1 1\";\n" + " dataBlock = \"WayPointMarker\";\n" + " team = \"0\";\n" + " };\n" + " };\n" + "};\n" + "@endtsexample\n\n" - "@see SimGroup\n" + "@see SimGroup\n" - "@ingroup Console\n" - "@ingroup Scripting" + "@ingroup Console\n" + "@ingroup Scripting" ); ScriptGroup::ScriptGroup() @@ -226,13 +226,13 @@ ScriptGroup::ScriptGroup() } IMPLEMENT_CALLBACK( ScriptGroup, onAdd, void, ( SimObjectId ID ), ( ID ), - "Called when this ScriptGroup is added to the system.\n" - "@param ID Unique object ID assigned when created (%this in script).\n" + "Called when this ScriptGroup is added to the system.\n" + "@param ID Unique object ID assigned when created (%this in script).\n" ); IMPLEMENT_CALLBACK( ScriptGroup, onRemove, void, ( SimObjectId ID ), ( ID ), - "Called when this ScriptObject is removed from the system.\n" - "@param ID Unique object ID assigned when created (%this in script).\n" + "Called when this ScriptObject is removed from the system.\n" + "@param ID Unique object ID assigned when created (%this in script).\n" ); bool ScriptGroup::onAdd() @@ -248,7 +248,7 @@ bool ScriptGroup::onAdd() void ScriptGroup::onRemove() { // Call onRemove in script! - onRemove_callback(getId()); + onRemove_callback(getId()); Parent::onRemove(); } diff --git a/Engine/source/console/sim.cpp b/Engine/source/console/sim.cpp index e0465050f..0ea902b5c 100644 --- a/Engine/source/console/sim.cpp +++ b/Engine/source/console/sim.cpp @@ -139,7 +139,7 @@ DefineConsoleFunction( spawnObject, S32, ( const char * spawnClass , const char * spawnProperties , const char * spawnScript ),("","","","") ,"spawnObject(class [, dataBlock, name, properties, script])" - "@hide") + "@hide") { SimObject* spawnObject = Sim::spawnObject(spawnClass, spawnDataBlock, spawnName, spawnProperties, spawnScript); @@ -203,12 +203,12 @@ ConsoleFunction(schedule, S32, 4, 0, "schedule(time, refobject|0, command, nextNameObject; - obj->nextNameObject = (SimObject*)-1; + obj->nextNameObject = (SimObject*)-1; hashEntryCount--; Mutex::unlockMutex(mutex); @@ -164,7 +164,7 @@ void SimNameDictionary::remove(SimObject* obj) root.erase(name); #endif Mutex::unlockMutex(mutex); -} +} //---------------------------------------------------------------------------- @@ -279,7 +279,7 @@ void SimManagerNameDictionary::remove(SimObject* obj) if(*walk == obj) { *walk = obj->nextManagerNameObject; - obj->nextManagerNameObject = (SimObject*)-1; + obj->nextManagerNameObject = (SimObject*)-1; hashEntryCount--; Mutex::unlockMutex(mutex); @@ -293,7 +293,7 @@ void SimManagerNameDictionary::remove(SimObject* obj) root.erase(name); #endif Mutex::unlockMutex(mutex); -} +} //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- diff --git a/Engine/source/console/simDictionary.h b/Engine/source/console/simDictionary.h index bbfb0f385..1247d504e 100644 --- a/Engine/source/console/simDictionary.h +++ b/Engine/source/console/simDictionary.h @@ -61,7 +61,7 @@ struct StringTableEntryEq } }; -typedef std::unordered_map StringDictDef; +typedef std::unordered_map StringDictDef; typedef std::unordered_map SimObjectIdDictDef; #endif diff --git a/Engine/source/console/simEvents.cpp b/Engine/source/console/simEvents.cpp index bc1e1789c..ab87f5f0b 100644 --- a/Engine/source/console/simEvents.cpp +++ b/Engine/source/console/simEvents.cpp @@ -39,10 +39,10 @@ SimConsoleEvent::SimConsoleEvent(S32 argc, ConsoleValueRef *argv, bool onObject) mArgv[i].value = new ConsoleValue(); mArgv[i].value->type = ConsoleValue::TypeInternalString; mArgv[i].value->init(); - if (argv) - { - mArgv[i].value->setStringValue((const char*)argv[i]); - } + if (argv) + { + mArgv[i].value->setStringValue((const char*)argv[i]); + } } } diff --git a/Engine/source/console/simManager.cpp b/Engine/source/console/simManager.cpp index a216c09b6..06027cdfe 100644 --- a/Engine/source/console/simManager.cpp +++ b/Engine/source/console/simManager.cpp @@ -93,7 +93,7 @@ static void shutdownEventQueue() U32 postEvent(SimObject *destObject, SimEvent* event,U32 time) { - AssertFatal(time == -1 || time >= getCurrentTime(), + AssertFatal(time == -1 || time >= getCurrentTime(), "Sim::postEvent() - Event time must be greater than or equal to the current time." ); AssertFatal(destObject, "Sim::postEvent() - Destination object for event doesn't exist."); @@ -256,7 +256,7 @@ void advanceToTime(SimTime targetTime) event->process(obj); delete event; } - gCurrentTime = targetTime; + gCurrentTime = targetTime; Mutex::unlockMutex(gEventQueueMutex); } @@ -393,7 +393,7 @@ SimObject* findObject(const char* name) SimObject* findObject(SimObjectId id) { - return gIdDictionary->find(id); + return gIdDictionary->find(id); } SimObject *spawnObject(String spawnClass, String spawnDataBlock, String spawnName, @@ -600,7 +600,7 @@ SimDataBlockGroup::SimDataBlockGroup() S32 QSORT_CALLBACK SimDataBlockGroup::compareModifiedKey(const void* a,const void* b) { - const SimDataBlock* dba = *((const SimDataBlock**)a); + const SimDataBlock* dba = *((const SimDataBlock**)a); const SimDataBlock* dbb = *((const SimDataBlock**)b); return dba->getModifiedKey() - dbb->getModifiedKey(); @@ -612,6 +612,6 @@ void SimDataBlockGroup::sort() if(mLastModifiedKey != SimDataBlock::getNextModifiedKey()) { mLastModifiedKey = SimDataBlock::getNextModifiedKey(); - dQsort(objectList.address(),objectList.size(),sizeof(SimObject *),compareModifiedKey); + dQsort(objectList.address(),objectList.size(),sizeof(SimObject *),compareModifiedKey); } } diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index b07bc6840..73a1ffa3d 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -81,7 +81,7 @@ SimObject::SimObject() mFlags.set( ModStaticFields | ModDynamicFields ); mFieldDictionary = NULL; - mCanSaveFieldDictionary = true; + mCanSaveFieldDictionary = true; mClassName = NULL; mSuperClassName = NULL; @@ -592,7 +592,7 @@ void SimObject::setDeclarationLine(U32 lineNumber) bool SimObject::registerObject() { AssertFatal( !mFlags.test( Added ), "reigsterObject - Object already registered!"); - mFlags.clear(Deleted | Removed); + mFlags.clear(Deleted | Removed); if(smForceId) { @@ -609,11 +609,11 @@ bool SimObject::registerObject() AssertFatal(Sim::gIdDictionary && Sim::gNameDictionary, "SimObject::registerObject - tried to register an object before Sim::init()!"); - Sim::gIdDictionary->insert(this); + Sim::gIdDictionary->insert(this); Sim::gNameDictionary->insert(this); - // Notify object + // Notify object bool ret = onAdd(); if(!ret) @@ -661,10 +661,10 @@ void SimObject::deleteObject() void SimObject::_destroySelf() { - AssertFatal( !isDeleted(), "SimObject::destroySelf - Object has already been deleted" ); - AssertFatal( !isRemoved(), "SimObject::destroySelf - Object in the process of being removed" ); + AssertFatal( !isDeleted(), "SimObject::destroySelf - Object has already been deleted" ); + AssertFatal( !isRemoved(), "SimObject::destroySelf - Object in the process of being removed" ); - mFlags.set( Deleted ); + mFlags.set( Deleted ); if( mFlags.test( Added ) ) unregisterObject(); @@ -1308,7 +1308,7 @@ void SimObject::dumpClassHierarchy() while(pRep) { Con::warnf("%s ->", pRep->getClassName()); - pRep = pRep->getParentClass(); + pRep = pRep->getParentClass(); } } @@ -1376,7 +1376,7 @@ bool SimObject::isChildOfGroup(SimGroup* pGroup) if(pGroup == dynamic_cast(this)) return true; - SimGroup* temp = mGroup; + SimGroup* temp = mGroup; while(temp) { if(temp == pGroup) @@ -2884,7 +2884,7 @@ DefineConsoleMethod( SimObject, isMemberOfClass, bool, ( const char* className ) return true; } - pRep = pRep->getParentClass(); + pRep = pRep->getParentClass(); } return false; diff --git a/Engine/source/console/simObject.h b/Engine/source/console/simObject.h index 8a38e8675..6cba1beff 100644 --- a/Engine/source/console/simObject.h +++ b/Engine/source/console/simObject.h @@ -826,7 +826,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks virtual bool readObject(Stream *stream); /// Set whether fields created at runtime should be saved. Default is true. - void setCanSaveDynamicFields( bool bCanSave ) { mCanSaveFieldDictionary = bCanSave; } + void setCanSaveDynamicFields( bool bCanSave ) { mCanSaveFieldDictionary = bCanSave; } /// Get whether fields created at runtime should be saved. Default is true. bool getCanSaveDynamicFields( ) { return mCanSaveFieldDictionary;} diff --git a/Engine/source/console/simObjectMemento.cpp b/Engine/source/console/simObjectMemento.cpp index 839ae0846..ef2e8f732 100644 --- a/Engine/source/console/simObjectMemento.cpp +++ b/Engine/source/console/simObjectMemento.cpp @@ -30,7 +30,7 @@ SimObjectMemento::SimObjectMemento() : mState( NULL ), - mIsDatablock( false ) + mIsDatablock( false ) { } @@ -45,16 +45,16 @@ void SimObjectMemento::save( SimObject *object ) dFree( mState ); mObjectName = String::EmptyString; - // Use a stream to save the state. + // Use a stream to save the state. MemStream stream( 256 ); U32 writeFlags = 0; - SimDataBlock* db = dynamic_cast(object); - if( !db ) - stream.write( sizeof( "return " ) - 1, "return " ); - else + SimDataBlock* db = dynamic_cast(object); + if( !db ) + stream.write( sizeof( "return " ) - 1, "return " ); + else { - mIsDatablock = true; + mIsDatablock = true; // Cull the datablock name from the output so that // we can easily replace it in case the datablock's name @@ -64,7 +64,7 @@ void SimObjectMemento::save( SimObject *object ) writeFlags |= SimObject::NoName; } - + object->write( stream, 0, writeFlags ); stream.write( (UTF8)0 ); @@ -82,9 +82,9 @@ SimObject *SimObjectMemento::restore() const // TODO: We could potentially make this faster by // caching the CodeBlock generated from the string - SimObject* object; - if( !mIsDatablock ) - { + SimObject* object; + if( !mIsDatablock ) + { // Set the redefine behavior to automatically giving // the new objects unique names. This will restore the // old names if they are still available or give reasonable @@ -95,22 +95,22 @@ SimObject *SimObjectMemento::restore() const // Read the object. - const UTF8* result = Con::evaluate( mState ); + const UTF8* result = Con::evaluate( mState ); // Restore the redefine behavior. Con::setVariable( "$Con::redefineBehavior", oldRedefineBehavior ); - if ( !result || !result[ 0 ] ) - return NULL; + if ( !result || !result[ 0 ] ) + return NULL; // Look up the object. - U32 objectId = dAtoi( result ); - object = Sim::findObject( objectId ); - } - else - { + U32 objectId = dAtoi( result ); + object = Sim::findObject( objectId ); + } + else + { String objectName = mObjectName; // For datablocks, it's getting a little complicated. Datablock definitions cannot be used @@ -140,16 +140,16 @@ SimObject *SimObjectMemento::restore() const dStrcpy( &tempBuffer[ numCharsToLeftParen + uniqueNameLen ], &mState[ numCharsToLeftParen ] ); } - Con::evaluate( tempBuffer ); + Con::evaluate( tempBuffer ); if( tempBuffer != mState ) dFree( tempBuffer ); if( objectName == String::EmptyString ) - return NULL; + return NULL; - object = Sim::findObject( objectName ); - } + object = Sim::findObject( objectName ); + } return object; } diff --git a/Engine/source/console/simObjectMemento.h b/Engine/source/console/simObjectMemento.h index 8fc029726..45b8a9e4d 100644 --- a/Engine/source/console/simObjectMemento.h +++ b/Engine/source/console/simObjectMemento.h @@ -42,7 +42,7 @@ protected: /// The captured object's name. String mObjectName; - bool mIsDatablock; + bool mIsDatablock; public: diff --git a/Engine/source/console/simPersistSet.cpp b/Engine/source/console/simPersistSet.cpp index 1fe272478..2dea6416e 100644 --- a/Engine/source/console/simPersistSet.cpp +++ b/Engine/source/console/simPersistSet.cpp @@ -29,13 +29,13 @@ IMPLEMENT_CONOBJECT( SimPersistSet ); ConsoleDocClass( SimPersistSet, - "@brief A SimSet that can be safely persisted.\n\n" - "Uses SimPersistIDs to reference objects in the set " - "while persisted on disk. This allows the set to resolve " - "its references no matter whether they are loaded before or " - "after the set is created.\n\n" - "Not intended for game development, for editors or internal use only.\n\n " - "@internal"); + "@brief A SimSet that can be safely persisted.\n\n" + "Uses SimPersistIDs to reference objects in the set " + "while persisted on disk. This allows the set to resolve " + "its references no matter whether they are loaded before or " + "after the set is created.\n\n" + "Not intended for game development, for editors or internal use only.\n\n " + "@internal"); //----------------------------------------------------------------------------- diff --git a/Engine/source/console/simSerialize.cpp b/Engine/source/console/simSerialize.cpp index e3f64be4c..6a7a84b17 100644 --- a/Engine/source/console/simSerialize.cpp +++ b/Engine/source/console/simSerialize.cpp @@ -213,18 +213,18 @@ SimObject *loadObjectStream(Stream *stream) //----------------------------------------------------------------------------- DefineEngineFunction(saveObject, bool, ( SimObject *object, const char *filename ),, - "@brief Serialize the object to a file.\n\n" - "@param object The object to serialize.\n" - "@param filename The file name and path.\n" - "@ingroup Console\n") + "@brief Serialize the object to a file.\n\n" + "@param object The object to serialize.\n" + "@param filename The file name and path.\n" + "@ingroup Console\n") { return object && Sim::saveObject(object, filename); } DefineEngineFunction(loadObject, SimObject*, ( const char *filename ),, - "@brief Loads a serialized object from a file.\n\n" - "@param Name and path to text file containing the object\n" - "@ingroup Console\n") + "@brief Loads a serialized object from a file.\n\n" + "@param Name and path to text file containing the object\n" + "@ingroup Console\n") { return Sim::loadObjectStream(filename); } diff --git a/Engine/source/console/stringStack.cpp b/Engine/source/console/stringStack.cpp index 45fd83740..681de2898 100644 --- a/Engine/source/console/stringStack.cpp +++ b/Engine/source/console/stringStack.cpp @@ -121,7 +121,7 @@ bool ConsoleValueStack::reserveValues(U32 count, ConsoleValueRef *outValues) //Con::printf("[%i]CSTK reserveValues %i", mStackPos, count); for (U32 i=0; isetTelnetParameters(port, consolePass, listenPass, remoteEcho); + TelConsole->setTelnetParameters(port, consolePass, listenPass, remoteEcho); } static void telnetCallback(U32 level, const char *consoleLine) { TORQUE_UNUSED(level); if (TelConsole) - TelConsole->processConsoleLine(consoleLine); + TelConsole->processConsoleLine(consoleLine); } TelnetConsole::TelnetConsole() @@ -121,9 +121,9 @@ void TelnetConsole::setTelnetParameters(S32 port, const char *telnetPassword, co mAcceptPort = port; if(mAcceptPort != -1 && mAcceptPort != 0) { - NetAddress address; - Net::getIdealListenAddress(&address); - address.port = mAcceptPort; + NetAddress address; + Net::getIdealListenAddress(&address); + address.port = mAcceptPort; mAcceptSocket = Net::openSocket(); Net::bindAddress(address, mAcceptSocket); diff --git a/Engine/source/console/telnetDebugger.cpp b/Engine/source/console/telnetDebugger.cpp index 8f95aaf9f..7db6e9710 100644 --- a/Engine/source/console/telnetDebugger.cpp +++ b/Engine/source/console/telnetDebugger.cpp @@ -115,8 +115,8 @@ MODULE_END; DefineConsoleFunction( dbgSetParameters, void, (S32 port, const char * password, bool waitForClient ), (false), "( int port, string password, bool waitForClient )" "Open a debug server port on the specified port, requiring the specified password, " - "and optionally waiting for the debug client to connect.\n" - "@internal Primarily used for Torsion and other debugging tools") + "and optionally waiting for the debug client to connect.\n" + "@internal Primarily used for Torsion and other debugging tools") { if (TelDebugger) { @@ -126,17 +126,17 @@ DefineConsoleFunction( dbgSetParameters, void, (S32 port, const char * password, DefineConsoleFunction( dbgIsConnected, bool, (), , "()" "Returns true if a script debugging client is connected else return false.\n" - "@internal Primarily used for Torsion and other debugging tools") + "@internal Primarily used for Torsion and other debugging tools") { return TelDebugger && TelDebugger->isConnected(); } DefineConsoleFunction( dbgDisconnect, void, (), , "()" "Forcibly disconnects any attached script debugging client.\n" - "@internal Primarily used for Torsion and other debugging tools") + "@internal Primarily used for Torsion and other debugging tools") { if (TelDebugger) - TelDebugger->disconnect(); + TelDebugger->disconnect(); } static void debuggerConsumer(U32 level, const char *line) @@ -244,9 +244,9 @@ void TelnetDebugger::setDebugParameters(S32 port, const char *password, bool wai mAcceptPort = port; if(mAcceptPort != -1 && mAcceptPort != 0) { - NetAddress address; - Net::getIdealListenAddress(&address); - address.port = mAcceptPort; + NetAddress address; + Net::getIdealListenAddress(&address); + address.port = mAcceptPort; mAcceptSocket = Net::openSocket(); Net::bindAddress(address, mAcceptSocket); @@ -588,7 +588,7 @@ void TelnetDebugger::addAllBreakpoints(CodeBlock *code) // TODO: This assumes that the OS file names are case // insensitive... Torque needs a dFilenameCmp() function. if( dStricmp( cur->fileName, code->name ) == 0 ) - { + { cur->code = code; // Find the fist breakline starting from and @@ -741,7 +741,7 @@ void TelnetDebugger::removeBreakpoint(const char *fileName, S32 line) { Breakpoint *brk = *bp; *bp = brk->next; - if ( brk->code ) + if ( brk->code ) brk->code->clearBreakpoint(brk->lineNumber); dFree(brk->testExpression); delete brk; @@ -754,7 +754,7 @@ void TelnetDebugger::removeAllBreakpoints() while(walk) { Breakpoint *temp = walk->next; - if ( walk->code ) + if ( walk->code ) walk->code->clearBreakpoint(walk->lineNumber); dFree(walk->testExpression); delete walk; @@ -792,10 +792,10 @@ void TelnetDebugger::setBreakOnNextStatement( bool enabled ) for(CodeBlock *walk = CodeBlock::getCodeBlockList(); walk; walk = walk->nextFile) walk->clearAllBreaks(); for(Breakpoint *w = mBreakpoints; w; w = w->next) - { - if ( w->code ) + { + if ( w->code ) w->code->setBreakpoint(w->lineNumber); - } + } mBreakOnNextStatement = false; } } @@ -848,7 +848,7 @@ void TelnetDebugger::debugStepOut() setBreakOnNextStatement( false ); mStackPopBreakIndex = gEvalState.getStackDepth() - 1; if ( mStackPopBreakIndex == 0 ) - mStackPopBreakIndex = -1; + mStackPopBreakIndex = -1; mProgramPaused = false; send("RUNNING\r\n"); } diff --git a/Engine/source/console/typeValidators.cpp b/Engine/source/console/typeValidators.cpp index 11249daf7..6b2ea7475 100644 --- a/Engine/source/console/typeValidators.cpp +++ b/Engine/source/console/typeValidators.cpp @@ -49,42 +49,42 @@ void TypeValidator::consoleError(SimObject *object, const char *format, ...) void FRangeValidator::validateType(SimObject *object, void *typePtr) { - F32 *v = (F32 *) typePtr; - if(*v < minV || *v > maxV) - { - consoleError(object, "Must be between %g and %g", minV, maxV); - if(*v < minV) - *v = minV; - else if(*v > maxV) - *v = maxV; - } + F32 *v = (F32 *) typePtr; + if(*v < minV || *v > maxV) + { + consoleError(object, "Must be between %g and %g", minV, maxV); + if(*v < minV) + *v = minV; + else if(*v > maxV) + *v = maxV; + } } void IRangeValidator::validateType(SimObject *object, void *typePtr) { - S32 *v = (S32 *) typePtr; - if(*v < minV || *v > maxV) - { - consoleError(object, "Must be between %d and %d", minV, maxV); - if(*v < minV) - *v = minV; - else if(*v > maxV) - *v = maxV; - } + S32 *v = (S32 *) typePtr; + if(*v < minV || *v > maxV) + { + consoleError(object, "Must be between %d and %d", minV, maxV); + if(*v < minV) + *v = minV; + else if(*v > maxV) + *v = maxV; + } } void IRangeValidatorScaled::validateType(SimObject *object, void *typePtr) { - S32 *v = (S32 *) typePtr; - *v /= factor; - if(*v < minV || *v > maxV) - { - consoleError(object, "Scaled value must be between %d and %d", minV, maxV); - if(*v < minV) - *v = minV; - else if(*v > maxV) - *v = maxV; - } + S32 *v = (S32 *) typePtr; + *v /= factor; + if(*v < minV || *v > maxV) + { + consoleError(object, "Scaled value must be between %d and %d", minV, maxV); + if(*v < minV) + *v = minV; + else if(*v > maxV) + *v = maxV; + } } void Point3NormalizeValidator::validateType(SimObject *object, void *typePtr) diff --git a/Engine/source/environment/river.cpp b/Engine/source/environment/river.cpp index 73c63a4ca..2ac9f2b97 100644 --- a/Engine/source/environment/river.cpp +++ b/Engine/source/environment/river.cpp @@ -77,12 +77,12 @@ ConsoleDocClass( River, #define NODE_RADIUS 15.0f static U32 gIdxArray[6][2][3] = { - { { 0, 4, 5 }, { 0, 5, 1 }, }, // Top Face - { { 2, 6, 4 }, { 2, 4, 0 }, }, // Left Face - { { 1, 5, 7 }, { 1, 7, 3 }, }, // Right Face - { { 2, 3, 7 }, { 2, 7, 6 }, }, // Bottom Face - { { 0, 1, 3 }, { 0, 3, 2 }, }, // Front Face - { { 4, 6, 7 }, { 4, 7, 5 }, }, // Back Face + { { 0, 4, 5 }, { 0, 5, 1 }, }, // Top Face + { { 2, 6, 4 }, { 2, 4, 0 }, }, // Left Face + { { 1, 5, 7 }, { 1, 7, 3 }, }, // Right Face + { { 2, 3, 7 }, { 2, 7, 6 }, }, // Bottom Face + { { 0, 1, 3 }, { 0, 3, 2 }, }, // Front Face + { { 4, 6, 7 }, { 4, 7, 5 }, }, // Back Face }; struct RiverHitSegment @@ -93,10 +93,10 @@ struct RiverHitSegment static S32 QSORT_CALLBACK compareHitSegments(const void* a,const void* b) { - const RiverHitSegment *fa = (RiverHitSegment*)a; - const RiverHitSegment *fb = (RiverHitSegment*)b; + const RiverHitSegment *fa = (RiverHitSegment*)a; + const RiverHitSegment *fb = (RiverHitSegment*)b; - return mSign(fb->t - fa->t); + return mSign(fb->t - fa->t); } static Point3F sSegmentPointComparePoints[4]; @@ -655,17 +655,17 @@ void River::consoleInit() Parent::consoleInit(); Con::addVariable( "$River::EditorOpen", TypeBool, &River::smEditorOpen, "For editor use.\n" - "@ingroup Editors\n" ); + "@ingroup Editors\n" ); Con::addVariable( "$River::showWalls", TypeBool, &River::smShowWalls, "For editor use.\n" - "@ingroup Editors\n" ); + "@ingroup Editors\n" ); Con::addVariable( "$River::showNodes", TypeBool, &River::smShowNodes, "For editor use.\n" - "@ingroup Editors\n"); + "@ingroup Editors\n"); Con::addVariable( "$River::showSpline", TypeBool, &River::smShowSpline, "For editor use.\n" - "@ingroup Editors\n" ); + "@ingroup Editors\n" ); Con::addVariable( "$River::showRiver", TypeBool, &River::smShowRiver, "For editor use.\n" - "@ingroup Editors\n" ); - Con::addVariable( "$River::showWireframe", TypeBool, &River::smWireframe, "For editor use.\n" - "@ingroup Editors\n"); + "@ingroup Editors\n" ); + Con::addVariable( "$River::showWireframe", TypeBool, &River::smWireframe, "For editor use.\n" + "@ingroup Editors\n"); } bool River::addNodeFromField( void *object, const char *index, const char *data ) @@ -816,7 +816,7 @@ void River::innerRender( SceneRenderState *state ) _makeRenderBatches( camPosition ); - if ( !River::smShowRiver ) + if ( !River::smShowRiver ) return; // If no material... we're done. @@ -851,7 +851,7 @@ void River::innerRender( SceneRenderState *state ) U32 vertCount = ( endVert - startVert ) + 1; U32 idxCount = ( endIdx - startIdx ) + 1; U32 triangleCount = idxCount / 3; - + AssertFatal( startVert < mLowVertCount, "River, bad draw call!" ); AssertFatal( startVert + vertCount <= mLowVertCount, "River, bad draw call!" ); AssertFatal( triangleCount <= mLowTriangleCount, "River, bad draw call!" ); @@ -962,7 +962,7 @@ U32 River::packUpdate(NetConnection * con, U32 mask, BitStream * stream) stream->write( mSegmentsPerBatch ); stream->write( mDepthScale ); stream->write( mMaxDivisionSize ); - stream->write( mColumnCount ); + stream->write( mColumnCount ); stream->write( mFlowMagnitude ); stream->write( mLodDistance ); @@ -1045,7 +1045,7 @@ void River::unpackUpdate(NetConnection * con, BitStream * stream) // RiverMask if(stream->readFlag()) { - MatrixF ObjectMatrix; + MatrixF ObjectMatrix; stream->readAffineTransform(&ObjectMatrix); Parent::setTransform(ObjectMatrix); @@ -1053,7 +1053,7 @@ void River::unpackUpdate(NetConnection * con, BitStream * stream) stream->read( &mSegmentsPerBatch ); stream->read( &mDepthScale ); stream->read( &mMaxDivisionSize ); - stream->read( &mColumnCount ); + stream->read( &mColumnCount ); stream->read( &mFlowMagnitude ); stream->read( &mLodDistance ); @@ -1198,56 +1198,56 @@ void River::setScale( const VectorF &scale ) bool River::castRay(const Point3F &s, const Point3F &e, RayInfo* info) { - Point3F start = s; - Point3F end = e; - mObjToWorld.mulP(start); - mObjToWorld.mulP(end); + Point3F start = s; + Point3F end = e; + mObjToWorld.mulP(start); + mObjToWorld.mulP(end); - F32 out = 1.0f; // The output fraction/percentage along the line defined by s and e - VectorF norm(0.0f, 0.0f, 0.0f); // The normal of the face intersected + F32 out = 1.0f; // The output fraction/percentage along the line defined by s and e + VectorF norm(0.0f, 0.0f, 0.0f); // The normal of the face intersected - Vector hitSegments; + Vector hitSegments; - for ( U32 i = 0; i < mSegments.size(); i++ ) - { - const RiverSegment &segment = mSegments[i]; + for ( U32 i = 0; i < mSegments.size(); i++ ) + { + const RiverSegment &segment = mSegments[i]; - F32 t; - VectorF n; + F32 t; + VectorF n; - if ( segment.worldbounds.collideLine( start, end, &t, &n ) ) - { - hitSegments.increment(); - hitSegments.last().t = t; - hitSegments.last().idx = i; - } - } + if ( segment.worldbounds.collideLine( start, end, &t, &n ) ) + { + hitSegments.increment(); + hitSegments.last().t = t; + hitSegments.last().idx = i; + } + } - dQsort( hitSegments.address(), hitSegments.size(), sizeof(RiverHitSegment), compareHitSegments ); + dQsort( hitSegments.address(), hitSegments.size(), sizeof(RiverHitSegment), compareHitSegments ); U32 idx0, idx1, idx2; F32 t; - for ( U32 i = 0; i < hitSegments.size(); i++ ) - { - U32 segIdx = hitSegments[i].idx; - const RiverSegment &segment = mSegments[segIdx]; + for ( U32 i = 0; i < hitSegments.size(); i++ ) + { + U32 segIdx = hitSegments[i].idx; + const RiverSegment &segment = mSegments[segIdx]; - // Each segment has 6 faces - for ( U32 j = 0; j < 6; j++ ) - { - if ( j == 4 && segIdx != 0 ) - continue; + // Each segment has 6 faces + for ( U32 j = 0; j < 6; j++ ) + { + if ( j == 4 && segIdx != 0 ) + continue; - if ( j == 5 && segIdx != mSegments.size() - 1 ) - continue; + if ( j == 5 && segIdx != mSegments.size() - 1 ) + continue; - // Each face has 2 triangles - for ( U32 k = 0; k < 2; k++ ) - { - idx0 = gIdxArray[j][k][0]; - idx1 = gIdxArray[j][k][1]; - idx2 = gIdxArray[j][k][2]; + // Each face has 2 triangles + for ( U32 k = 0; k < 2; k++ ) + { + idx0 = gIdxArray[j][k][0]; + idx1 = gIdxArray[j][k][1]; + idx2 = gIdxArray[j][k][2]; const Point3F &v0 = segment[idx0]; const Point3F &v1 = segment[idx1]; @@ -1257,40 +1257,40 @@ bool River::castRay(const Point3F &s, const Point3F &e, RayInfo* info) v2, v1, v0, NULL, &t ) ) - continue; + continue; - if ( t >= 0.0f && t < 1.0f && t < out ) - { - out = t; + if ( t >= 0.0f && t < 1.0f && t < out ) + { + out = t; // optimize this, can be calculated easily within // the collision test norm = PlaneF( v0, v1, v2 ); - } - } - } + } + } + } - if (out >= 0.0f && out < 1.0f) - break; - } + if (out >= 0.0f && out < 1.0f) + break; + } - if (out >= 0.0f && out < 1.0f) - { - info->t = out; - info->normal = norm; - info->point.interpolate(start, end, out); - info->face = -1; - info->object = this; + if (out >= 0.0f && out < 1.0f) + { + info->t = out; + info->normal = norm; + info->point.interpolate(start, end, out); + info->face = -1; + info->object = this; - return true; - } + return true; + } - return false; + return false; } bool River::collideBox(const Point3F &start, const Point3F &end, RayInfo* info) { - return false; + return false; } bool River::buildPolyList( PolyListContext context, AbstractPolyList* polyList, const Box3F& box, const SphereF& sphere ) @@ -1656,8 +1656,8 @@ void River::_generateVerts() // These will depend on the level of subdivision per segment // calculated below. mHighVertCount = 0; - mHighTriangleCount = 0; - + mHighTriangleCount = 0; + // Calculate the number of row/column subdivisions per each // RiverSegment. @@ -1671,18 +1671,18 @@ void River::_generateVerts() mColumnCount = mCeil( greatestWidth / mMaxDivisionSize ); - for ( U32 i = 0; i < mSegments.size(); i++ ) - { + for ( U32 i = 0; i < mSegments.size(); i++ ) + { RiverSegment &segment = mSegments[i]; const RiverSlice *slice = segment.slice0; - const RiverSlice *nextSlice = segment.slice1; + const RiverSlice *nextSlice = segment.slice1; - // Calculate the size of divisions in the forward direction ( p00 -> p01 ) - F32 segLength = (nextSlice->p1 - slice->p1).len(); + // Calculate the size of divisions in the forward direction ( p00 -> p01 ) + F32 segLength = (nextSlice->p1 - slice->p1).len(); - // A division count of one is actually NO subdivision, - // the segment corners are the only verts in this segment. - U32 numRows = 1; + // A division count of one is actually NO subdivision, + // the segment corners are the only verts in this segment. + U32 numRows = 1; if ( segLength > 0.0f ) numRows = mCeil( segLength / mMaxDivisionSize ); @@ -1693,33 +1693,33 @@ void River::_generateVerts() // column data member we initialize all segments in the river to // the same (River::mColumnCount) - // Calculate the size of divisions in the right direction ( p00 -> p10 ) - // F32 segWidth = ( ( p11 - p01 ).len() + ( p10 - p00 ).len() ) * 0.5f; + // Calculate the size of divisions in the right direction ( p00 -> p10 ) + // F32 segWidth = ( ( p11 - p01 ).len() + ( p10 - p00 ).len() ) * 0.5f; - // U32 numColumns = 5; - //F32 columnSize = segWidth / numColumns; + // U32 numColumns = 5; + //F32 columnSize = segWidth / numColumns; - //while ( columnSize > mMaxDivisionSize ) - //{ - // numColumns++; - // columnSize = segWidth / numColumns; - //} - + //while ( columnSize > mMaxDivisionSize ) + //{ + // numColumns++; + // columnSize = segWidth / numColumns; + //} + // Save the calculated numb of columns / rows for this segment. segment.columns = mColumnCount; segment.rows = numRows; - + // Save the corresponding number of verts/prims segment.numVerts = ( 1 + mColumnCount ) * ( 1 + numRows ); segment.numTriangles = mColumnCount * numRows * 2; - mHighVertCount += segment.numVerts; - mHighTriangleCount += segment.numTriangles; - } + mHighVertCount += segment.numVerts; + mHighTriangleCount += segment.numTriangles; + } // Number of low detail verts/prims. - mLowVertCount = mSlices.size() * 2; - mLowTriangleCount = mSegments.size() * 2; + mLowVertCount = mSlices.size() * 2; + mLowTriangleCount = mSegments.size() * 2; // Allocate the low detail VertexBuffer, // this will stay in memory and will never need to change. @@ -1728,8 +1728,8 @@ void River::_generateVerts() GFXWaterVertex *lowVertPtr = mVB_low.lock(); U32 vertCounter = 0; - // The texCoord.y value start/end for a segment - // as we loop through them. + // The texCoord.y value start/end for a segment + // as we loop through them. F32 textCoordV = 0; // @@ -1760,7 +1760,7 @@ void River::_generateVerts() { // Increment the textCoordV for the next slice. F32 segLen = ( mSlices[i+1].p1 - slice.p1 ).len(); - textCoordV += segLen; + textCoordV += segLen; } } @@ -1771,8 +1771,8 @@ void River::_generateVerts() // // Create the low-detail prim buffer(s) - // - mPB_low.set( GFX, mLowTriangleCount * 3, mLowTriangleCount, GFXBufferTypeStatic ); + // + mPB_low.set( GFX, mLowTriangleCount * 3, mLowTriangleCount, GFXBufferTypeStatic ); U16 *lowIdxBuff; mPB_low.lock(&lowIdxBuff); @@ -1784,13 +1784,13 @@ void River::_generateVerts() U32 offset = 0; // Fill the low-detail PrimitiveBuffer - for ( U32 i = 0; i < mSegments.size(); i++ ) - { + for ( U32 i = 0; i < mSegments.size(); i++ ) + { //const RiverSegment &segment = mSegments[i]; - + // Two triangles formed by the corner points of this segment // into the the low detail primitive buffer. - p00 = offset; + p00 = offset; p01 = p00 + 2; p11 = p01 + 1; p10 = p00 + 1; diff --git a/Engine/source/gfx/gl/gfxGLStateBlock.cpp b/Engine/source/gfx/gl/gfxGLStateBlock.cpp index 87d2b5953..1a104ab27 100644 --- a/Engine/source/gfx/gl/gfxGLStateBlock.cpp +++ b/Engine/source/gfx/gl/gfxGLStateBlock.cpp @@ -40,32 +40,32 @@ GFXGLStateBlock::GFXGLStateBlock(const GFXStateBlockDesc& desc) : mCachedHashValue(desc.getHashValue()) { if( !GFXGL->mCapabilities.samplerObjects ) - return; + return; static Map mSamplersMap; - for(int i = 0; i < TEXTURE_STAGE_COUNT; ++i) - { - GLuint &id = mSamplerObjects[i]; - GFXSamplerStateDesc &ssd = mDesc.samplers[i]; + for(int i = 0; i < TEXTURE_STAGE_COUNT; ++i) + { + GLuint &id = mSamplerObjects[i]; + GFXSamplerStateDesc &ssd = mDesc.samplers[i]; Map::Iterator itr = mSamplersMap.find(ssd); if(itr == mSamplersMap.end()) { - glGenSamplers(1, &id); + glGenSamplers(1, &id); - glSamplerParameteri(id, GL_TEXTURE_MIN_FILTER, minificationFilter(ssd.minFilter, ssd.mipFilter, 1) ); - glSamplerParameteri(id, GL_TEXTURE_MAG_FILTER, GFXGLTextureFilter[ssd.magFilter]); - glSamplerParameteri(id, GL_TEXTURE_WRAP_S, GFXGLTextureAddress[ssd.addressModeU]); - glSamplerParameteri(id, GL_TEXTURE_WRAP_T, GFXGLTextureAddress[ssd.addressModeV]); - glSamplerParameteri(id, GL_TEXTURE_WRAP_R, GFXGLTextureAddress[ssd.addressModeW]); - if(static_cast< GFXGLDevice* >( GFX )->supportsAnisotropic() ) - glSamplerParameterf(id, GL_TEXTURE_MAX_ANISOTROPY_EXT, ssd.maxAnisotropy); + glSamplerParameteri(id, GL_TEXTURE_MIN_FILTER, minificationFilter(ssd.minFilter, ssd.mipFilter, 1) ); + glSamplerParameteri(id, GL_TEXTURE_MAG_FILTER, GFXGLTextureFilter[ssd.magFilter]); + glSamplerParameteri(id, GL_TEXTURE_WRAP_S, GFXGLTextureAddress[ssd.addressModeU]); + glSamplerParameteri(id, GL_TEXTURE_WRAP_T, GFXGLTextureAddress[ssd.addressModeV]); + glSamplerParameteri(id, GL_TEXTURE_WRAP_R, GFXGLTextureAddress[ssd.addressModeW]); + if(static_cast< GFXGLDevice* >( GFX )->supportsAnisotropic() ) + glSamplerParameterf(id, GL_TEXTURE_MAX_ANISOTROPY_EXT, ssd.maxAnisotropy); mSamplersMap[ssd] = id; } else id = itr->value; - } + } } GFXGLStateBlock::~GFXGLStateBlock() @@ -171,9 +171,9 @@ void GFXGLStateBlock::activate(const GFXGLStateBlock* oldState) for (U32 i = 0; i < getMin(getOwningDevice()->getNumSamplers(), (U32) TEXTURE_STAGE_COUNT); i++) { if(!oldState || oldState->mSamplerObjects[i] != mSamplerObjects[i]) - glBindSampler(i, mSamplerObjects[i] ); + glBindSampler(i, mSamplerObjects[i] ); } - } + } // TODO: states added for detail blend } diff --git a/Engine/source/gfx/video/videoCapture.cpp b/Engine/source/gfx/video/videoCapture.cpp index 230baf501..8d5f0ce61 100644 --- a/Engine/source/gfx/video/videoCapture.cpp +++ b/Engine/source/gfx/video/videoCapture.cpp @@ -340,7 +340,7 @@ DefineEngineFunction( stopVideoCapture, void, (),, DefineEngineFunction( playJournalToVideo, void, ( const char *journalFile, const char *videoFile, const char *encoder, F32 framerate, Point2I resolution ), - ( NULL, "THEORA", 30.0f, Point2I::Zero ), + ( NULL, "THEORA", 30.0f, Point2I::Zero ), "Load a journal file and capture it video.\n" "@ingroup Rendering\n" ) { diff --git a/Engine/source/gui/buttons/guiIconButtonCtrl.cpp b/Engine/source/gui/buttons/guiIconButtonCtrl.cpp index b4aed4ec7..f37d69a4c 100644 --- a/Engine/source/gui/buttons/guiIconButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiIconButtonCtrl.cpp @@ -59,21 +59,21 @@ ConsoleDocClass( GuiIconButtonCtrl, "has been clicked.\n\n" "@tsexample\n" - "new GuiIconButtonCtrl(TestIconButton)\n" - "{\n" - " buttonMargin = \"4 4\";\n" - " iconBitmap = \"art/gui/lagIcon.png\";\n" - " iconLocation = \"Center\";\n" - " sizeIconToButton = \"0\";\n" - " makeIconSquare = \"1\";\n" - " textLocation = \"Bottom\";\n" - " textMargin = \"-2\";\n" - " autoSize = \"0\";\n" - " text = \"Lag Icon\";\n" - " textID = \"\"STR_LAG\"\";\n" - " buttonType = \"PushButton\";\n" - " profile = \"GuiIconButtonProfile\";\n" - "};\n" + "new GuiIconButtonCtrl(TestIconButton)\n" + "{\n" + " buttonMargin = \"4 4\";\n" + " iconBitmap = \"art/gui/lagIcon.png\";\n" + " iconLocation = \"Center\";\n" + " sizeIconToButton = \"0\";\n" + " makeIconSquare = \"1\";\n" + " textLocation = \"Bottom\";\n" + " textMargin = \"-2\";\n" + " autoSize = \"0\";\n" + " text = \"Lag Icon\";\n" + " textID = \"\"STR_LAG\"\";\n" + " buttonType = \"PushButton\";\n" + " profile = \"GuiIconButtonProfile\";\n" + "};\n" "@endtsexample\n\n" "@see GuiControl\n" @@ -130,7 +130,7 @@ void GuiIconButtonCtrl::initPersistFields() addField( "sizeIconToButton", TypeBool, Offset( mFitBitmapToButton, GuiIconButtonCtrl ),"If true, the icon will be scaled to be the same size as the button.\n"); addField( "makeIconSquare", TypeBool, Offset( mMakeIconSquare, GuiIconButtonCtrl ),"If true, will make sure the icon is square.\n"); addField( "textLocation", TYPEID< TextLocation >(), Offset( mTextLocation, GuiIconButtonCtrl ),"Where to place the text on the control.\n" - "Options are 0 (None), 1 (Bottom), 2 (Right), 3 (Top), 4 (Left), 5 (Center).\n"); + "Options are 0 (None), 1 (Bottom), 2 (Right), 3 (Top), 4 (Left), 5 (Center).\n"); addField( "textMargin", TypeS32, Offset( mTextMargin, GuiIconButtonCtrl ),"Margin between the icon and the text.\n"); addField( "autoSize", TypeBool, Offset( mAutoSize, GuiIconButtonCtrl ),"If true, the text and icon will be automatically sized to the size of the control.\n"); Parent::initPersistFields(); diff --git a/Engine/source/gui/buttons/guiToggleButtonCtrl.cpp b/Engine/source/gui/buttons/guiToggleButtonCtrl.cpp index e5aa4b0f5..7168f58ca 100644 --- a/Engine/source/gui/buttons/guiToggleButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiToggleButtonCtrl.cpp @@ -60,7 +60,7 @@ void GuiToggleButtonCtrl::onPreRender() // If we have a script variable, make sure we're in sync if ( mConsoleVariable[0] ) - mStateOn = Con::getBoolVariable( mConsoleVariable ); + mStateOn = Con::getBoolVariable( mConsoleVariable ); } void GuiToggleButtonCtrl::onRender(Point2I offset, diff --git a/Engine/source/gui/containers/guiFormCtrl.cpp b/Engine/source/gui/containers/guiFormCtrl.cpp index e87bcb6d2..bbd9a7f9e 100644 --- a/Engine/source/gui/containers/guiFormCtrl.cpp +++ b/Engine/source/gui/containers/guiFormCtrl.cpp @@ -158,7 +158,7 @@ void GuiFormCtrl::addObject(SimObject *newObj ) GuiControl* parent = getParent(); if ( parent ) - parent->addObject( newObj ); + parent->addObject( newObj ); return; } diff --git a/Engine/source/gui/containers/guiPaneCtrl.cpp b/Engine/source/gui/containers/guiPaneCtrl.cpp index 1637b0b30..c42fc9e51 100644 --- a/Engine/source/gui/containers/guiPaneCtrl.cpp +++ b/Engine/source/gui/containers/guiPaneCtrl.cpp @@ -108,7 +108,7 @@ bool GuiPaneControl::onWake() } if(mCaptionID && *mCaptionID != 0) - setCaptionID(mCaptionID); + setCaptionID(mCaptionID); mProfile->constructBitmapArray(); if(mProfile->mUseBitmapArray && mProfile->mBitmapArrayRects.size()) @@ -131,19 +131,19 @@ bool GuiPaneControl::onWake() void GuiPaneControl::setCaptionID(const char *id) { - S32 n = Con::getIntVariable(id, -1); - if(n != -1) - { - mCaptionID = StringTable->insert(id); - setCaptionID(n); - } + S32 n = Con::getIntVariable(id, -1); + if(n != -1) + { + mCaptionID = StringTable->insert(id); + setCaptionID(n); + } } //----------------------------------------------------------------------------- void GuiPaneControl::setCaptionID(S32 id) { - mCaption = getGUIString(id); + mCaption = getGUIString(id); } //----------------------------------------------------------------------------- diff --git a/Engine/source/gui/containers/guiRolloutCtrl.cpp b/Engine/source/gui/containers/guiRolloutCtrl.cpp index ea5201021..6f2272d9a 100644 --- a/Engine/source/gui/containers/guiRolloutCtrl.cpp +++ b/Engine/source/gui/containers/guiRolloutCtrl.cpp @@ -462,9 +462,9 @@ void GuiRolloutCtrl::processTick() newHeight -= mAnimateStep; if( !mIsAnimating ) - { + { mIsExpanded = false; - } + } } else // We're expanding ourself (Showing our contents) { @@ -559,13 +559,13 @@ void GuiRolloutCtrl::onRender( Point2I offset, const RectI &updateRect ) if ( pChild ) { if ( !mIsExpanded && !mIsAnimating && pChild->isVisible() ) - { + { pChild->setVisible( false ); - } + } else if ( (mIsExpanded || mIsAnimating) && !pChild->isVisible() ) - { + { pChild->setVisible( true ); - } + } } renderChildControls( offset, updateRect ); @@ -614,7 +614,7 @@ DefineEngineMethod( GuiRolloutCtrl, toggleCollapse, void, (),, if( object->isExpanded() ) object->collapse(); else - object->expand(); + object->expand(); } //----------------------------------------------------------------------------- diff --git a/Engine/source/gui/containers/guiWindowCtrl.cpp b/Engine/source/gui/containers/guiWindowCtrl.cpp index 84be45148..2957ec7ec 100644 --- a/Engine/source/gui/containers/guiWindowCtrl.cpp +++ b/Engine/source/gui/containers/guiWindowCtrl.cpp @@ -231,7 +231,7 @@ void GuiWindowCtrl::moveFromCollapseGroup() parent->mCollapseGroupVec[groupVec].first()->mCollapseGroupNum = -1; parent->mCollapseGroupVec[groupVec].erase(U32(0)); parent->mCollapseGroupVec[groupVec].setSize(groupVecCount - 1); - parent->mCollapseGroupVec.erase(groupVec); + parent->mCollapseGroupVec.erase(groupVec); } } @@ -381,7 +381,7 @@ void GuiWindowCtrl::refreshCollapseGroups() if( !parent ) return; - CollapseGroupNumVec collapseGroupNumVec; + CollapseGroupNumVec collapseGroupNumVec; // iterate through the collided array, renumbering the windows pointers S32 assignGroupNum = 0; @@ -463,7 +463,7 @@ void GuiWindowCtrl::handleCollapseGroup() if( !parent ) return; - CollapseGroupNumVec collapseGroupNumVec; + CollapseGroupNumVec collapseGroupNumVec; if( mIsCollapsed ) // minimize window up to its header bar { @@ -529,7 +529,7 @@ void GuiWindowCtrl::handleCollapseGroup() if((*iter)->mCollapseGroupNum > mCollapseGroupNum) { Point2I newChildPosition = (*iter)->getPosition(); - newChildPosition.y += moveChildYBy; + newChildPosition.y += moveChildYBy; (*iter)->resize(newChildPosition, (*iter)->getExtent()); } } @@ -547,7 +547,7 @@ bool GuiWindowCtrl::resizeCollapseGroup(bool resizeX, bool resizeY, Point2I resi if( !parent ) return false; - CollapseGroupNumVec collapseGroupNumVec; + CollapseGroupNumVec collapseGroupNumVec; bool canResize = true; CollapseGroupNumVec::iterator iter = parent->mCollapseGroupVec[mCollapseGroup].begin(); @@ -980,7 +980,7 @@ void GuiWindowCtrl::onMouseDragged(const GuiEvent &event) moveWithCollapseGroup(newPosition); if(mCanCollapse && mCollapseGroup >= 0 && mResizeWindow == true ) - { + { // Resize the window if allowed if( newExtent.y >= getMinExtent().y && newExtent.x >= getMinExtent().x) { @@ -1212,7 +1212,7 @@ void GuiWindowCtrl::onMouseUp(const GuiEvent &event) // We're either moving out of a collapse group or moving to another one // Not valid for windows not previously in a group if( mCollapseGroup >= 0 && - (snapType == -1 || (hitWindow && snapType >= 0 && mCollapseGroup != hitWindow->mCollapseGroup))) + (snapType == -1 || (hitWindow && snapType >= 0 && mCollapseGroup != hitWindow->mCollapseGroup))) moveFromCollapseGroup(); // No window to connect to @@ -1830,7 +1830,7 @@ void GuiWindowCtrl::parentResized(const RectI &oldParentRect, const RectI &newPa // Only for collpasing groups, if were not, then do it like normal windows if( mCanCollapse && mCollapseGroup >= 0 ) - { + { bool resizeMe = false; // Only the group window should control positioning diff --git a/Engine/source/gui/controls/guiListBoxCtrl.cpp b/Engine/source/gui/controls/guiListBoxCtrl.cpp index 22108ee3d..5deab67fc 100644 --- a/Engine/source/gui/controls/guiListBoxCtrl.cpp +++ b/Engine/source/gui/controls/guiListBoxCtrl.cpp @@ -52,9 +52,9 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onMouseDragged, void, (),(), "@tsexample\n" "// Mouse is dragged across the control, causing the callback to occur.\n" "GuiListBoxCtrl::onMouseDragged(%this)\n" - " {\n" - " // Code to run whenever the mouse is dragged across the control\n" - " }\n" + " {\n" + " // Code to run whenever the mouse is dragged across the control\n" + " }\n" "@endtsexample\n\n" "@see GuiControl\n\n" ); @@ -64,9 +64,9 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onClearSelection, void, (),(), "@tsexample\n" "// A selected item is cleared, causing the callback to occur.\n" "GuiListBoxCtrl::onClearSelection(%this)\n" - " {\n" - " // Code to run whenever a selected item is cleared\n" - " }\n" + " {\n" + " // Code to run whenever a selected item is cleared\n" + " }\n" "@endtsexample\n\n" "@see GuiControl\n\n" ); @@ -78,9 +78,9 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onUnSelect, void, ( S32 index, const char* i "@tsexample\n" "// A selected item is unselected, causing the callback to occur\n" "GuiListBoxCtrl::onUnSelect(%this, %indexId, %itemText)\n" - " {\n" - " // Code to run whenever a selected list item is unselected\n" - " }\n" + " {\n" + " // Code to run whenever a selected list item is unselected\n" + " }\n" "@endtsexample\n\n" "@see GuiControl\n\n" ); @@ -92,9 +92,9 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onSelect, void, ( S32 index , const char* it "@tsexample\n" "// An item in the list is selected, causing the callback to occur\n" "GuiListBoxCtrl::onSelect(%this, %index, %itemText)\n" - " {\n" - " // Code to run whenever an item in the list is selected\n" - " }\n" + " {\n" + " // Code to run whenever an item in the list is selected\n" + " }\n" "@endtsexample\n\n" "@see GuiControl\n\n" ); @@ -104,9 +104,9 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onDoubleClick, void, (),(), "@tsexample\n" "// An item in the list is double clicked, causing the callback to occur.\n" "GuiListBoxCtrl::onDoubleClick(%this)\n" - " {\n" - " // Code to run whenever an item in the control has been double clicked\n" - " }\n" + " {\n" + " // Code to run whenever an item in the control has been double clicked\n" + " }\n" "@endtsexample\n\n" "@see GuiControl\n\n" ); @@ -121,9 +121,9 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onMouseUp, void, ( S32 itemHit, S32 mouseCli "@tsexample\n" "// Mouse was previously clicked down, and now has been released, causing the callback to occur.\n" "GuiListBoxCtrl::onMouseUp(%this, %itemHit, %mouseClickCount)\n" - " {\n" - " // Code to call whenever the mouse has been clicked and released on the control\n" - " }\n" + " {\n" + " // Code to call whenever the mouse has been clicked and released on the control\n" + " }\n" "@endtsexample\n\n" "@see GuiControl\n\n" ); @@ -133,9 +133,9 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onDeleteKey, void, (),(), "@tsexample\n" "// The delete key on the keyboard has been pressed while this control is in focus, causing the callback to occur.\n" "GuiListBoxCtrl::onDeleteKey(%this)\n" - " {\n" - " // Code to call whenever the delete key is pressed\n" - " }\n" + " {\n" + " // Code to call whenever the delete key is pressed\n" + " }\n" "@endtsexample\n\n" "@see GuiControl\n\n" ); @@ -146,10 +146,10 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, isObjectMirrored, bool, ( const char* indexI "@tsexample\n" "// Engine has requested of the script level to determine if a list entry is mirrored or not.\n" "GuiListBoxCtrl::isObjectMirrored(%this, %indexIdString)\n" - " {\n" - " // Perform code required to check and see if the list item at the index id is mirrored or not.\n" - " return %isMirrored;\n" - " }\n" + " {\n" + " // Perform code required to check and see if the list item at the index id is mirrored or not.\n" + " return %isMirrored;\n" + " }\n" "@endtsexample\n\n" "@return A boolean value on if the list item is mirrored or not.\n\n" "@see GuiControl\n\n" @@ -234,7 +234,7 @@ void GuiListBoxCtrl::clearItems() // Free our vector lists mItems.clear(); mSelectedItems.clear(); - mFilteredItems.clear(); + mFilteredItems.clear(); } DefineEngineMethod( GuiListBoxCtrl, clearSelection, void, (),, @@ -1511,8 +1511,8 @@ void GuiListBoxCtrl::_mirror() break; } } - - for ( U32 j = 0; j < mFilteredItems.size(); j++ ) + + for ( U32 j = 0; j < mFilteredItems.size(); j++ ) { if ( (SimObjectId)(uintptr_t)(mFilteredItems[j]->itemData) == curId ) { @@ -1571,37 +1571,37 @@ DefineEngineMethod( GuiListBoxCtrl, addFilteredItem, void, (const char* newItem) "@endtsexample\n\n" "@see GuiControl") { - String item(newItem); - if( item == String::EmptyString ) - return; + String item(newItem); + if( item == String::EmptyString ) + return; - object->addFilteredItem( item ); + object->addFilteredItem( item ); } void GuiListBoxCtrl::addFilteredItem( String item ) { - // Delete from selected items list - for ( S32 i = 0; i < mSelectedItems.size(); i++ ) - { - String itemText = mSelectedItems[i]->itemText; - if ( dStrcmp( itemText.c_str(), item.c_str() ) == 0 ) - { - mSelectedItems.erase_fast( i ); - break; - } - } + // Delete from selected items list + for ( S32 i = 0; i < mSelectedItems.size(); i++ ) + { + String itemText = mSelectedItems[i]->itemText; + if ( dStrcmp( itemText.c_str(), item.c_str() ) == 0 ) + { + mSelectedItems.erase_fast( i ); + break; + } + } - for ( S32 i = 0; i < mItems.size(); i++ ) - { - String itemText = mItems[i]->itemText; - if( dStrcmp( itemText.c_str(), item.c_str() ) == 0 ) - { - mItems[i]->isSelected = false; - mFilteredItems.push_front( mItems[i] ); - mItems.erase( &mItems[i] ); - break; - } - } + for ( S32 i = 0; i < mItems.size(); i++ ) + { + String itemText = mItems[i]->itemText; + if( dStrcmp( itemText.c_str(), item.c_str() ) == 0 ) + { + mItems[i]->isSelected = false; + mFilteredItems.push_front( mItems[i] ); + mItems.erase( &mItems[i] ); + break; + } + } } DefineEngineMethod( GuiListBoxCtrl, removeFilteredItem, void, ( const char* itemName ),, @@ -1615,23 +1615,23 @@ DefineEngineMethod( GuiListBoxCtrl, removeFilteredItem, void, ( const char* item "@endtsexample\n\n" "@see GuiControl") { - String item(itemName); - if( item == String::EmptyString ) - return; + String item(itemName); + if( item == String::EmptyString ) + return; - object->removeFilteredItem( item ); + object->removeFilteredItem( item ); } void GuiListBoxCtrl::removeFilteredItem( String item ) { - for ( S32 i = 0; i < mFilteredItems.size(); i++ ) - { - String itemText = mFilteredItems[i]->itemText; - if( dStrcmp( itemText.c_str(), item.c_str() ) == 0 ) - { - mItems.push_front( mFilteredItems[i] ); - mFilteredItems.erase( &mFilteredItems[i] ); - break; - } - } + for ( S32 i = 0; i < mFilteredItems.size(); i++ ) + { + String itemText = mFilteredItems[i]->itemText; + if( dStrcmp( itemText.c_str(), item.c_str() ) == 0 ) + { + mItems.push_front( mFilteredItems[i] ); + mFilteredItems.erase( &mFilteredItems[i] ); + break; + } + } } \ No newline at end of file diff --git a/Engine/source/gui/controls/guiMLTextCtrl.cpp b/Engine/source/gui/controls/guiMLTextCtrl.cpp index 1a4f64814..6cfdf4354 100644 --- a/Engine/source/gui/controls/guiMLTextCtrl.cpp +++ b/Engine/source/gui/controls/guiMLTextCtrl.cpp @@ -66,9 +66,9 @@ IMPLEMENT_CALLBACK( GuiMLTextCtrl, onURL, void, ( const char* url ),( url ), "@tsexample\n" "// A URL address was clicked on in the control, causing the callback to occur.\n" "GuiMLTextCtrl::onUrl(%this,%url)\n" - " {\n" - " // Code to run whenever a URL was clicked on\n" - " }\n" + " {\n" + " // Code to run whenever a URL was clicked on\n" + " }\n" "@endtsexample\n\n" "@see GuiControl\n\n" ); @@ -80,9 +80,9 @@ IMPLEMENT_CALLBACK( GuiMLTextCtrl, onResize, void, ( S32 width, S32 maxY ),( wid "@tsexample\n" "// Control size changed, causing the callback to occur.\n" "GuiMLTextCtrl::onResize(%this,%width,%maxY)\n" - " {\n" - " // Code to call when the control size changes\n" - " }\n" + " {\n" + " // Code to call when the control size changes\n" + " }\n" "@endtsexample\n\n" "@see GuiControl\n\n" ); @@ -191,17 +191,17 @@ DefineEngineMethod( GuiMLTextCtrl, scrollToBottom, void, (),, } DefineEngineFunction(StripMLControlChars, const char*, (const char* inString),, - "@brief Strip TorqueML control characters from the specified string, returning a 'clean' version.\n\n" - "@param inString String to strip TorqueML control characters from.\n" - "@tsexample\n" - "// Define the string to strip TorqueML control characters from\n" - "%string = \"How Now Brown Cow\";\n\n" - "// Request the stripped version of the string\n" - "%strippedString = StripMLControlChars(%string);\n" - "@endtsexample\n\n" - "@return Version of the inputted string with all TorqueML characters removed.\n\n" - "@see References\n\n" - "@ingroup GuiCore") + "@brief Strip TorqueML control characters from the specified string, returning a 'clean' version.\n\n" + "@param inString String to strip TorqueML control characters from.\n" + "@tsexample\n" + "// Define the string to strip TorqueML control characters from\n" + "%string = \"How Now Brown Cow\";\n\n" + "// Request the stripped version of the string\n" + "%strippedString = StripMLControlChars(%string);\n" + "@endtsexample\n\n" + "@return Version of the inputted string with all TorqueML characters removed.\n\n" + "@see References\n\n" + "@ingroup GuiCore") { return GuiMLTextCtrl::stripControlChars(inString); } @@ -293,7 +293,7 @@ void GuiMLTextCtrl::initPersistFields() addField("deniedSound", TypeSFXTrackName, Offset(mDeniedSound, GuiMLTextCtrl), "If the text will not fit in the control, the deniedSound is played."); addField("text", TypeCaseString, Offset( mInitialText, GuiMLTextCtrl ), "Text to display in this control."); addField("useURLMouseCursor", TypeBool, Offset(mUseURLMouseCursor, GuiMLTextCtrl), "If true, the mouse cursor will turn into a hand cursor while over a link in the text.\n" - "This is dependant on the markup language used by the GuiMLTextCtrl\n"); + "This is dependant on the markup language used by the GuiMLTextCtrl\n"); endGroup( "Text" ); @@ -649,9 +649,9 @@ void GuiMLTextCtrl::ensureCursorOnScreen() // If our parent isn't a scroll control, or we're not the only control // in the content region, bail... GuiControl* pParent = getParent(); - GuiScrollCtrl *sc = dynamic_cast(pParent); - if(!sc) - return; + GuiScrollCtrl *sc = dynamic_cast(pParent); + if(!sc) + return; // Ok. Now we know that our parent is a scroll control. Let's find the // top of the cursor, and it's bottom. We can then scroll the parent control @@ -661,7 +661,7 @@ void GuiMLTextCtrl::ensureCursorOnScreen() ColorI color; getCursorPositionAndColor(cursorTopP, cursorBottomP, color); - sc->scrollRectVisible(RectI(cursorTopP.x, cursorTopP.y, 1, cursorBottomP.y - cursorTopP.y)); + sc->scrollRectVisible(RectI(cursorTopP.x, cursorTopP.y, 1, cursorBottomP.y - cursorTopP.y)); } //-------------------------------------- @@ -840,7 +840,7 @@ void GuiMLTextCtrl::onMouseUp(const GuiEvent& event) // Convert URL from UTF16 to UTF8. UTF8* url = mTextBuffer.createSubstring8(mHitURL->textStart, mHitURL->len); - onURL_callback(url); + onURL_callback(url); delete[] url; mHitURL = NULL; @@ -1018,7 +1018,7 @@ void GuiMLTextCtrl::scrollToTag( U32 id ) Con::warnf( ConsoleLogEntry::General, "GuiMLTextCtrl::scrollToTag - tag id %d not found!", id ); return; } - pappy->scrollRectVisible(RectI(0, tag->y, 1, 1)); + pappy->scrollRectVisible(RectI(0, tag->y, 1, 1)); } //-------------------------------------------------------------------------- @@ -1028,7 +1028,7 @@ void GuiMLTextCtrl::scrollToTop() GuiScrollCtrl *pappy = dynamic_cast(getParent()); if ( !pappy ) return; - pappy->scrollRectVisible(RectI(0,0,0,0)); + pappy->scrollRectVisible(RectI(0,0,0,0)); } //-------------------------------------------------------------------------- @@ -2134,7 +2134,7 @@ textemit: emitNewLine(mScanPos); setHeight( mMaxY ); onResize_callback( getWidth(), mMaxY ); - + //make sure the cursor is still visible - this handles if we're a child of a scroll ctrl... ensureCursorOnScreen(); } diff --git a/Engine/source/gui/controls/guiPopUpCtrl.cpp b/Engine/source/gui/controls/guiPopUpCtrl.cpp index aabce4d11..beb9fbcc8 100644 --- a/Engine/source/gui/controls/guiPopUpCtrl.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrl.cpp @@ -233,31 +233,31 @@ void GuiPopupTextListCtrl::onRenderCell(Point2I offset, Point2I cell, bool selec IMPLEMENT_CONOBJECT(GuiPopUpMenuCtrl); ConsoleDocClass( GuiPopUpMenuCtrl, - "@brief A control that allows to select a value from a drop-down list.\n\n" + "@brief A control that allows to select a value from a drop-down list.\n\n" - "For a nearly identical GUI with additional features, use GuiPopUpMenuCtrlEx.\n\n" + "For a nearly identical GUI with additional features, use GuiPopUpMenuCtrlEx.\n\n" - "@tsexample\n" - "new GuiPopUpMenuCtrl()\n" - "{\n" - " maxPopupHeight = \"200\";\n" - " sbUsesNAColor = \"0\";\n" - " reverseTextList = \"0\";\n" - " bitmapBounds = \"16 16\";\n" - " maxLength = \"1024\";\n" - " position = \"56 31\";\n" - " extent = \"64 64\";\n" - " minExtent = \"8 2\";\n" - " profile = \"GuiPopUpMenuProfile\";\n" - " tooltipProfile = \"GuiToolTipProfile\";\n" - "};\n" - "@endtsexample\n\n" + "@tsexample\n" + "new GuiPopUpMenuCtrl()\n" + "{\n" + " maxPopupHeight = \"200\";\n" + " sbUsesNAColor = \"0\";\n" + " reverseTextList = \"0\";\n" + " bitmapBounds = \"16 16\";\n" + " maxLength = \"1024\";\n" + " position = \"56 31\";\n" + " extent = \"64 64\";\n" + " minExtent = \"8 2\";\n" + " profile = \"GuiPopUpMenuProfile\";\n" + " tooltipProfile = \"GuiToolTipProfile\";\n" + "};\n" + "@endtsexample\n\n" - "@note This is definitely going to be deprecated soon.\n\n" + "@note This is definitely going to be deprecated soon.\n\n" - "@see GuiPopUpMenuCtrlEx for more features and better explanations.\n" + "@see GuiPopUpMenuCtrlEx for more features and better explanations.\n" - "@ingroup GuiControls\n"); + "@ingroup GuiControls\n"); GuiPopUpMenuCtrl::GuiPopUpMenuCtrl(void) { @@ -279,7 +279,7 @@ GuiPopUpMenuCtrl::GuiPopUpMenuCtrl(void) mReverseTextList = false; // Added - Don't reverse text list if displaying up mBitmapName = StringTable->insert(""); // Added mBitmapBounds.set(16, 16); // Added - mIdMax = -1; + mIdMax = -1; } //------------------------------------------------------------------------------ @@ -302,11 +302,11 @@ void GuiPopUpMenuCtrl::initPersistFields(void) //------------------------------------------------------------------------------ DefineConsoleMethod( GuiPopUpMenuCtrl, add, void, (const char * name, S32 idNum, U32 scheme), ("", -1, 0), "(string name, int idNum, int scheme=0)") { - object->addEntry(name, idNum, scheme); + object->addEntry(name, idNum, scheme); } DefineConsoleMethod( GuiPopUpMenuCtrl, addScheme, void, (U32 id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL), , - "(int id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL)") + "(int id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL)") { object->addScheme( id, fontColor, fontColorHL, fontColorSEL ); @@ -492,43 +492,43 @@ void GuiPopUpMenuCtrl::clear() setText(""); mSelIndex = -1; mRevNum = 0; - mIdMax = -1; + mIdMax = -1; } //------------------------------------------------------------------------------ void GuiPopUpMenuCtrl::clearEntry( S32 entry ) -{ - if( entry == -1 ) - return; +{ + if( entry == -1 ) + return; - U32 i = 0; - for ( ; i < mEntries.size(); i++ ) + U32 i = 0; + for ( ; i < mEntries.size(); i++ ) { if ( mEntries[i].id == entry ) break; } - mEntries.erase( i ); + mEntries.erase( i ); - if( mEntries.size() <= 0 ) - { - mEntries.setSize(0); - setText(""); - mSelIndex = -1; - mRevNum = 0; - } - else - { - if (entry < mSelIndex) - { - mSelIndex--; - } - else if( entry == mSelIndex ) - { - setText(""); - mSelIndex = -1; - } - } + if( mEntries.size() <= 0 ) + { + mEntries.setSize(0); + setText(""); + mSelIndex = -1; + mRevNum = 0; + } + else + { + if (entry < mSelIndex) + { + mSelIndex--; + } + else if( entry == mSelIndex ) + { + setText(""); + mSelIndex = -1; + } + } } //------------------------------------------------------------------------------ @@ -620,21 +620,21 @@ void GuiPopUpMenuCtrl::addEntry( const char *buf, S32 id, U32 scheme ) //Con::printf( "GuiPopupMenuCtrlEx::addEntry - Invalid buffer!" ); return; } - - // Ensure that there are no other entries with exactly the same name - for ( U32 i = 0; i < mEntries.size(); i++ ) + + // Ensure that there are no other entries with exactly the same name + for ( U32 i = 0; i < mEntries.size(); i++ ) { if ( dStrcmp( mEntries[i].buf, buf ) == 0 ) return; } - // If we don't give an id, create one from mIdMax - if( id == -1 ) - id = mIdMax + 1; - - // Increase mIdMax when an id is greater than it - if( id > mIdMax ) - mIdMax = id; + // If we don't give an id, create one from mIdMax + if( id == -1 ) + id = mIdMax + 1; + + // Increase mIdMax when an id is greater than it + if( id > mIdMax ) + mIdMax = id; Entry e; dStrcpy( e.buf, buf ); @@ -802,28 +802,28 @@ void GuiPopUpMenuCtrl::setFirstSelected( bool bNotifyScript ) setText( mEntries[0].buf ); } - // Execute the popup console command: - if( bNotifyScript ) + // Execute the popup console command: + if( bNotifyScript ) { if ( isMethod( "onSelect" ) ) Con::executef( this, "onSelect", Con::getIntArg( mEntries[ mSelIndex ].id ), mEntries[mSelIndex].buf ); - execConsoleCallback(); - } - } - else - { - if ( mReplaceText ) // Only change the displayed text if appropriate. - setText(""); - - mSelIndex = -1; - - if( bNotifyScript ) - { - Con::executef( this, "onCancel" ); execConsoleCallback(); } - } + } + else + { + if ( mReplaceText ) // Only change the displayed text if appropriate. + setText(""); + + mSelIndex = -1; + + if( bNotifyScript ) + { + Con::executef( this, "onCancel" ); + execConsoleCallback(); + } + } } //------------------------------------------------------------------------------ @@ -1278,11 +1278,11 @@ void GuiPopUpMenuCtrl::onAction() if ( setScroll ) { // Resize the text list - Point2I cellSize; - mTl->getCellSize( cellSize ); - cellSize.x = width - mSc->scrollBarThickness() - sbBorder; - mTl->setCellSize( cellSize ); - mTl->setWidth( cellSize.x ); + Point2I cellSize; + mTl->getCellSize( cellSize ); + cellSize.x = width - mSc->scrollBarThickness() - sbBorder; + mTl->setCellSize( cellSize ); + mTl->setWidth( cellSize.x ); if ( mSelIndex ) mTl->scrollCellVisible( Point2I( 0, mSelIndex ) ); @@ -1315,7 +1315,7 @@ void GuiPopUpMenuCtrl::addChildren() else { // Use the children's profile rather than the parent's profile, if it exists. - mSc->setControlProfile( mProfile->getChildrenProfile() ? mProfile->getChildrenProfile() : mProfile ); + mSc->setControlProfile( mProfile->getChildrenProfile() ? mProfile->getChildrenProfile() : mProfile ); } mSc->setField( "hScrollBar", "AlwaysOff" ); diff --git a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp index 0d90b9d73..510576f8a 100644 --- a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp @@ -30,27 +30,27 @@ #include "console/engineAPI.h" ConsoleDocClass( GuiPopUpMenuCtrlEx, - "@brief A control that allows to select a value from a drop-down list.\n\n" + "@brief A control that allows to select a value from a drop-down list.\n\n" - "This is essentially a GuiPopUpMenuCtrl, but with quite a few more features.\n\n" + "This is essentially a GuiPopUpMenuCtrl, but with quite a few more features.\n\n" - "@tsexample\n" - "new GuiPopUpMenuCtrlEx()\n" - "{\n" - " maxPopupHeight = \"200\";\n" - " sbUsesNAColor = \"0\";\n" - " reverseTextList = \"0\";\n" - " bitmapBounds = \"16 16\";\n" - " hotTrackCallback = \"0\";\n" - " extent = \"64 64\";\n" - " profile = \"GuiDefaultProfile\";\n" - " tooltipProfile = \"GuiToolTipProfile\";\n" - "};\n" - "@endtsexample\n\n" + "@tsexample\n" + "new GuiPopUpMenuCtrlEx()\n" + "{\n" + " maxPopupHeight = \"200\";\n" + " sbUsesNAColor = \"0\";\n" + " reverseTextList = \"0\";\n" + " bitmapBounds = \"16 16\";\n" + " hotTrackCallback = \"0\";\n" + " extent = \"64 64\";\n" + " profile = \"GuiDefaultProfile\";\n" + " tooltipProfile = \"GuiToolTipProfile\";\n" + "};\n" + "@endtsexample\n\n" - "@see GuiPopUpMenuCtrl\n" + "@see GuiPopUpMenuCtrl\n" - "@ingroup GuiControls\n"); + "@ingroup GuiControls\n"); static ColorI colorWhite(255,255,255); // Added @@ -331,7 +331,7 @@ GuiPopUpMenuCtrlEx::GuiPopUpMenuCtrlEx(void) mBitmapName = StringTable->insert(""); // Added mBitmapBounds.set(16, 16); // Added mHotTrackItems = false; - mIdMax = -1; + mIdMax = -1; } //------------------------------------------------------------------------------ @@ -355,13 +355,13 @@ void GuiPopUpMenuCtrlEx::initPersistFields(void) //------------------------------------------------------------------------------ ConsoleDocFragment _GuiPopUpMenuCtrlExAdd( - "@brief Adds an entry to the list\n\n" - "@param name String containing the name of the entry\n" - "@param idNum Numerical value assigned to the name\n" - "@param scheme Optional ID associated with a scheme " - "for font coloring, highlight coloring, and selection coloring\n\n", - "GuiPopUpMenuCtrlEx", - "void add(string name, S32 idNum, S32 scheme=0);" + "@brief Adds an entry to the list\n\n" + "@param name String containing the name of the entry\n" + "@param idNum Numerical value assigned to the name\n" + "@param scheme Optional ID associated with a scheme " + "for font coloring, highlight coloring, and selection coloring\n\n", + "GuiPopUpMenuCtrlEx", + "void add(string name, S32 idNum, S32 scheme=0);" ); DefineConsoleMethod( GuiPopUpMenuCtrlEx, add, void, (const char * name, S32 idNum, U32 scheme), ("", -1, 0), "(string name, int idNum, int scheme=0)") @@ -370,23 +370,23 @@ DefineConsoleMethod( GuiPopUpMenuCtrlEx, add, void, (const char * name, S32 idNu } DefineEngineMethod( GuiPopUpMenuCtrlEx, addCategory, void, (const char* text),, - "@brief Add a category to the list.\n\n" + "@brief Add a category to the list.\n\n" - "Acts as a separator between entries, allowing for sub-lists\n\n" + "Acts as a separator between entries, allowing for sub-lists\n\n" - "@param text Name of the new category\n\n") + "@param text Name of the new category\n\n") { - object->addEntry(text, -1, 0); + object->addEntry(text, -1, 0); } DefineEngineMethod( GuiPopUpMenuCtrlEx, addScheme, void, (S32 id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL),, - "@brief Create a new scheme and add it to the list of choices for when a new text entry is added.\n\n" - "@param id Numerical id associated with this scheme\n" - "@param fontColor The base text font color. Formatted as \"Red Green Blue\", each a numerical between 0 and 255.\n" - "@param fontColorHL Color of text when being highlighted. Formatted as \"Red Green Blue\", each a numerical between 0 and 255.\n" - "@param fontColorSel Color of text when being selected. Formatted as \"Red Green Blue\", each a numerical between 0 and 255.\n") + "@brief Create a new scheme and add it to the list of choices for when a new text entry is added.\n\n" + "@param id Numerical id associated with this scheme\n" + "@param fontColor The base text font color. Formatted as \"Red Green Blue\", each a numerical between 0 and 255.\n" + "@param fontColorHL Color of text when being highlighted. Formatted as \"Red Green Blue\", each a numerical between 0 and 255.\n" + "@param fontColorSel Color of text when being selected. Formatted as \"Red Green Blue\", each a numerical between 0 and 255.\n") { - /*ColorI fontColor, fontColorHL, fontColorSEL; + /*ColorI fontColor, fontColorHL, fontColorSEL; U32 r, g, b; char buf[64]; @@ -457,127 +457,127 @@ DefineEngineMethod( GuiPopUpMenuCtrlEx, addScheme, void, (S32 id, ColorI fontCol //} DefineEngineMethod( GuiPopUpMenuCtrlEx, setText, void, ( const char* text),, - "@brief Set the current text to a specified value.\n\n" - "@param text String containing new text to set\n\n") + "@brief Set the current text to a specified value.\n\n" + "@param text String containing new text to set\n\n") { - object->setText(text); + object->setText(text); } DefineEngineMethod( GuiPopUpMenuCtrlEx, getText, const char*, (),, - "@brief Get the.\n\n" + "@brief Get the.\n\n" - "Detailed description\n\n" + "Detailed description\n\n" - "@param param Description\n\n" + "@param param Description\n\n" - "@tsexample\n" - "// Comment\n" - "code();\n" - "@endtsexample\n\n" + "@tsexample\n" + "// Comment\n" + "code();\n" + "@endtsexample\n\n" - "@return Returns current text in string format") + "@return Returns current text in string format") { - return object->getText(); + return object->getText(); } DefineEngineMethod( GuiPopUpMenuCtrlEx, clear, void, (),, - "@brief Clear the popup list.\n\n") + "@brief Clear the popup list.\n\n") { - object->clear(); + object->clear(); } DefineEngineMethod( GuiPopUpMenuCtrlEx, sort, void, (),, - "@brief Sort the list alphabetically.\n\n") + "@brief Sort the list alphabetically.\n\n") { - object->sort(); + object->sort(); } DefineEngineMethod( GuiPopUpMenuCtrlEx, sortID, void, (),, - "@brief Sort the list by ID.\n\n") + "@brief Sort the list by ID.\n\n") { - object->sortID(); + object->sortID(); } DefineEngineMethod( GuiPopUpMenuCtrlEx, forceOnAction, void, (),, - "@brief Manually for the onAction function, which updates everything in this control.\n\n") + "@brief Manually for the onAction function, which updates everything in this control.\n\n") { - object->onAction(); + object->onAction(); } DefineEngineMethod( GuiPopUpMenuCtrlEx, forceClose, void, (),, - "@brief Manually force this control to collapse and close.\n\n") + "@brief Manually force this control to collapse and close.\n\n") { - object->closePopUp(); + object->closePopUp(); } DefineEngineMethod( GuiPopUpMenuCtrlEx, getSelected, S32, (),, - "@brief Get the current selection of the menu.\n\n" - "@return Returns the ID of the currently selected entry") + "@brief Get the current selection of the menu.\n\n" + "@return Returns the ID of the currently selected entry") { - return object->getSelected(); + return object->getSelected(); } ConsoleDocFragment _GuiPopUpMenuCtrlExsetSelected( - "brief Manually set an entry as selected int his control\n\n" - "@param id The ID of the entry to select\n" - "@param scripCallback Optional boolean that forces the script callback if true\n", - "GuiPopUpMenuCtrlEx", - "setSelected(int id, bool scriptCallback=true);" + "brief Manually set an entry as selected int his control\n\n" + "@param id The ID of the entry to select\n" + "@param scripCallback Optional boolean that forces the script callback if true\n", + "GuiPopUpMenuCtrlEx", + "setSelected(int id, bool scriptCallback=true);" ); DefineConsoleMethod( GuiPopUpMenuCtrlEx, setSelected, void, (S32 id, bool scriptCallback), (true), "(int id, [scriptCallback=true])" - "@hide") + "@hide") { object->setSelected( id, scriptCallback ); } ConsoleDocFragment _GuiPopUpMenuCtrlExsetFirstSelected( - "brief Manually set the selection to the first entry\n\n" - "@param scripCallback Optional boolean that forces the script callback if true\n", - "GuiPopUpMenuCtrlEx", - "setSelected(bool scriptCallback=true);" + "brief Manually set the selection to the first entry\n\n" + "@param scripCallback Optional boolean that forces the script callback if true\n", + "GuiPopUpMenuCtrlEx", + "setSelected(bool scriptCallback=true);" ); DefineConsoleMethod( GuiPopUpMenuCtrlEx, setFirstSelected, void, (bool scriptCallback), (true), "([scriptCallback=true])" - "@hide") + "@hide") { object->setFirstSelected( scriptCallback ); } DefineEngineMethod( GuiPopUpMenuCtrlEx, setNoneSelected, void, ( S32 param),, - "@brief Clears selection in the menu.\n\n") + "@brief Clears selection in the menu.\n\n") { - object->setNoneSelected(); + object->setNoneSelected(); } DefineEngineMethod( GuiPopUpMenuCtrlEx, getTextById, const char*, (S32 id),, - "@brief Get the text of an entry based on an ID.\n\n" - "@param id The ID assigned to the entry being queried\n\n" - "@return String contained by the specified entry, NULL if empty or bad ID") + "@brief Get the text of an entry based on an ID.\n\n" + "@param id The ID assigned to the entry being queried\n\n" + "@return String contained by the specified entry, NULL if empty or bad ID") { - return(object->getTextById(id)); + return(object->getTextById(id)); } DefineConsoleMethod( GuiPopUpMenuCtrlEx, getColorById, ColorI, (S32 id), , - "@brief Get color of an entry's box\n\n" - "@param id ID number of entry to query\n\n" - "@return ColorI in the format of \"Red Green Blue Alpha\", each of with is a value between 0 - 255") + "@brief Get color of an entry's box\n\n" + "@param id ID number of entry to query\n\n" + "@return ColorI in the format of \"Red Green Blue Alpha\", each of with is a value between 0 - 255") { ColorI color; object->getColoredBox(color, id); - return color; + return color; } DefineConsoleMethod( GuiPopUpMenuCtrlEx, setEnumContent, void, ( const char * className, const char * enumName ), , - "@brief This fills the popup with a classrep's field enumeration type info.\n\n" + "@brief This fills the popup with a classrep's field enumeration type info.\n\n" "More of a helper function than anything. If console access to the field list is added, " "at least for the enumerated types, then this should go away.\n\n" - "@param class Name of the class containing the enum\n" - "@param enum Name of the enum value to acces\n") + "@param class Name of the class containing the enum\n" + "@param enum Name of the enum value to acces\n") { AbstractClassRep * classRep = AbstractClassRep::getClassList(); @@ -630,24 +630,24 @@ DefineConsoleMethod( GuiPopUpMenuCtrlEx, setEnumContent, void, ( const char * cl //------------------------------------------------------------------------------ DefineConsoleMethod( GuiPopUpMenuCtrlEx, findText, S32, (const char * text), , "(string text)" "Returns the id of the first entry containing the specified text or -1 if not found." - "@param text String value used for the query\n\n" - "@return Numerical ID of entry containing the text.") + "@param text String value used for the query\n\n" + "@return Numerical ID of entry containing the text.") { return( object->findText( text ) ); } //------------------------------------------------------------------------------ DefineConsoleMethod( GuiPopUpMenuCtrlEx, size, S32, (), , - "@brief Get the size of the menu\n\n" - "@return Number of entries in the menu\n") + "@brief Get the size of the menu\n\n" + "@return Number of entries in the menu\n") { return( object->getNumEntries() ); } //------------------------------------------------------------------------------ DefineConsoleMethod( GuiPopUpMenuCtrlEx, replaceText, void, (S32 boolVal), , - "@brief Flag that causes each new text addition to replace the current entry\n\n" - "@param True to turn on replacing, false to disable it") + "@brief Flag that causes each new text addition to replace the current entry\n\n" + "@param True to turn on replacing, false to disable it") { object->replaceText(boolVal); } @@ -697,43 +697,43 @@ void GuiPopUpMenuCtrlEx::clear() setText(""); mSelIndex = -1; mRevNum = 0; - mIdMax = -1; + mIdMax = -1; } //------------------------------------------------------------------------------ void GuiPopUpMenuCtrlEx::clearEntry( S32 entry ) { - if( entry == -1 ) - return; + if( entry == -1 ) + return; - U32 i = 0; - for ( ; i < mEntries.size(); i++ ) + U32 i = 0; + for ( ; i < mEntries.size(); i++ ) { if ( mEntries[i].id == entry ) break; } - mEntries.erase( i ); + mEntries.erase( i ); - if( mEntries.size() <= 0 ) - { - mEntries.setSize(0); - setText(""); - mSelIndex = -1; - mRevNum = 0; - } - else - { - if( entry == mSelIndex ) - { - setText(""); - mSelIndex = -1; - } - else - { - mSelIndex--; - } - } + if( mEntries.size() <= 0 ) + { + mEntries.setSize(0); + setText(""); + mSelIndex = -1; + mRevNum = 0; + } + else + { + if( entry == mSelIndex ) + { + setText(""); + mSelIndex = -1; + } + else + { + mSelIndex--; + } + } } //------------------------------------------------------------------------------ @@ -797,9 +797,9 @@ void GuiPopUpMenuCtrlEx::sort() if( size > 0 ) dQsort( mEntries.address(), size, sizeof(Entry), textCompare); - // Entries need to re-Id themselves - for( U32 i = 0; i < mEntries.size(); i++ ) - mEntries[i].id = i; + // Entries need to re-Id themselves + for( U32 i = 0; i < mEntries.size(); i++ ) + mEntries[i].id = i; } // Added to sort by entry ID @@ -810,9 +810,9 @@ void GuiPopUpMenuCtrlEx::sortID() if( size > 0 ) dQsort( mEntries.address(), size, sizeof(Entry), idCompare); - // Entries need to re-Id themselves - for( U32 i = 0; i < mEntries.size(); i++ ) - mEntries[i].id = i; + // Entries need to re-Id themselves + for( U32 i = 0; i < mEntries.size(); i++ ) + mEntries[i].id = i; } //------------------------------------------------------------------------------ @@ -823,21 +823,21 @@ void GuiPopUpMenuCtrlEx::addEntry(const char *buf, S32 id, U32 scheme) //Con::printf( "GuiPopupMenuCtrlEx::addEntry - Invalid buffer!" ); return; } - - // Ensure that there are no other entries with exactly the same name - for ( U32 i = 0; i < mEntries.size(); i++ ) + + // Ensure that there are no other entries with exactly the same name + for ( U32 i = 0; i < mEntries.size(); i++ ) { if ( dStrcmp( mEntries[i].buf, buf ) == 0 ) return; } - // If we don't give an id, create one from mIdMax - if( id == -1 ) - id = mIdMax + 1; - - // Increase mIdMax when an id is greater than it - if( id > mIdMax ) - mIdMax = id; + // If we don't give an id, create one from mIdMax + if( id == -1 ) + id = mIdMax + 1; + + // Increase mIdMax when an id is greater than it + if( id > mIdMax ) + mIdMax = id; Entry e; dStrcpy( e.buf, buf ); @@ -992,20 +992,20 @@ void GuiPopUpMenuCtrlEx::setFirstSelected( bool bNotifyScript ) if ( isMethod( "onSelect" ) ) Con::executef( this, "onSelect", idval, mEntries[mSelIndex].buf ); - // Execute the popup console command: - if ( bNotifyScript ) - execConsoleCallback(); + // Execute the popup console command: + if ( bNotifyScript ) + execConsoleCallback(); } - else - { - if ( mReplaceText ) // Only change the displayed text if appropriate. - setText(""); - - mSelIndex = -1; + else + { + if ( mReplaceText ) // Only change the displayed text if appropriate. + setText(""); + + mSelIndex = -1; - if ( bNotifyScript ) - Con::executef( this, "onCancel" ); - } + if ( bNotifyScript ) + Con::executef( this, "onCancel" ); + } } //------------------------------------------------------------------------------ @@ -1500,11 +1500,11 @@ void GuiPopUpMenuCtrlEx::onAction() if ( setScroll ) { // Resize the text list - Point2I cellSize; - mTl->getCellSize( cellSize ); - cellSize.x = width - mSc->scrollBarThickness() - sbBorder; - mTl->setCellSize( cellSize ); - mTl->setWidth( cellSize.x ); + Point2I cellSize; + mTl->getCellSize( cellSize ); + cellSize.x = width - mSc->scrollBarThickness() - sbBorder; + mTl->setCellSize( cellSize ); + mTl->setWidth( cellSize.x ); if ( mSelIndex ) mTl->scrollCellVisible( Point2I( 0, mSelIndex ) ); @@ -1536,7 +1536,7 @@ void GuiPopUpMenuCtrlEx::addChildren() else { // Use the children's profile rather than the parent's profile, if it exists. - mSc->setControlProfile( mProfile->getChildrenProfile() ? mProfile->getChildrenProfile() : mProfile ); + mSc->setControlProfile( mProfile->getChildrenProfile() ? mProfile->getChildrenProfile() : mProfile ); } mSc->setField( "hScrollBar", "AlwaysOff" ); mSc->setField( "vScrollBar", "dynamic" ); diff --git a/Engine/source/gui/controls/guiTextCtrl.cpp b/Engine/source/gui/controls/guiTextCtrl.cpp index e1079d8e0..e8c9057f1 100644 --- a/Engine/source/gui/controls/guiTextCtrl.cpp +++ b/Engine/source/gui/controls/guiTextCtrl.cpp @@ -37,13 +37,13 @@ ConsoleDocClass( GuiTextCtrl, "@brief GUI control object this displays a single line of text, without TorqueML.\n\n" "@tsexample\n" - " new GuiTextCtrl()\n" - " {\n" - " text = \"Hello World\";\n" - " textID = \"\"STR_HELLO\"\";\n" - " maxlength = \"1024\";\n" - " //Properties not specific to this control have been omitted from this example.\n" - " };\n" + " new GuiTextCtrl()\n" + " {\n" + " text = \"Hello World\";\n" + " textID = \"\"STR_HELLO\"\";\n" + " maxlength = \"1024\";\n" + " //Properties not specific to this control have been omitted from this example.\n" + " };\n" "@endtsexample\n\n" "@see GuiControl\n" @@ -84,7 +84,7 @@ DefineEngineMethod( GuiTextCtrl, setTextID, void, (const char* textID),, "@see GuiControl" "@see Localization") { - object->setTextID( textID ); + object->setTextID( textID ); } void GuiTextCtrl::initPersistFields() @@ -117,7 +117,7 @@ void GuiTextCtrl::inspectPostApply() { Parent::inspectPostApply(); if(mInitialTextID && *mInitialTextID != 0) - setTextID(mInitialTextID); + setTextID(mInitialTextID); else if( mConsoleVariable[ 0 ] ) setText( getVariable() ); else @@ -135,7 +135,7 @@ bool GuiTextCtrl::onWake() return false; } if(mInitialTextID && *mInitialTextID != 0) - setTextID(mInitialTextID); + setTextID(mInitialTextID); if ( mConsoleVariable[0] ) { @@ -202,19 +202,19 @@ void GuiTextCtrl::setText(const char *txt) void GuiTextCtrl::setTextID(const char *id) { - S32 n = Con::getIntVariable(id, -1); - if(n != -1) - { - mInitialTextID = StringTable->insert(id); - setTextID(n); - } + S32 n = Con::getIntVariable(id, -1); + if(n != -1) + { + mInitialTextID = StringTable->insert(id); + setTextID(n); + } } void GuiTextCtrl::setTextID(S32 id) { - const UTF8 *str = getGUIString(id); - if(str) - setText((const char*)str); - //mInitialTextID = id; + const UTF8 *str = getGUIString(id); + if(str) + setText((const char*)str); + //mInitialTextID = id; } void GuiTextCtrl::onPreRender() diff --git a/Engine/source/gui/controls/guiTextEditCtrl.cpp b/Engine/source/gui/controls/guiTextEditCtrl.cpp index 99a1342c0..9084e8d8d 100644 --- a/Engine/source/gui/controls/guiTextEditCtrl.cpp +++ b/Engine/source/gui/controls/guiTextEditCtrl.cpp @@ -46,17 +46,17 @@ ConsoleDocClass( GuiTextEditCtrl, "@tsexample\n" " new GuiTextEditCtrl(MessageHud_Edit)\n" - " {\n" - " text = \"Hello World\";\n" - " validate = \"validateCommand();\"\n" - " escapeCommand = \"escapeCommand();\";\n" - " historySize = \"5\";\n" - " tabComplete = \"true\";\n" - " deniedSound = \"DeniedSoundProfile\";\n" - " sinkAllKeyEvents = \"true\";\n" - " password = \"true\";\n" - " passwordMask = \"*\";\n" - " //Properties not specific to this control have been omitted from this example.\n" + " {\n" + " text = \"Hello World\";\n" + " validate = \"validateCommand();\"\n" + " escapeCommand = \"escapeCommand();\";\n" + " historySize = \"5\";\n" + " tabComplete = \"true\";\n" + " deniedSound = \"DeniedSoundProfile\";\n" + " sinkAllKeyEvents = \"true\";\n" + " password = \"true\";\n" + " passwordMask = \"*\";\n" + " //Properties not specific to this control have been omitted from this example.\n" " };\n" "@endtsexample\n\n" @@ -72,9 +72,9 @@ IMPLEMENT_CALLBACK( GuiTextEditCtrl, onTabComplete, void, (const char* val),( va "@tsexample\n" "// Tab key has been pressed, causing the callback to occur.\n" "GuiTextEditCtrl::onTabComplete(%this,%val)\n" - " {\n" - " //Code to run when the onTabComplete callback occurs\n" - " }\n" + " {\n" + " //Code to run when the onTabComplete callback occurs\n" + " }\n" "@endtsexample\n\n" "@see GuiTextCtrl\n" "@see GuiControl\n\n" @@ -85,9 +85,9 @@ IMPLEMENT_CALLBACK( GuiTextEditCtrl, onReturn, void, (),(), "@tsexample\n" "// Return or Enter key was pressed, causing the callback to occur.\n" "GuiTextEditCtrl::onReturn(%this)\n" - " {\n" - " // Code to run when the onReturn callback occurs\n" - " }\n" + " {\n" + " // Code to run when the onReturn callback occurs\n" + " }\n" "@endtsexample\n\n" "@see GuiTextCtrl\n" "@see GuiControl\n\n" @@ -98,9 +98,9 @@ IMPLEMENT_CALLBACK( GuiTextEditCtrl, onValidate, void, (),(), "@tsexample\n" "// The control gets validated, causing the callback to occur\n" "GuiTextEditCtrl::onValidated(%this)\n" - " {\n" - " // Code to run when the control is validated\n" - " }\n" + " {\n" + " // Code to run when the control is validated\n" + " }\n" "@endtsexample\n\n" "@see GuiTextCtrl\n" "@see GuiControl\n\n" @@ -139,7 +139,7 @@ GuiTextEditCtrl::GuiTextEditCtrl() mHistoryBuf = NULL; #if defined(__MACOSX__) - UTF8 bullet[4] = { 0xE2, 0x80, 0xA2, 0 }; + UTF8 bullet[4] = { 0xE2, 0x80, 0xA2, 0 }; mPasswordMask = StringTable->insert( bullet ); #else @@ -710,10 +710,10 @@ bool GuiTextEditCtrl::onKeyDown(const GuiEvent &event) case KEY_TAB: if ( mTabComplete ) { - onTabComplete_callback("1"); + onTabComplete_callback("1"); return true; } - break; // We don't want to fall through if we don't handle the TAB here. + break; // We don't want to fall through if we don't handle the TAB here. case KEY_HOME: mBlockStart = 0; @@ -779,10 +779,10 @@ bool GuiTextEditCtrl::onKeyDown(const GuiEvent &event) } return true; - case KEY_RETURN: - case KEY_NUMPADENTER: + case KEY_RETURN: + case KEY_NUMPADENTER: - return dealWithEnter(false); + return dealWithEnter(false); default: break; @@ -998,7 +998,7 @@ bool GuiTextEditCtrl::onKeyDown(const GuiEvent &event) case KEY_RETURN: case KEY_NUMPADENTER: - return dealWithEnter(true); + return dealWithEnter(true); case KEY_UP: { @@ -1155,7 +1155,7 @@ dealWithBackspace: case KEY_TAB: if ( mTabComplete ) { - onTabComplete_callback("0"); + onTabComplete_callback("0"); return( true ); } case KEY_UP: @@ -1208,9 +1208,9 @@ bool GuiTextEditCtrl::dealWithEnter( bool clearResponder ) return true; } } - - if( clearResponder ) - clearFirstResponder(); + + if( clearResponder ) + clearFirstResponder(); return true; } @@ -1222,13 +1222,13 @@ void GuiTextEditCtrl::setFirstResponder() GuiCanvas *root = getRoot(); if (root != NULL) { - root->enableKeyboardTranslation(); + root->enableKeyboardTranslation(); - // If the native OS accelerator keys are not disabled - // then some key events like Delete, ctrl+V, etc may - // not make it down to us. - root->setNativeAcceleratorsEnabled( false ); + // If the native OS accelerator keys are not disabled + // then some key events like Delete, ctrl+V, etc may + // not make it down to us. + root->setNativeAcceleratorsEnabled( false ); } } @@ -1237,8 +1237,8 @@ void GuiTextEditCtrl::onLoseFirstResponder() GuiCanvas *root = getRoot(); if( root ) { - root->setNativeAcceleratorsEnabled( true ); - root->disableKeyboardTranslation(); + root->setNativeAcceleratorsEnabled( true ); + root->disableKeyboardTranslation(); } //execute the validate command @@ -1546,29 +1546,29 @@ void GuiTextEditCtrl::handleCharInput( U16 ascii ) //see if it's a number field if ( mProfile->mNumbersOnly ) { - if (ascii == '-') - { - //a minus sign only exists at the beginning, and only a single minus sign - if (mCursorPos != 0 && !isAllTextSelected()) - { - invalidText(); - return; - } + if (ascii == '-') + { + //a minus sign only exists at the beginning, and only a single minus sign + if (mCursorPos != 0 && !isAllTextSelected()) + { + invalidText(); + return; + } - if (mInsertOn && (mTextBuffer.getChar(0) == '-')) - { - invalidText(); - return; - } - } - // BJTODO: This is probably not unicode safe. - else if (ascii != '.' && (ascii < '0' || ascii > '9')) - { - invalidText(); - return; - } - else - validText(); + if (mInsertOn && (mTextBuffer.getChar(0) == '-')) + { + invalidText(); + return; + } + } + // BJTODO: This is probably not unicode safe. + else if (ascii != '.' && (ascii < '0' || ascii > '9')) + { + invalidText(); + return; + } + else + validText(); } //save the current state @@ -1778,22 +1778,22 @@ DefineEngineMethod( GuiTextEditCtrl, forceValidateText, void, (),, } DefineEngineMethod(GuiTextEditCtrl, invalidText, void, (bool playSound), (true), - "@brief Trigger the invalid sound and make the box red.nn" - "@param playSound Play the invalid text sound or not.n") + "@brief Trigger the invalid sound and make the box red.nn" + "@param playSound Play the invalid text sound or not.n") { - object->invalidText(playSound); + object->invalidText(playSound); } DefineEngineMethod(GuiTextEditCtrl, validText, void, (), , - "@brief Restores the box to normal color.nn") + "@brief Restores the box to normal color.nn") { - object->validText(); + object->validText(); } DefineEngineMethod(GuiTextEditCtrl, isValidText, bool, (), , - "@brief Returns if the text is set to valid or not.n" - "@Return true if text is set to valid, false if not.nn") + "@brief Returns if the text is set to valid or not.n" + "@Return true if text is set to valid, false if not.nn") { - return object->isValidText(); + return object->isValidText(); } diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index c98fc90aa..e1b20ad5f 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -43,9 +43,9 @@ IMPLEMENT_CONOBJECT(GuiTreeViewCtrl); ConsoleDocClass( GuiTreeViewCtrl, - "@brief Hierarchical list of text items with optional icons.\n\n" + "@brief Hierarchical list of text items with optional icons.\n\n" - "Can also be used to inspect SimObject hierarchies, primarily within editors.\n\n" + "Can also be used to inspect SimObject hierarchies, primarily within editors.\n\n" "GuiTreeViewCtrls can either display arbitrary user-defined trees or can be used to display SimObject hierarchies where " "each parent node in the tree is a SimSet or SimGroup and each leaf node is a SimObject.\n\n" @@ -59,30 +59,30 @@ ConsoleDocClass( GuiTreeViewCtrl, "Each item in the tree has a distinct numeric ID that is unique within its tree. The ID of the root item, which is always " "present on a tree, is 0.\n\n" - "@tsexample\n" - "new GuiTreeViewCtrl(DatablockEditorTree)\n" - "{\n" - " tabSize = \"16\";\n" - " textOffset = \"2\";\n" - " fullRowSelect = \"0\";\n" - " itemHeight = \"21\";\n" - " destroyTreeOnSleep = \"0\";\n" - " MouseDragging = \"0\";\n" - " MultipleSelections = \"1\";\n" - " DeleteObjectAllowed = \"1\";\n" - " DragToItemAllowed = \"0\";\n" - " ClearAllOnSingleSelection = \"1\";\n" - " showRoot = \"1\";\n" - " internalNamesOnly = \"0\";\n" - " objectNamesOnly = \"0\";\n" - " compareToObjectID = \"0\";\n" - " Profile = \"GuiTreeViewProfile\";\n" - " tooltipprofile = \"GuiToolTipProfile\";\n" - " hovertime = \"1000\";\n" - "};\n" - "@endtsexample\n\n" + "@tsexample\n" + "new GuiTreeViewCtrl(DatablockEditorTree)\n" + "{\n" + " tabSize = \"16\";\n" + " textOffset = \"2\";\n" + " fullRowSelect = \"0\";\n" + " itemHeight = \"21\";\n" + " destroyTreeOnSleep = \"0\";\n" + " MouseDragging = \"0\";\n" + " MultipleSelections = \"1\";\n" + " DeleteObjectAllowed = \"1\";\n" + " DragToItemAllowed = \"0\";\n" + " ClearAllOnSingleSelection = \"1\";\n" + " showRoot = \"1\";\n" + " internalNamesOnly = \"0\";\n" + " objectNamesOnly = \"0\";\n" + " compareToObjectID = \"0\";\n" + " Profile = \"GuiTreeViewProfile\";\n" + " tooltipprofile = \"GuiToolTipProfile\";\n" + " hovertime = \"1000\";\n" + "};\n" + "@endtsexample\n\n" - "@ingroup GuiContainers\n"); + "@ingroup GuiContainers\n"); IMPLEMENT_CALLBACK( GuiTreeViewCtrl, onDeleteObject, bool, ( SimObject* object ), ( object ), "" ); IMPLEMENT_CALLBACK( GuiTreeViewCtrl, isValidDragTarget, bool, ( S32 id, const char* value ), ( id, value ), "" ); @@ -511,7 +511,7 @@ void GuiTreeViewCtrl::Item::getDisplayText(U32 bufLen, char *buf) if( showInternalNameOnly() ) dSprintf( buf, bufLen, "%s", hasInternalName ? pInternalName : "(none)" ); - else if( showObjectNameOnly() ) + else if( showObjectNameOnly() ) { if( !hasObjectName && mState.test( ShowClassNameForUnnamed ) ) dSprintf( buf, bufLen, "%s", pClassName ); @@ -801,7 +801,7 @@ GuiTreeViewCtrl::GuiTreeViewCtrl() mStart = 0; mPossibleRenameItem = NULL; mRenamingItem = NULL; - mTempItem = NULL; + mTempItem = NULL; mRenameCtrl = NULL; mDraggedToItem = 0; @@ -1902,7 +1902,7 @@ void GuiTreeViewCtrl::onPreRender() if(mFlags.test(RebuildVisible)) { buildVisibleTree(); - mFlags.clear(RebuildVisible); + mFlags.clear(RebuildVisible); } } @@ -2084,39 +2084,39 @@ void GuiTreeViewCtrl::syncSelection() } else if (mVisibleItems[i]->isInspectorData()) { - if(mCompareToObjectID) - { - if (mVisibleItems[i]->getObject() && mVisibleItems[i]->getObject()->getId() == mSelected[j]) - { - // check to see if it is on the visible items list. - bool addToSelectedItems = true; - for (S32 k = 0; k < mSelectedItems.size(); k++) - { - if (mSelectedItems[k]->isInspectorData() && mSelectedItems[k]->getObject() ) - { - if (mSelected[j] == mSelectedItems[k]->getObject()->getId()) - { - // don't add it - addToSelectedItems = false; - } - } - else - { - if (mSelected[j] == mSelectedItems[k]->mId) - { - // don't add it - addToSelectedItems = false; - } - } - } - if (addToSelectedItems) - { - mVisibleItems[i]->mState.set(Item::Selected, true); - mSelectedItems.push_front(mVisibleItems[i]); - break; - } - } - } + if(mCompareToObjectID) + { + if (mVisibleItems[i]->getObject() && mVisibleItems[i]->getObject()->getId() == mSelected[j]) + { + // check to see if it is on the visible items list. + bool addToSelectedItems = true; + for (S32 k = 0; k < mSelectedItems.size(); k++) + { + if (mSelectedItems[k]->isInspectorData() && mSelectedItems[k]->getObject() ) + { + if (mSelected[j] == mSelectedItems[k]->getObject()->getId()) + { + // don't add it + addToSelectedItems = false; + } + } + else + { + if (mSelected[j] == mSelectedItems[k]->mId) + { + // don't add it + addToSelectedItems = false; + } + } + } + if (addToSelectedItems) + { + mVisibleItems[i]->mState.set(Item::Selected, true); + mSelectedItems.push_front(mVisibleItems[i]); + break; + } + } + } } } @@ -2200,14 +2200,14 @@ void GuiTreeViewCtrl::addSelection( S32 itemOrObjectId, bool update, bool isLast } const S32 itemId = item->getID(); - - // Ok, we have an item to select which isn't already selected.... + + // Ok, we have an item to select which isn't already selected.... // Do we want to allow more than one selected item? if( !mMultipleSelections ) clearSelection(); - // Add this object id to the vector of selected objectIds + // Add this object id to the vector of selected objectIds // if it is not already. bool foundMatch = false; for ( S32 i = 0; i < mSelected.size(); i++) @@ -2228,21 +2228,21 @@ void GuiTreeViewCtrl::addSelection( S32 itemOrObjectId, bool update, bool isLast // Callback Start // Set and add the selection to the selected items group - item->mState.set(Item::Selected, true); - mSelectedItems.push_front(item); + item->mState.set(Item::Selected, true); + mSelectedItems.push_front(item); if ( item->isInspectorData() && item->getObject() ) { SimObject *obj = item->getObject(); - + onAddSelection_callback( obj->getId(), isLastSelection ); } else { onAddSelection_callback( item->mId, isLastSelection ); } - // Callback end + // Callback end mFlags.set( RebuildVisible ); if( update ) @@ -2262,7 +2262,7 @@ void GuiTreeViewCtrl::onItemSelected( Item *item ) if (item->isInspectorData()) { SimObject* object = item->getObject(); - if( object ) + if( object ) onSelect_callback( object->getId() ); if( !item->isParent() && object ) onInspect_callback( object->getId() ); @@ -2590,9 +2590,9 @@ void GuiTreeViewCtrl::deleteSelection() } else { - Vector delSelection; - delSelection = mSelectedItems; - mSelectedItems.clear(); + Vector delSelection; + delSelection = mSelectedItems; + mSelectedItems.clear(); while (!delSelection.empty()) { Item * item = delSelection.front(); @@ -2600,7 +2600,7 @@ void GuiTreeViewCtrl::deleteSelection() if ( item->mParent ) _deleteItem( item ); - delSelection.pop_front(); + delSelection.pop_front(); } } @@ -2642,7 +2642,7 @@ bool GuiTreeViewCtrl::onKeyDown( const GuiEvent& event ) return true; } - //call a generic bit of script that will let the subclass know that a key was pressed + //call a generic bit of script that will let the subclass know that a key was pressed onKeyDown_callback( event.modifier, event.keyCode ); } @@ -3028,29 +3028,29 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event) return; } - BitSet32 hitFlags = 0; + BitSet32 hitFlags = 0; Item *item; - bool hitCheck = _hitTest( event.mousePoint, item, hitFlags ); + bool hitCheck = _hitTest( event.mousePoint, item, hitFlags ); mRenamingItem = NULL; - if( hitCheck ) - { - if ( event.mouseClickCount == 1 && !mMouseDragged && mPossibleRenameItem != NULL ) - { - if ( item == mPossibleRenameItem ) + if( hitCheck ) + { + if ( event.mouseClickCount == 1 && !mMouseDragged && mPossibleRenameItem != NULL ) + { + if ( item == mPossibleRenameItem ) showItemRenameCtrl( item ); - } - else // If mouseUp occurs on the same item as mouse down - { - bool wasSelected = isSelected( item ); - bool multiSelect = getSelectedItemsCount() > 1; - if( wasSelected && multiSelect && item == mTempItem ) - { - clearSelection(); - addSelection( item->mId ); - } - } - } + } + else // If mouseUp occurs on the same item as mouse down + { + bool wasSelected = isSelected( item ); + bool multiSelect = getSelectedItemsCount() > 1; + if( wasSelected && multiSelect && item == mTempItem ) + { + clearSelection(); + addSelection( item->mId ); + } + } + } mPossibleRenameItem = NULL; @@ -3482,7 +3482,7 @@ void GuiTreeViewCtrl::onMouseDragged(const GuiEvent &event) if( mDragStartInSelection ) onMouseDragged_callback(); - if(!mSupportMouseDragging) + if(!mSupportMouseDragging) return; if( !mActive || !mAwake || !mVisible ) @@ -3652,7 +3652,7 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event) mPossibleRenameItem = NULL; mRenamingItem = NULL; - mTempItem = NULL; + mTempItem = NULL; // if( event.modifier & SI_MULTISELECT ) @@ -3704,10 +3704,10 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event) //select up for (S32 j = (mCurrentDragCell); j < firstSelectedIndex; j++) { - if( j != (firstSelectedIndex - 1) ) - addSelection(mVisibleItems[j]->mId, false, false); - else - addSelection(mVisibleItems[j]->mId, false); + if( j != (firstSelectedIndex - 1) ) + addSelection(mVisibleItems[j]->mId, false, false); + else + addSelection(mVisibleItems[j]->mId, false); } } else @@ -3715,10 +3715,10 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event) // select down for (S32 j = firstSelectedIndex+1; j < (mCurrentDragCell+1); j++) { - if( j != mCurrentDragCell ) - addSelection(mVisibleItems[j]->mId, false, false); - else - addSelection(mVisibleItems[j]->mId, false); + if( j != mCurrentDragCell ) + addSelection(mVisibleItems[j]->mId, false, false); + else + addSelection(mVisibleItems[j]->mId, false); } } @@ -3736,39 +3736,39 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event) } else if ( !hitFlags.test(OnImage) ) { - mTempItem = item; + mTempItem = item; bool wasSelected = isSelected( item ); bool multiSelect = getSelectedItemsCount() > 1; - - if( !wasSelected || !multiSelect ) - { - if ( mClearAllOnSingleSelection ) - clearSelection(); + + if( !wasSelected || !multiSelect ) + { + if ( mClearAllOnSingleSelection ) + clearSelection(); - if ( !wasSelected || mClearAllOnSingleSelection ) - addSelection( item->mId ); + if ( !wasSelected || mClearAllOnSingleSelection ) + addSelection( item->mId ); - if ( wasSelected && - !multiSelect && - mCanRenameObjects && - hitFlags.test(OnText) && - mFlags.test(IsEditable) && - item->isInspectorData() && - item->getObject() && + if ( wasSelected && + !multiSelect && + mCanRenameObjects && + hitFlags.test(OnText) && + mFlags.test(IsEditable) && + item->isInspectorData() && + item->getObject() && item->getObject()->isNameChangeAllowed() && - item != mRoot && - event.mouseClickCount == 1 ) - { - mPossibleRenameItem = item; + item != mRoot && + event.mouseClickCount == 1 ) + { + mPossibleRenameItem = item; - if ( isMethod( "canRenameObject" ) ) - { - if( canRenameObject_callback( item->getObject() ) ) - mPossibleRenameItem = NULL; - } - } - } + if ( isMethod( "canRenameObject" ) ) + { + if( canRenameObject_callback( item->getObject() ) ) + mPossibleRenameItem = NULL; + } + } + } } @@ -4221,7 +4221,7 @@ void GuiTreeViewCtrl::onRenderCell(Point2I offset, Point2I cell, bool, bool ) if( item->mState.test(Item::MouseOverText) ) { - fontColor = mProfile->mFontColorHL; + fontColor = mProfile->mFontColorHL; } drawer->setBitmapModulation( fontColor ); @@ -4551,9 +4551,9 @@ void GuiTreeViewCtrl::inspectorSearch(Item * item, Item * parent, SimSet * paren bool GuiTreeViewCtrl::objectSearch( const SimObject *object, Item **item ) { - for ( U32 i = 0; i < mItems.size(); i++ ) - { - Item *pItem = mItems[i]; + for ( U32 i = 0; i < mItems.size(); i++ ) + { + Item *pItem = mItems[i]; if ( !pItem ) continue; @@ -4565,16 +4565,16 @@ bool GuiTreeViewCtrl::objectSearch( const SimObject *object, Item **item ) continue; #endif - SimObject *pObj = pItem->getObject(); + SimObject *pObj = pItem->getObject(); - if ( pObj && pObj == object ) - { - *item = pItem; - return true; - } - } + if ( pObj && pObj == object ) + { + *item = pItem; + return true; + } + } - return false; + return false; } //----------------------------------------------------------------------------- @@ -4592,7 +4592,7 @@ bool GuiTreeViewCtrl::onVirtualParentBuild(Item *item, bool bForceFullUpdate) } // Skip the next stuff unless we're expanded... - if(!item->isExpanded() && !bForceFullUpdate && !( item == mRoot && !mShowRoot ) ) + if(!item->isExpanded() && !bForceFullUpdate && !( item == mRoot && !mShowRoot ) ) return true; // Verify that we have all the kids we should in here... @@ -4704,8 +4704,8 @@ S32 GuiTreeViewCtrl::findItemByName(const char *name) { if ( !mItems[i] ) continue; - if( mItems[i]->mState.test( Item::InspectorData ) ) - continue; + if( mItems[i]->mState.test( Item::InspectorData ) ) + continue; if (mItems[i] && dStrcmp(mItems[i]->getText(),name) == 0) return mItems[i]->mId; } @@ -4721,10 +4721,10 @@ S32 GuiTreeViewCtrl::findItemByValue(const char *name) { if (!mItems[i]) continue; - if( mItems[i]->mState.test( Item::InspectorData ) ) - continue; - if (mItems[i] && dStrcmp(mItems[i]->getValue(),name) == 0) - return mItems[i]->mId; + if( mItems[i]->mState.test( Item::InspectorData ) ) + continue; + if (mItems[i] && dStrcmp(mItems[i]->getValue(),name) == 0) + return mItems[i]->mId; } return 0; @@ -4874,7 +4874,7 @@ DefineEngineMethod( GuiTreeViewCtrl, insertItem, S32, ( S32 parentId, const char DefineEngineMethod( GuiTreeViewCtrl, insertObject, S32, ( S32 parentId, SimObject* obj, bool OKToEdit ), (false), "Inserts object as a child to the given parent." ) { - return object->insertObject(parentId, obj, OKToEdit); + return object->insertObject(parentId, obj, OKToEdit); } //----------------------------------------------------------------------------- @@ -4967,10 +4967,10 @@ DefineEngineMethod( GuiTreeViewCtrl, removeChildSelectionByValue, void, ( S32 pa if(parentItem) { GuiTreeViewCtrl::Item* child = parentItem->findChildByValue(value); - if(child) - { + if(child) + { object->removeSelection(child->getID()); - } + } } } @@ -5038,7 +5038,7 @@ DefineEngineMethod( GuiTreeViewCtrl, open, void, ( const char * objName, bool ok DefineEngineMethod( GuiTreeViewCtrl, setItemTooltip, bool, ( S32 itemId, const char* tooltip), , "Set the tooltip to show for the given item.\n\n" "@param itemId TreeItemID of item to set the tooltip for.\n" - "@param tooltip String tooltip to set for the item." + "@param tooltip String tooltip to set for the item." "@return True if successfully found the item, false if not") { GuiTreeViewCtrl::Item* item = object->getItem( itemId ); @@ -5228,11 +5228,11 @@ const char* GuiTreeViewCtrl::getSelectedObjectList() { S32 id = item->getObject()->getId(); //get the current length of the buffer - U32 len = dStrlen(buff); + U32 len = dStrlen(buff); //the start of the buffer where we want to write char* buffPart = buff+len; //the size of the remaining buffer (-1 cause dStrlen doesn't count the \0) - S32 size = bufSize-len-1; + S32 size = bufSize-len-1; //write it: if(size < 1) { @@ -5283,7 +5283,7 @@ DefineEngineMethod( GuiTreeViewCtrl, getTextToRoot, const char*, (S32 itemId, co "@param delimiter (Optional) delimiter to use between each branch concatenation." "@return text from the current node to the root.") { - if (!dStrcmp(delimiter, "" )) + if (!dStrcmp(delimiter, "" )) { Con::warnf("GuiTreeViewCtrl::getTextToRoot - Invalid number of arguments!"); return (""); @@ -5296,31 +5296,31 @@ DefineEngineMethod( GuiTreeViewCtrl, getSelectedItemList, const char*, (), , "@return space separated list of selected item ids.") { const U32 bufSize = 1024; - char* buff = Con::getReturnBuffer(bufSize); - dSprintf(buff, bufSize, ""); + char* buff = Con::getReturnBuffer(bufSize); + dSprintf(buff, bufSize, ""); const Vector< S32 >& selected = object->getSelected(); - for(int i = 0; i < selected.size(); i++) - { - S32 id = selected[i]; - //get the current length of the buffer - U32 len = dStrlen(buff); - //the start of the buffer where we want to write - char* buffPart = buff+len; - //the size of the remaining buffer (-1 cause dStrlen doesn't count the \0) - S32 size = bufSize-len-1; - //write it: - if(size < 1) - { - Con::errorf("GuiTreeViewCtrl::getSelectedItemList - Not enough room to return our object list"); - return buff; - } + for(int i = 0; i < selected.size(); i++) + { + S32 id = selected[i]; + //get the current length of the buffer + U32 len = dStrlen(buff); + //the start of the buffer where we want to write + char* buffPart = buff+len; + //the size of the remaining buffer (-1 cause dStrlen doesn't count the \0) + S32 size = bufSize-len-1; + //write it: + if(size < 1) + { + Con::errorf("GuiTreeViewCtrl::getSelectedItemList - Not enough room to return our object list"); + return buff; + } - dSprintf(buffPart,size,"%d ", id); - } + dSprintf(buffPart,size,"%d ", id); + } //mSelected - return buff; + return buff; } S32 GuiTreeViewCtrl::findItemByObjectId(S32 iObjId) @@ -5331,8 +5331,8 @@ S32 GuiTreeViewCtrl::findItemByObjectId(S32 iObjId) continue; SimObject* pObj = mItems[i]->getObject(); - if( pObj && pObj->getId() == iObjId ) - return mItems[i]->mId; + if( pObj && pObj->getId() == iObjId ) + return mItems[i]->mId; } return -1; @@ -5341,7 +5341,7 @@ S32 GuiTreeViewCtrl::findItemByObjectId(S32 iObjId) //------------------------------------------------------------------------------ DefineEngineMethod( GuiTreeViewCtrl, findItemByObjectId, S32, (S32 objectId), , "Find an item by its object id and returns the Tree Item ID for it.\n\n" - "@param objectId Object id you want the item id for." + "@param objectId Object id you want the item id for." "@return Tree Item Id for the given object ID.") { return(object->findItemByObjectId(objectId)); @@ -5389,7 +5389,7 @@ bool GuiTreeViewCtrl::scrollVisibleByObjectId(S32 objID) //------------------------------------------------------------------------------ DefineEngineMethod( GuiTreeViewCtrl, scrollVisibleByObjectId, S32, (S32 objectId), , "Show item by object id.\n\n" - "@param objectId Object id you want to scroll to." + "@param objectId Object id you want to scroll to." "@return True if successful, false if not.") { return(object->scrollVisibleByObjectId(objectId)); @@ -5400,7 +5400,7 @@ DefineEngineMethod( GuiTreeViewCtrl, scrollVisibleByObjectId, S32, (S32 objectId //FIXME: this clashes with SimSet.sort() DefineEngineMethod( GuiTreeViewCtrl, sort, void, (S32 parentId, bool traverseHierarchy, bool parentsFirst, bool caseSensitive), (0, false, false, true), "Sorts all items of the given parent (or root). With 'hierarchy', traverses hierarchy." - "@param parentId TreeItemID of parent/root to sort all the items under. Use 0 to sort the entire tree." + "@param parentId TreeItemID of parent/root to sort all the items under. Use 0 to sort the entire tree." "@param traverseHierarchy True to traverse the hierarchy, false to not." "@param parentsFirst True to sort the parents first." "@param caseSensitive True to pay attention to case, false to ignore it.") @@ -5531,7 +5531,7 @@ DefineEngineMethod( GuiTreeViewCtrl, isItemSelected, bool, ( S32 id ),, "@return True if the given item/object is currently selected in the tree." ) { const Vector< GuiTreeViewCtrl::Item* >& selectedItems = object->getSelectedItems(); - for( S32 i = 0; i < selectedItems.size(); ++ i ) + for( S32 i = 0; i < selectedItems.size(); ++ i ) if( selectedItems[ i ]->mId == id ) return true; diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index a3f2344f2..b671e9626 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -52,42 +52,42 @@ IMPLEMENT_CONOBJECT(GuiCanvas); ConsoleDocClass( GuiCanvas, - "@brief A canvas on which rendering occurs.\n\n" + "@brief A canvas on which rendering occurs.\n\n" - "@section GuiCanvas_contents What a GUICanvas Can Contain...\n\n" + "@section GuiCanvas_contents What a GUICanvas Can Contain...\n\n" - "@subsection GuiCanvas_content_contentcontrol Content Control\n" - "A content control is the top level GuiControl for a screen. This GuiControl " - "will be the parent control for all other GuiControls on that particular " - "screen.\n\n" + "@subsection GuiCanvas_content_contentcontrol Content Control\n" + "A content control is the top level GuiControl for a screen. This GuiControl " + "will be the parent control for all other GuiControls on that particular " + "screen.\n\n" - "@subsection GuiCanvas_content_dialogs Dialogs\n\n" + "@subsection GuiCanvas_content_dialogs Dialogs\n\n" - "A dialog is essentially another screen, only it gets overlaid on top of the " - "current content control, and all input goes to the dialog. This is most akin " - "to the \"Open File\" dialog box found in most operating systems. When you " - "choose to open a file, and the \"Open File\" dialog pops up, you can no longer " - "send input to the application, and must complete or cancel the open file " - "request. Torque keeps track of layers of dialogs. The dialog with the highest " - "layer is on top and will get all the input, unless the dialog is " - "modeless, which is a profile option.\n\n" + "A dialog is essentially another screen, only it gets overlaid on top of the " + "current content control, and all input goes to the dialog. This is most akin " + "to the \"Open File\" dialog box found in most operating systems. When you " + "choose to open a file, and the \"Open File\" dialog pops up, you can no longer " + "send input to the application, and must complete or cancel the open file " + "request. Torque keeps track of layers of dialogs. The dialog with the highest " + "layer is on top and will get all the input, unless the dialog is " + "modeless, which is a profile option.\n\n" - "@see GuiControlProfile\n\n" + "@see GuiControlProfile\n\n" - "@section GuiCanvas_dirty Dirty Rectangles\n\n" + "@section GuiCanvas_dirty Dirty Rectangles\n\n" - "The GuiCanvas is based on dirty regions. " - "Every frame the canvas paints only the areas of the canvas that are 'dirty' " - "or need updating. In most cases, this only is the area under the mouse cursor. " - "This is why if you look in guiCanvas.cc the call to glClear is commented out. " - - "What you will see is a black screen, except in the dirty regions, where the " - "screen will be painted normally. If you are making an animated GuiControl " - "you need to add your control to the dirty areas of the canvas.\n\n" + "The GuiCanvas is based on dirty regions. " + "Every frame the canvas paints only the areas of the canvas that are 'dirty' " + "or need updating. In most cases, this only is the area under the mouse cursor. " + "This is why if you look in guiCanvas.cc the call to glClear is commented out. " + + "What you will see is a black screen, except in the dirty regions, where the " + "screen will be painted normally. If you are making an animated GuiControl " + "you need to add your control to the dirty areas of the canvas.\n\n" - "@see GuiControl\n\n" + "@see GuiControl\n\n" - "@ingroup GuiCore\n"); + "@ingroup GuiCore\n"); ColorI gCanvasClearColor( 255, 0, 255 ); ///< For GFX->clear @@ -209,29 +209,29 @@ bool GuiCanvas::onAdd() //If we're recording, store the intial video resolution if (Journal::IsRecording()) { - Journal::Write(vm.resolution.x); - Journal::Write(vm.resolution.y); - Journal::Write(vm.fullScreen); + Journal::Write(vm.resolution.x); + Journal::Write(vm.resolution.y); + Journal::Write(vm.fullScreen); } //If we're playing, read the intial video resolution from the journal if (Journal::IsPlaying()) { - Journal::Read(&vm.resolution.x); - Journal::Read(&vm.resolution.y); - Journal::Read(&vm.fullScreen); + Journal::Read(&vm.resolution.x); + Journal::Read(&vm.resolution.y); + Journal::Read(&vm.fullScreen); } if (a && a->mType != NullDevice) { mPlatformWindow = WindowManager->createWindow(newDevice, vm); - //Disable window resizing if recording ir playing a journal - if (Journal::IsRecording() || Journal::IsPlaying()) - mPlatformWindow->lockSize(true); - - // Set a minimum on the window size so people can't break us by resizing tiny. - mPlatformWindow->setMinimumWindowSize(Point2I(640,480)); + //Disable window resizing if recording ir playing a journal + if (Journal::IsRecording() || Journal::IsPlaying()) + mPlatformWindow->lockSize(true); + + // Set a minimum on the window size so people can't break us by resizing tiny. + mPlatformWindow->setMinimumWindowSize(Point2I(640,480)); // Now, we have to hook in our event callbacks so we'll get // appropriate events from the window. @@ -326,12 +326,12 @@ CanvasSizeChangeSignal GuiCanvas::smCanvasSizeChangeSignal; void GuiCanvas::handleResize( WindowId did, S32 width, S32 height ) { getCanvasSizeChangeSignal().trigger(this); - if (Journal::IsPlaying() && mPlatformWindow) - { - mPlatformWindow->lockSize(false); - mPlatformWindow->setSize(Point2I(width, height)); - mPlatformWindow->lockSize(true); - } + if (Journal::IsPlaying() && mPlatformWindow) + { + mPlatformWindow->lockSize(false); + mPlatformWindow->setSize(Point2I(width, height)); + mPlatformWindow->lockSize(true); + } // Notify the scripts if ( isMethod( "onResize" ) ) @@ -342,9 +342,9 @@ void GuiCanvas::handlePaintEvent(WindowId did) { bool canRender = mPlatformWindow->isVisible() && GFX->allowRender() && !GFX->canCurrentlyRender(); - // Do the screenshot first. + // Do the screenshot first. if ( gScreenShot != NULL && gScreenShot->isPending() && canRender ) - gScreenShot->capture( this ); + gScreenShot->capture( this ); // If the video capture is waiting for a canvas, start the capture if ( VIDCAP->isWaitingForCanvas() && canRender ) @@ -560,19 +560,19 @@ bool GuiCanvas::tabNext(void) //save the old GuiControl *oldResponder = mFirstResponder; - GuiControl* newResponder = ctrl->findNextTabable(mFirstResponder); + GuiControl* newResponder = ctrl->findNextTabable(mFirstResponder); if ( !newResponder ) newResponder = ctrl->findFirstTabable(); - if ( newResponder && newResponder != oldResponder ) - { - newResponder->setFirstResponder(); + if ( newResponder && newResponder != oldResponder ) + { + newResponder->setFirstResponder(); // CodeReview Can this get killed? Note tabPrev code. BJG - 3/25/07 -// if ( oldResponder ) -// oldResponder->onLoseFirstResponder(); +// if ( oldResponder ) +// oldResponder->onLoseFirstResponder(); return true; - } + } } return false; } @@ -585,30 +585,30 @@ bool GuiCanvas::tabPrev(void) //save the old GuiControl *oldResponder = mFirstResponder; - GuiControl* newResponder = ctrl->findPrevTabable(mFirstResponder); - if ( !newResponder ) + GuiControl* newResponder = ctrl->findPrevTabable(mFirstResponder); + if ( !newResponder ) newResponder = ctrl->findLastTabable(); - if ( newResponder && newResponder != oldResponder ) - { - newResponder->setFirstResponder(); - + if ( newResponder && newResponder != oldResponder ) + { + newResponder->setFirstResponder(); + // CodeReview As with tabNext() above, looks like this can now go. DAW - 7/05/09 - //if ( oldResponder ) - // oldResponder->onLoseFirstResponder(); + //if ( oldResponder ) + // oldResponder->onLoseFirstResponder(); return true; - } + } } return false; } bool GuiCanvas::processInputEvent(InputEventInfo &inputEvent) { - // First call the general input handler (on the extremely off-chance that it will be handled): - if (mFirstResponder && mFirstResponder->onInputEvent(inputEvent)) + // First call the general input handler (on the extremely off-chance that it will be handled): + if (mFirstResponder && mFirstResponder->onInputEvent(inputEvent)) { - return(true); + return(true); } switch (inputEvent.deviceType) @@ -1786,9 +1786,9 @@ void GuiCanvas::renderFrame(bool preRenderOnly, bool bufferSwap /* = true */) addUpdateRegion(pos - Point2I(2, 2), Point2I(cext.x + 4, cext.y + 4)); } - mLastCursorEnabled = cursorVisible; - mLastCursor = mouseCursor; - mLastCursorPt = cursorPos; + mLastCursorEnabled = cursorVisible; + mLastCursor = mouseCursor; + mLastCursorPt = cursorPos; // Begin GFX PROFILE_START(GFXBeginScene); @@ -1830,7 +1830,7 @@ void GuiCanvas::renderFrame(bool preRenderOnly, bool bufferSwap /* = true */) resetUpdateRegions(); - // Make sure we have a clean matrix state + // Make sure we have a clean matrix state // before we start rendering anything! GFX->setWorldMatrix( MatrixF::Identity ); GFX->setViewMatrix( MatrixF::Identity ); @@ -2039,46 +2039,46 @@ void GuiCanvas::resetUpdateRegions() void GuiCanvas::setFirstResponder( GuiControl* newResponder ) { - GuiControl* oldResponder = mFirstResponder; - Parent::setFirstResponder( newResponder ); + GuiControl* oldResponder = mFirstResponder; + Parent::setFirstResponder( newResponder ); if( oldResponder == mFirstResponder ) return; - if( oldResponder && ( oldResponder != newResponder ) ) - oldResponder->onLoseFirstResponder(); + if( oldResponder && ( oldResponder != newResponder ) ) + oldResponder->onLoseFirstResponder(); if( newResponder && ( newResponder != oldResponder ) ) newResponder->onGainFirstResponder(); } DefineEngineMethod( GuiCanvas, getContent, S32, (),, - "@brief Get the GuiControl which is being used as the content.\n\n" + "@brief Get the GuiControl which is being used as the content.\n\n" - "@tsexample\n" - "Canvas.getContent();\n" - "@endtsexample\n\n" + "@tsexample\n" + "Canvas.getContent();\n" + "@endtsexample\n\n" - "@return ID of current content control") + "@return ID of current content control") { - GuiControl *ctrl = object->getContentControl(); + GuiControl *ctrl = object->getContentControl(); if(ctrl) return ctrl->getId(); return -1; } DefineEngineMethod( GuiCanvas, setContent, void, (GuiControl* ctrl),, - "@brief Set the content of the canvas to a specified control.\n\n" + "@brief Set the content of the canvas to a specified control.\n\n" - "@param ctrl ID or name of GuiControl to set content to\n\n" + "@param ctrl ID or name of GuiControl to set content to\n\n" - "@tsexample\n" - "Canvas.setContent(PlayGui);\n" - "@endtsexample\n\n") + "@tsexample\n" + "Canvas.setContent(PlayGui);\n" + "@endtsexample\n\n") { - // Not using old error reporting until we modify the engineAPI - mperry + // Not using old error reporting until we modify the engineAPI - mperry - //GuiControl *gui = NULL; + //GuiControl *gui = NULL; // if(argv[2][0]) // { // if (!Sim::findObject(argv[2], gui)) @@ -2088,11 +2088,11 @@ DefineEngineMethod( GuiCanvas, setContent, void, (GuiControl* ctrl),, // } // } - if(!ctrl) - { - Con::errorf("GuiCanvas::setContent - Invalid control specified')"); - return; - } + if(!ctrl) + { + Con::errorf("GuiCanvas::setContent - Invalid control specified')"); + return; + } //set the new content control object->setContentControl(ctrl); @@ -2111,11 +2111,11 @@ ConsoleDocFragment _pushDialog( ); DefineConsoleMethod( GuiCanvas, pushDialog, void, (const char * ctrlName, S32 layer, bool center), ( 0, false), "(GuiControl ctrl, int layer=0, bool center=false)" - "@hide") + "@hide") { GuiControl *gui; - if (! Sim::findObject(ctrlName, gui)) + if (! Sim::findObject(ctrlName, gui)) { Con::printf("pushDialog(): Invalid control: %s", ctrlName); return; @@ -2148,7 +2148,7 @@ ConsoleDocFragment _popDialog2( ); DefineConsoleMethod( GuiCanvas, popDialog, void, (GuiControl * gui), (NULL), "(GuiControl ctrl=NULL)" - "@hide") + "@hide") { if (gui) object->popDialogControl(gui); @@ -2157,160 +2157,160 @@ DefineConsoleMethod( GuiCanvas, popDialog, void, (GuiControl * gui), (NULL), "(G } ConsoleDocFragment _popLayer1( - "@brief Removes the top most layer of dialogs\n\n" - "@tsexample\n" - "Canvas.popLayer();\n" - "@endtsexample\n\n", - "GuiCanvas", - "void popLayer();" + "@brief Removes the top most layer of dialogs\n\n" + "@tsexample\n" + "Canvas.popLayer();\n" + "@endtsexample\n\n", + "GuiCanvas", + "void popLayer();" ); ConsoleDocFragment _popLayer2( - "@brief Removes a specified layer of dialogs\n\n" - "@param layer Number of the layer to pop\n\n" - "@tsexample\n" - "Canvas.popLayer(1);\n" - "@endtsexample\n\n", - "GuiCanvas", - "void popLayer(S32 layer);" + "@brief Removes a specified layer of dialogs\n\n" + "@param layer Number of the layer to pop\n\n" + "@tsexample\n" + "Canvas.popLayer(1);\n" + "@endtsexample\n\n", + "GuiCanvas", + "void popLayer(S32 layer);" ); DefineConsoleMethod( GuiCanvas, popLayer, void, (S32 layer), (0), "(int layer)" - "@hide") + "@hide") { object->popDialogControl(layer); } DefineEngineMethod( GuiCanvas, cursorOn, void, (),, - "@brief Turns on the mouse cursor.\n\n" - "@tsexample\n" - "Canvas.cursorOn();\n" - "@endtsexample\n\n") + "@brief Turns on the mouse cursor.\n\n" + "@tsexample\n" + "Canvas.cursorOn();\n" + "@endtsexample\n\n") { - object->setCursorON(true); + object->setCursorON(true); } DefineEngineMethod( GuiCanvas, cursorOff, void, (),, - "@brief Turns on the mouse off.\n\n" - "@tsexample\n" - "Canvas.cursorOff();\n" - "@endtsexample\n\n") + "@brief Turns on the mouse off.\n\n" + "@tsexample\n" + "Canvas.cursorOff();\n" + "@endtsexample\n\n") { - object->setCursorON(false); + object->setCursorON(false); } DefineEngineMethod( GuiCanvas, setCursor, void, (GuiCursor* cursor),, - "@brief Sets the cursor for the canvas.\n\n" + "@brief Sets the cursor for the canvas.\n\n" - "@param cursor Name of the GuiCursor to use\n\n" + "@param cursor Name of the GuiCursor to use\n\n" - "@tsexample\n" - "Canvas.setCursor(\"DefaultCursor\");\n" - "@endtsexample\n\n") + "@tsexample\n" + "Canvas.setCursor(\"DefaultCursor\");\n" + "@endtsexample\n\n") { - if(!cursor) - { - Con::errorf("GuiCanvas::setCursor - Invalid GuiCursor name or ID"); - return; - } - object->setCursor(cursor); + if(!cursor) + { + Con::errorf("GuiCanvas::setCursor - Invalid GuiCursor name or ID"); + return; + } + object->setCursor(cursor); } DefineEngineMethod( GuiCanvas, renderFront, void, ( bool enable ),, - "@brief This turns on/off front-buffer rendering.\n\n" + "@brief This turns on/off front-buffer rendering.\n\n" - "@param enable True if all rendering should be done to the front buffer\n\n" + "@param enable True if all rendering should be done to the front buffer\n\n" - "@tsexample\n" - "Canvas.renderFront(false);\n" - "@endtsexample\n\n") + "@tsexample\n" + "Canvas.renderFront(false);\n" + "@endtsexample\n\n") { - object->setRenderFront(enable); + object->setRenderFront(enable); } DefineEngineMethod( GuiCanvas, showCursor, void, (),, - "@brief Enable rendering of the cursor.\n\n" + "@brief Enable rendering of the cursor.\n\n" - "@tsexample\n" - "Canvas.showCursor();\n" - "@endtsexample\n\n") + "@tsexample\n" + "Canvas.showCursor();\n" + "@endtsexample\n\n") { - object->showCursor(true); + object->showCursor(true); } DefineEngineMethod( GuiCanvas, hideCursor, void, (),, - "@brief Disable rendering of the cursor.\n\n" + "@brief Disable rendering of the cursor.\n\n" - "@tsexample\n" - "Canvas.hideCursor();\n" - "@endtsexample\n\n") + "@tsexample\n" + "Canvas.hideCursor();\n" + "@endtsexample\n\n") { - object->showCursor(false); + object->showCursor(false); } DefineEngineMethod( GuiCanvas, isCursorOn, bool, (),, - "@brief Determines if mouse cursor is enabled.\n\n" + "@brief Determines if mouse cursor is enabled.\n\n" - "@tsexample\n" - "// Is cursor on?\n" - "if(Canvas.isCursorOn())\n" - " echo(\"Canvas cursor is on\");\n" - "@endtsexample\n\n" - "@return Returns true if the cursor is on.\n\n") + "@tsexample\n" + "// Is cursor on?\n" + "if(Canvas.isCursorOn())\n" + " echo(\"Canvas cursor is on\");\n" + "@endtsexample\n\n" + "@return Returns true if the cursor is on.\n\n") { - return object->isCursorON(); + return object->isCursorON(); } DefineEngineMethod( GuiCanvas, isCursorShown, bool, (),, - "@brief Determines if mouse cursor is rendering.\n\n" + "@brief Determines if mouse cursor is rendering.\n\n" - "@tsexample\n" - "// Is cursor rendering?\n" - "if(Canvas.isCursorShown())\n" - " echo(\"Canvas cursor is rendering\");\n" - "@endtsexample\n\n" - "@return Returns true if the cursor is rendering.\n\n") + "@tsexample\n" + "// Is cursor rendering?\n" + "if(Canvas.isCursorShown())\n" + " echo(\"Canvas cursor is rendering\");\n" + "@endtsexample\n\n" + "@return Returns true if the cursor is rendering.\n\n") { - return object->isCursorShown(); + return object->isCursorShown(); } DefineEngineMethod( GuiCanvas, repaint, void, ( S32 elapsedMS ), (0), - "@brief Force canvas to redraw.\n" + "@brief Force canvas to redraw.\n" "If the elapsed time is greater than the time since the last paint " "then the repaint will be skipped.\n" "@param elapsedMS The optional elapsed time in milliseconds.\n\n" - "@tsexample\n" - "Canvas.repaint();\n" - "@endtsexample\n\n") + "@tsexample\n" + "Canvas.repaint();\n" + "@endtsexample\n\n") { - object->repaint(elapsedMS < 0 ? 0 : elapsedMS); + object->repaint(elapsedMS < 0 ? 0 : elapsedMS); } DefineEngineMethod( GuiCanvas, reset, void, (),, - "@brief Reset the update regions for the canvas.\n\n" + "@brief Reset the update regions for the canvas.\n\n" - "@tsexample\n" - "Canvas.reset();\n" - "@endtsexample\n\n") + "@tsexample\n" + "Canvas.reset();\n" + "@endtsexample\n\n") { - object->resetUpdateRegions(); + object->resetUpdateRegions(); } DefineEngineMethod( GuiCanvas, getCursorPos, Point2I, (),, - "@brief Get the current position of the cursor in screen-space. Note that this position" + "@brief Get the current position of the cursor in screen-space. Note that this position" " might be outside the Torque window. If you want to get the position within the Canvas," " call screenToClient on the result.\n\n" "@see Canvas::screenToClient()\n\n" - "@param param Description\n\n" - "@tsexample\n" - "%cursorPos = Canvas.getCursorPos();\n" - "@endtsexample\n\n" - "@return Screen coordinates of mouse cursor, in format \"X Y\"") + "@param param Description\n\n" + "@tsexample\n" + "%cursorPos = Canvas.getCursorPos();\n" + "@endtsexample\n\n" + "@return Screen coordinates of mouse cursor, in format \"X Y\"") { - return object->getCursorPos(); + return object->getCursorPos(); } ConsoleDocFragment _setCursorPos1( @@ -2334,21 +2334,21 @@ ConsoleDocFragment _setCursorPos2( ); DefineConsoleMethod( GuiCanvas, setCursorPos, void, (Point2I pos), , "(Point2I pos)" - "@hide") + "@hide") { object->setCursorPos(pos); } DefineEngineMethod( GuiCanvas, getMouseControl, S32, (),, - "@brief Gets the gui control under the mouse.\n\n" - "@tsexample\n" - "%underMouse = Canvas.getMouseControl();\n" - "@endtsexample\n\n" + "@brief Gets the gui control under the mouse.\n\n" + "@tsexample\n" + "%underMouse = Canvas.getMouseControl();\n" + "@endtsexample\n\n" - "@return ID of the gui control, if one was found. NULL otherwise") + "@return ID of the gui control, if one was found. NULL otherwise") { - GuiControl* control = object->getMouseControl(); + GuiControl* control = object->getMouseControl(); if (control) return control->getId(); @@ -2356,18 +2356,18 @@ DefineEngineMethod( GuiCanvas, getMouseControl, S32, (),, } DefineEngineFunction(excludeOtherInstance, bool, (const char* appIdentifer),, - "@brief Used to exclude/prevent all other instances using the same identifier specified\n\n" + "@brief Used to exclude/prevent all other instances using the same identifier specified\n\n" - "@note Not used on OSX, Xbox, or in Win debug builds\n\n" + "@note Not used on OSX, Xbox, or in Win debug builds\n\n" - "@param appIdentifier Name of the app set up for exclusive use.\n" + "@param appIdentifier Name of the app set up for exclusive use.\n" - "@return False if another app is running that specified the same appIdentifier\n\n" + "@return False if another app is running that specified the same appIdentifier\n\n" - "@ingroup Platform\n" - "@ingroup GuiCore") + "@ingroup Platform\n" + "@ingroup GuiCore") { - // mac/360 can only run one instance in general. + // mac/360 can only run one instance in general. #if !defined(TORQUE_OS_MAC) && !defined(TORQUE_OS_XENON) && !defined(TORQUE_DEBUG) && !defined(TORQUE_OS_LINUX) return Platform::excludeOtherInstances(appIdentifer); #else @@ -2377,82 +2377,82 @@ DefineEngineFunction(excludeOtherInstance, bool, (const char* appIdentifer),, } DefineEngineMethod( GuiCanvas, getExtent, Point2I, (),, - "@brief Returns the dimensions of the canvas\n\n" + "@brief Returns the dimensions of the canvas\n\n" - "@tsexample\n" - "%extent = Canvas.getExtent();\n" - "@endtsexample\n\n" + "@tsexample\n" + "%extent = Canvas.getExtent();\n" + "@endtsexample\n\n" - "@return Width and height of canvas. Formatted as numerical values in a single string \"# #\"") + "@return Width and height of canvas. Formatted as numerical values in a single string \"# #\"") { - return object->getExtent(); + return object->getExtent(); } DefineEngineMethod( GuiCanvas, setWindowTitle, void, ( const char* newTitle),, - "@brief Change the title of the OS window.\n\n" + "@brief Change the title of the OS window.\n\n" - "@param newTitle String containing the new name\n\n" + "@param newTitle String containing the new name\n\n" - "@tsexample\n" - "Canvas.setWindowTitle(\"Documentation Rocks!\");\n" - "@endtsexample\n\n") + "@tsexample\n" + "Canvas.setWindowTitle(\"Documentation Rocks!\");\n" + "@endtsexample\n\n") { - object->setWindowTitle(newTitle); + object->setWindowTitle(newTitle); } DefineEngineMethod( GuiCanvas, findFirstMatchingMonitor, S32, (const char* name),, - "@brief Find the first monitor index that matches the given name.\n\n" + "@brief Find the first monitor index that matches the given name.\n\n" "The actual match algorithm depends on the implementation.\n" "@param name The name to search for.\n\n" - "@return The number of monitors attached to the system, including the default monoitor.") + "@return The number of monitors attached to the system, including the default monoitor.") { return PlatformWindowManager::get()->findFirstMatchingMonitor(name); } DefineEngineMethod( GuiCanvas, getMonitorCount, S32, (),, - "@brief Gets the number of monitors attached to the system.\n\n" + "@brief Gets the number of monitors attached to the system.\n\n" - "@return The number of monitors attached to the system, including the default monoitor.") + "@return The number of monitors attached to the system, including the default monoitor.") { return PlatformWindowManager::get()->getMonitorCount(); } DefineEngineMethod( GuiCanvas, getMonitorName, const char*, (S32 index),, - "@brief Gets the name of the requested monitor.\n\n" + "@brief Gets the name of the requested monitor.\n\n" "@param index The monitor index.\n\n" - "@return The name of the requested monitor.") + "@return The name of the requested monitor.") { return PlatformWindowManager::get()->getMonitorName(index); } DefineEngineMethod( GuiCanvas, getMonitorRect, RectI, (S32 index),, - "@brief Gets the region of the requested monitor.\n\n" + "@brief Gets the region of the requested monitor.\n\n" "@param index The monitor index.\n\n" - "@return The rectangular region of the requested monitor.") + "@return The rectangular region of the requested monitor.") { return PlatformWindowManager::get()->getMonitorRect(index); } DefineEngineMethod( GuiCanvas, getVideoMode, const char*, (),, - "@brief Gets the current screen mode as a string.\n\n" + "@brief Gets the current screen mode as a string.\n\n" - "The return string will contain 5 values (width, height, fullscreen, bitdepth, refreshRate). " - "You will need to parse out each one for individual use.\n\n" + "The return string will contain 5 values (width, height, fullscreen, bitdepth, refreshRate). " + "You will need to parse out each one for individual use.\n\n" - "@tsexample\n" - "%screenWidth = getWord(Canvas.getVideoMode(), 0);\n" - "%screenHeight = getWord(Canvas.getVideoMode(), 1);\n" - "%isFullscreen = getWord(Canvas.getVideoMode(), 2);\n" - "%bitdepth = getWord(Canvas.getVideoMode(), 3);\n" - "%refreshRate = getWord(Canvas.getVideoMode(), 4);\n" - "@endtsexample\n\n" + "@tsexample\n" + "%screenWidth = getWord(Canvas.getVideoMode(), 0);\n" + "%screenHeight = getWord(Canvas.getVideoMode(), 1);\n" + "%isFullscreen = getWord(Canvas.getVideoMode(), 2);\n" + "%bitdepth = getWord(Canvas.getVideoMode(), 3);\n" + "%refreshRate = getWord(Canvas.getVideoMode(), 4);\n" + "@endtsexample\n\n" - "@return String formatted with screen width, screen height, screen mode, bit depth, and refresh rate.") + "@return String formatted with screen width, screen height, screen mode, bit depth, and refresh rate.") { - // Grab the video mode. + // Grab the video mode. if (!object->getPlatformWindow()) return ""; @@ -2463,17 +2463,17 @@ DefineEngineMethod( GuiCanvas, getVideoMode, const char*, (),, DefineEngineMethod( GuiCanvas, getModeCount, S32, (),, - "@brief Gets the number of modes available on this device.\n\n" + "@brief Gets the number of modes available on this device.\n\n" - "@param param Description\n\n" + "@param param Description\n\n" - "@tsexample\n" - "%modeCount = Canvas.getModeCount()\n" - "@endtsexample\n\n" + "@tsexample\n" + "%modeCount = Canvas.getModeCount()\n" + "@endtsexample\n\n" - "@return The number of video modes supported by the device") + "@return The number of video modes supported by the device") { - if (!object->getPlatformWindow()) + if (!object->getPlatformWindow()) return 0; // Grab the available mode list from the device. @@ -2485,12 +2485,12 @@ DefineEngineMethod( GuiCanvas, getModeCount, S32, (),, } DefineEngineMethod( GuiCanvas, getMode, const char*, (S32 modeId),, - "@brief Gets information on the specified mode of this device.\n\n" - "@param modeId Index of the mode to get data from.\n" - "@return A video mode string given an adapter and mode index.\n\n" - "@see GuiCanvas::getVideoMode()") + "@brief Gets information on the specified mode of this device.\n\n" + "@param modeId Index of the mode to get data from.\n" + "@return A video mode string given an adapter and mode index.\n\n" + "@see GuiCanvas::getVideoMode()") { - if (!object->getPlatformWindow()) + if (!object->getPlatformWindow()) return 0; // Grab the available mode list from the device. @@ -2515,14 +2515,14 @@ DefineEngineMethod( GuiCanvas, getMode, const char*, (S32 modeId),, DefineEngineMethod( GuiCanvas, toggleFullscreen, void, (),, - "@brief toggle canvas from fullscreen to windowed mode or back.\n\n" + "@brief toggle canvas from fullscreen to windowed mode or back.\n\n" - "@tsexample\n" - "// If we are in windowed mode, the following will put is in fullscreen\n" - "Canvas.toggleFullscreen();" - "@endtsexample\n\n") + "@tsexample\n" + "// If we are in windowed mode, the following will put is in fullscreen\n" + "Canvas.toggleFullscreen();" + "@endtsexample\n\n") { - if (Platform::getWebDeployment()) + if (Platform::getWebDeployment()) return; if (!object->getPlatformWindow()) @@ -2693,7 +2693,7 @@ DefineConsoleMethod( GuiCanvas, setVideoMode, void, "\\param fullscreen Specify true to run fullscreen or false to run in a window\n" "\\param bitDepth [optional] The desired bit-depth. Defaults to the current setting. This parameter is ignored if you are running in a window.\n" "\\param refreshRate [optional] The desired refresh rate. Defaults to the current setting. This parameter is ignored if you are running in a window" - "\\param antialiasLevel [optional] The level of anti-aliasing to apply 0 = none" ) + "\\param antialiasLevel [optional] The level of anti-aliasing to apply 0 = none" ) { if (!object->getPlatformWindow()) return; diff --git a/Engine/source/gui/editor/guiEditCtrl.cpp b/Engine/source/gui/editor/guiEditCtrl.cpp index f972ec8ca..f71dd8ef0 100644 --- a/Engine/source/gui/editor/guiEditCtrl.cpp +++ b/Engine/source/gui/editor/guiEditCtrl.cpp @@ -716,16 +716,16 @@ void GuiEditCtrl::onRender(Point2I offset, const RectI &updateRect) ctOffset = getCurrentAddSet()->localToGlobalCoord(Point2I(0,0)); RectI box(ctOffset.x, ctOffset.y, cext.x, cext.y); - box.inset( -5, -5 ); + box.inset( -5, -5 ); drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) ); - box.inset( 1, 1 ); + box.inset( 1, 1 ); drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) ); - box.inset( 1, 1 ); + box.inset( 1, 1 ); drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) ); - box.inset( 1, 1 ); + box.inset( 1, 1 ); + drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) ); + box.inset( 1, 1 ); drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) ); - box.inset( 1, 1 ); - drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) ); } Vector::iterator i; bool multisel = mSelectedControls.size() > 1; @@ -2481,16 +2481,16 @@ DefineConsoleMethod( GuiEditCtrl, getContentControl, S32, (), , "() - Return the DefineConsoleMethod( GuiEditCtrl, setContentControl, void, (GuiControl *ctrl ), , "( GuiControl ctrl ) - Set the toplevel control to edit in the GUI editor." ) { - if (ctrl) - object->setContentControl(ctrl); + if (ctrl) + object->setContentControl(ctrl); } //----------------------------------------------------------------------------- DefineConsoleMethod( GuiEditCtrl, addNewCtrl, void, (GuiControl *ctrl), , "(GuiControl ctrl)") { - if (ctrl) - object->addNewControl(ctrl); + if (ctrl) + object->addNewControl(ctrl); } //----------------------------------------------------------------------------- @@ -2518,7 +2518,7 @@ DefineConsoleMethod( GuiEditCtrl, clearSelection, void, (), , "Clear selected co DefineConsoleMethod( GuiEditCtrl, select, void, (GuiControl *ctrl), , "(GuiControl ctrl)") { - if (ctrl) + if (ctrl) object->setSelection(ctrl, false); } @@ -2526,7 +2526,7 @@ DefineConsoleMethod( GuiEditCtrl, select, void, (GuiControl *ctrl), , "(GuiContr DefineConsoleMethod( GuiEditCtrl, setCurrentAddSet, void, (GuiControl *addSet), , "(GuiControl ctrl)") { - if (addSet) + if (addSet) object->setCurrentAddSet(addSet); } diff --git a/Engine/source/gui/editor/guiMenuBar.cpp b/Engine/source/gui/editor/guiMenuBar.cpp index 4a9a4cefa..1a8db3f96 100644 --- a/Engine/source/gui/editor/guiMenuBar.cpp +++ b/Engine/source/gui/editor/guiMenuBar.cpp @@ -81,8 +81,8 @@ ConsoleDocClass( GuiMenuBar, "@tsexample\n" "new GuiMenuBar(newMenuBar)\n" "{\n" - " Padding = \"0\";\n" - " //Properties not specific to this control have been omitted from this example.\n" + " Padding = \"0\";\n" + " //Properties not specific to this control have been omitted from this example.\n" "};\n\n" "// Add a menu to the menu bar\n" "newMenuBar.addMenu(0,\"New Menu\");\n\n" @@ -105,7 +105,7 @@ IMPLEMENT_CALLBACK( GuiMenuBar, onMouseInMenu, void, (bool isInMenu),( isInMenu "// Mouse enters or persists within the menu, causing the callback to occur.\n" "GuiMenuBar::onMouseInMenu(%this,%hasLeftMenu)\n" "{\n" - " // Code to run when the callback occurs\n" + " // Code to run when the callback occurs\n" "}\n" "@endtsexample\n\n" "@see GuiTickCtrl\n\n" @@ -119,14 +119,14 @@ IMPLEMENT_CALLBACK( GuiMenuBar, onMenuSelect, void, ( S32 menuId, const char* me "// A menu has been selected, causing the callback to occur.\n" "GuiMenuBar::onMenuSelect(%this,%menuId,%menuText)\n" "{\n" - " // Code to run when the callback occurs\n" + " // Code to run when the callback occurs\n" "}\n" "@endtsexample\n\n" "@see GuiTickCtrl\n\n" ); IMPLEMENT_CALLBACK( GuiMenuBar, onMenuItemSelect, void, ( S32 menuId, const char* menuText, S32 menuItemId, const char* menuItemText ), - ( menuId, menuText, menuItemId, menuItemText ), + ( menuId, menuText, menuItemId, menuItemText ), "@brief Called whenever an item in a menu is selected.\n\n" "@param menuId Index id of the menu which contains the selected menu item\n" "@param menuText Text of the menu which contains the selected menu item\n\n" @@ -136,7 +136,7 @@ IMPLEMENT_CALLBACK( GuiMenuBar, onMenuItemSelect, void, ( S32 menuId, const char "// A menu item has been selected, causing the callback to occur.\n" "GuiMenuBar::onMenuItemSelect(%this,%menuId,%menuText,%menuItemId,%menuItemText)\n" "{\n" - " // Code to run when the callback occurs\n" + " // Code to run when the callback occurs\n" "}\n" "@endtsexample\n\n" "@see GuiTickCtrl\n\n" @@ -149,7 +149,7 @@ IMPLEMENT_CALLBACK( GuiMenuBar, onSubmenuSelect, void, ( S32 submenuId, const ch "@tsexample\n" "GuiMenuBar::onSubmenuSelect(%this,%submenuId,%submenuText)\n" "{\n" - " // Code to run when the callback occurs\n" + " // Code to run when the callback occurs\n" "}\n" "@endtsexample\n\n" "@see GuiTickCtrl\n\n" @@ -216,7 +216,7 @@ DefineEngineMethod(GuiMenuBar, addMenu, void, (const char* menuText, S32 menuId) } DefineEngineMethod(GuiMenuBar, addMenuItem, void, (const char* targetMenu, const char* menuItemText, S32 menuItemId, const char* accelerator, int checkGroup, const char *cmd), - ("","",0,NULL,-1,""), + ("","",0,NULL,-1,""), "@brief Adds a menu item to the specified menu. The menu argument can be either the text of a menu or its id.\n\n" "@param menu Menu name or menu Id to add the new item to.\n" "@param menuItemText Text for the new menu item.\n" @@ -637,7 +637,7 @@ DefineEngineMethod(GuiMenuBar, setMenuItemSubmenuState, void, (const char* menuT } DefineEngineMethod(GuiMenuBar, addSubmenuItem, void, (const char* menuTarget, const char* menuItem, const char* submenuItemText, - int submenuItemId, const char* accelerator, int checkGroup),, + int submenuItemId, const char* accelerator, int checkGroup),, "@brief Adds a menu item to the specified menu. The menu argument can be either the text of a menu or its id.\n\n" "@param menuTarget Menu to affect a submenu in\n" "@param menuItem Menu item to affect\n" @@ -814,21 +814,21 @@ void GuiMenuBar::addMenu(const char *menuText, U32 menuId) GuiMenuBar::Menu *GuiMenuBar::findMenu(const char *menu) { - if(dIsdigit(menu[0])) - { - U32 id = dAtoi(menu); + if(dIsdigit(menu[0])) + { + U32 id = dAtoi(menu); for (U32 i = 0; i < mMenuList.size(); ++i) if (id == mMenuList[i]->id) return mMenuList[i]; - return NULL; - } - else - { + return NULL; + } + else + { for (U32 i = 0; i < mMenuList.size(); ++i) if (!dStricmp(menu, mMenuList[i]->text)) return mMenuList[i]; - return NULL; - } + return NULL; + } } GuiMenuBar::MenuItem *GuiMenuBar::findMenuItem(Menu *menu, const char *menuItem) @@ -981,13 +981,13 @@ GuiMenuBar::MenuItem *GuiMenuBar::findSubmenuItem(Menu *menu, const char *menuIt U32 id = dAtoi(menuItem); for(MenuItem *walk = menu->firstMenuItem; walk; walk = walk->nextMenuItem) if(id == walk->id) - { - if(walk->isSubmenu && walk->submenu) - { + { + if(walk->isSubmenu && walk->submenu) + { return GuiMenuBar::findMenuItem(walk->submenu, submenuItem); - } - return NULL; - } + } + return NULL; + } return NULL; } else @@ -995,13 +995,13 @@ GuiMenuBar::MenuItem *GuiMenuBar::findSubmenuItem(Menu *menu, const char *menuIt // Search by name for(MenuItem *walk = menu->firstMenuItem; walk; walk = walk->nextMenuItem) if(!dStricmp(menuItem, walk->text)) - { - if(walk->isSubmenu && walk->submenu) - { + { + if(walk->isSubmenu && walk->submenu) + { return GuiMenuBar::findMenuItem(walk->submenu, submenuItem); - } - return NULL; - } + } + return NULL; + } return NULL; } } @@ -1021,7 +1021,7 @@ void GuiMenuBar::addSubmenuItem(Menu *menu, MenuItem *submenu, const char *text, if(submenu && !submenu->isSubmenu) { Con::errorf("GuiMenuBar::addSubmenuItem: Attempting to add menuitem '%s' to an invalid submenu",text); - return; + return; } // allocate the new menu item @@ -1074,7 +1074,7 @@ void GuiMenuBar::removeSubmenuItem(MenuItem *menuItem, MenuItem *submenuItem) if(menuItem && !menuItem->isSubmenu) { Con::errorf("GuiMenuBar::removeSubmenuItem: Attempting to remove submenuitem '%s' from an invalid submenu",submenuItem->text); - return; + return; } GuiMenuBar::removeMenuItem(menuItem->submenu, submenuItem); @@ -1087,7 +1087,7 @@ void GuiMenuBar::clearSubmenuItems(MenuItem *menuitem) if(menuitem && !menuitem->isSubmenu) { Con::errorf("GuiMenuBar::clearSubmenuItems: Attempting to clear an invalid submenu"); - return; + return; } while(menuitem->submenu->firstMenuItem) @@ -1175,33 +1175,33 @@ void GuiMenuBar::onPreRender() if (!mMenuList[i]->visible) continue; - // Bounds depends on if there is a bitmap to be drawn or not + // Bounds depends on if there is a bitmap to be drawn or not if (mMenuList[i]->bitmapIndex == -1) - { + { // Text only mMenuList[i]->bounds.set(curX, 0, mProfile->mFont->getStrWidth(mMenuList[i]->text) + (mHorizontalMargin * 2), getHeight() - (mVerticalMargin * 2)); } else - { + { // Will the bitmap and text be draw? if (!mMenuList[i]->drawBitmapOnly) - { + { // Draw the bitmap and the text RectI *bitmapBounds = mProfile->mBitmapArrayRects.address(); mMenuList[i]->bounds.set(curX, 0, bitmapBounds[mMenuList[i]->bitmapIndex].extent.x + mProfile->mFont->getStrWidth(mMenuList[i]->text) + (mHorizontalMargin * 2), getHeight() + (mVerticalMargin * 2)); - } else - { + } else + { // Only the bitmap will be drawn RectI *bitmapBounds = mProfile->mBitmapArrayRects.address(); mMenuList[i]->bounds.set(curX, 0, bitmapBounds[mMenuList[i]->bitmapIndex].extent.x + mBitmapMargin + (mHorizontalMargin * 2), getHeight() + (mVerticalMargin * 2)); - } - } + } + } curX += mMenuList[i]->bounds.extent.x; } - mouseOverMenu = NULL; - mouseDownMenu = NULL; + mouseOverMenu = NULL; + mouseDownMenu = NULL; } } @@ -1222,35 +1222,35 @@ void GuiMenuBar::checkMenuMouseMove(const GuiEvent &event) void GuiMenuBar::onMouseMove(const GuiEvent &event) { Menu *hit = findHitMenu(event.mousePoint); - if(hit != mouseOverMenu) - { - // If we need to, reset the mouse over menu counter and indicate - // that we should track it. - if(hit) + if(hit != mouseOverMenu) + { + // If we need to, reset the mouse over menu counter and indicate + // that we should track it. + if(hit) mMouseOverCounter = 0; - if(!mCountMouseOver) - { + if(!mCountMouseOver) + { // We've never started the counter, so start it. if(hit) mCountMouseOver = true; - } + } - mouseOverMenu = hit; - setUpdate(); - } + mouseOverMenu = hit; + setUpdate(); + } } void GuiMenuBar::onMouseLeave(const GuiEvent &event) { if(mouseOverMenu) - setUpdate(); - mouseOverMenu = NULL; + setUpdate(); + mouseOverMenu = NULL; // As we've left the control, don't track how long the mouse has been // within it. if(mCountMouseOver && mMouseOverCounter >= mMouseHoverAmount) { - onMouseInMenu_callback(false); // Last parameter indicates if we've entered or left the menu + onMouseInMenu_callback(false); // Last parameter indicates if we've entered or left the menu } mCountMouseOver = false; mMouseOverCounter = 0; @@ -1259,38 +1259,38 @@ void GuiMenuBar::onMouseLeave(const GuiEvent &event) void GuiMenuBar::onMouseDragged(const GuiEvent &event) { Menu *hit = findHitMenu(event.mousePoint); - - if(hit != mouseOverMenu) - { - // If we need to, reset the mouse over menu counter and indicate - // that we should track it. - if(hit) + + if(hit != mouseOverMenu) + { + // If we need to, reset the mouse over menu counter and indicate + // that we should track it. + if(hit) mMouseOverCounter = 0; - if(!mCountMouseOver) - { + if(!mCountMouseOver) + { // We've never started the counter, so start it. if(hit) mCountMouseOver = true; - } + } - mouseOverMenu = hit; + mouseOverMenu = hit; mouseDownMenu = hit; - setUpdate(); + setUpdate(); onAction(); - } + } } void GuiMenuBar::onMouseDown(const GuiEvent &event) { mouseDownMenu = mouseOverMenu = findHitMenu(event.mousePoint); - setUpdate(); + setUpdate(); onAction(); } void GuiMenuBar::onMouseUp(const GuiEvent &event) { mouseDownMenu = NULL; - setUpdate(); + setUpdate(); } void GuiMenuBar::onRender(Point2I offset, const RectI &updateRect) @@ -1320,20 +1320,20 @@ void GuiMenuBar::onRender(Point2I offset, const RectI &updateRect) start.x = mMenuList[i]->bounds.point.x + mHorizontalMargin; start.y = mMenuList[i]->bounds.point.y + (mMenuList[i]->bounds.extent.y - mProfile->mFont->getHeight()) / 2; - // Draw the border + // Draw the border if (mMenuList[i]->drawBorder) - { + { RectI highlightBounds = bounds; highlightBounds.inset(1,1); if (mMenuList[i] == mouseDownMenu) renderFilledBorder(highlightBounds, mProfile->mBorderColorHL, mProfile->mFillColorHL ); else if (mMenuList[i] == mouseOverMenu && mouseDownMenu == NULL) renderFilledBorder(highlightBounds, mProfile->mBorderColorHL, mProfile->mFillColorHL); - } + } - // Do we draw a bitmap? + // Do we draw a bitmap? if (mMenuList[i]->bitmapIndex != -1) - { + { S32 index = mMenuList[i]->bitmapIndex * 3; if (mMenuList[i] == mouseDownMenu) ++index; @@ -1342,24 +1342,24 @@ void GuiMenuBar::onRender(Point2I offset, const RectI &updateRect) RectI rect = mProfile->mBitmapArrayRects[index]; - Point2I bitmapstart(start); + Point2I bitmapstart(start); bitmapstart.y = mMenuList[i]->bounds.point.y + (mMenuList[i]->bounds.extent.y - rect.extent.y) / 2; drawUtil->clearBitmapModulation(); drawUtil->drawBitmapSR( mProfile->mTextureObject, offset + bitmapstart, rect); - // Should we also draw the text? + // Should we also draw the text? if (!mMenuList[i]->drawBitmapOnly) - { + { start.x += mBitmapMargin; drawUtil->setBitmapModulation( fontColor ); drawUtil->drawText(mProfile->mFont, start + offset, mMenuList[i]->text, mProfile->mFontColors); - } - } else - { + } + } else + { drawUtil->setBitmapModulation( fontColor ); drawUtil->drawText(mProfile->mFont, start + offset, mMenuList[i]->text, mProfile->mFontColors); - } + } } renderChildControls( offset, updateRect ); @@ -1381,7 +1381,7 @@ void GuiMenuBar::buildWindowAcceleratorMap( WindowInputGenerator &inputGenerator continue; } EventDescriptor accelEvent; - ActionMap::createEventDescriptor(item->accelerator, &accelEvent); + ActionMap::createEventDescriptor(item->accelerator, &accelEvent); //now we have a modifier, and a key, add them to the canvas inputGenerator.addAcceleratorKey( this, item->cmd, accelEvent.eventCode, accelEvent.flags); @@ -1412,7 +1412,7 @@ void GuiMenuBar::acceleratorKeyPress(U32 index) { // first, call the script callback for menu selection: onMenuSelect_callback(mMenuList[i]->id, mMenuList[i]->text); - + if(item->visible) menuItemSelected(mMenuList[i], item); return; @@ -1551,15 +1551,15 @@ void GuiMenuTextListCtrl::onMouseUp(const GuiEvent &event) void GuiMenuTextListCtrl::onCellHighlighted(Point2I cell) { - // If this text list control is part of a submenu, then don't worry about - // passing this along - if(!isSubMenu) - { - RectI globalbounds(getBounds()); - Point2I globalpoint = localToGlobalCoord(globalbounds.point); - globalbounds.point = globalpoint; - mMenuBarCtrl->highlightedMenuItem(cell.y, globalbounds, mCellSize); - } + // If this text list control is part of a submenu, then don't worry about + // passing this along + if(!isSubMenu) + { + RectI globalbounds(getBounds()); + Point2I globalpoint = localToGlobalCoord(globalbounds.point); + globalbounds.point = globalpoint; + mMenuBarCtrl->highlightedMenuItem(cell.y, globalbounds, mCellSize); + } } //------------------------------------------------------------------------------ @@ -1582,9 +1582,9 @@ bool GuiSubmenuBackgroundCtrl::pointInControl(const Point2I& parentCoordPoint) S32 yt = parentCoordPoint.y - getTop(); if(findHitControl(Point2I(xt,yt)) == this) - return false; + return false; else - return true; + return true; // return xt >= 0 && yt >= 0 && xt < getWidth() && yt < getHeight(); } @@ -1609,7 +1609,7 @@ void GuiMenuBar::onSleep() void GuiMenuBar::closeMenu() { // First close any open submenu - closeSubmenu(); + closeSubmenu(); // Get the selection from the text list: S32 selectionIndex = mTextList->getSelectedCell().y; @@ -1657,25 +1657,25 @@ void GuiMenuBar::highlightedMenuItem(S32 selectionIndex, const RectI& bounds, Po } if(list) - { + { // If the highlighted item has changed... if(mouseOverSubmenu != list) - { + { closeSubmenu(); mouseOverSubmenu = NULL; // Check if this is a submenu. If so, open the submenu. if(list->isSubmenu) - { - // If there are submenu items, then open the submenu + { + // If there are submenu items, then open the submenu if(list->submenu->firstMenuItem) - { - mouseOverSubmenu = list; - onSubmenuAction(selstore, bounds, cellSize); - } - } - } - } + { + mouseOverSubmenu = list; + onSubmenuAction(selstore, bounds, cellSize); + } + } + } + } } } @@ -1745,11 +1745,11 @@ void GuiMenuBar::onAction() char buf[512]; - // If this menu item is a submenu, then set the isSubmenu to 2 to indicate - // an arrow should be drawn. Otherwise set the isSubmenu normally. - char isSubmenu = 1; - if(walk->isSubmenu) - isSubmenu = 2; + // If this menu item is a submenu, then set the isSubmenu to 2 to indicate + // an arrow should be drawn. Otherwise set the isSubmenu normally. + char isSubmenu = 1; + if(walk->isSubmenu) + isSubmenu = 2; char bitmapIndex = 1; if(walk->bitmapIndex >= 0 && (walk->bitmapIndex * 3 <= mProfile->mBitmapArrayRects.size())) @@ -1861,8 +1861,8 @@ void GuiMenuBar::onSubmenuAction(S32 selectionIndex, const RectI& bounds, Point2 char buf[512]; - // Can't have submenus within submenus. - char isSubmenu = 1; + // Can't have submenus within submenus. + char isSubmenu = 1; char bitmapIndex = 1; if(walk->bitmapIndex >= 0 && (walk->bitmapIndex * 3 <= mProfile->mBitmapArrayRects.size())) @@ -1916,7 +1916,7 @@ void GuiMenuBar::onSubmenuAction(S32 selectionIndex, const RectI& bounds, Point2 void GuiMenuBar::closeSubmenu() { if(!mSubmenuBackground || !mSubmenuTextList) - return; + return; // Get the selection from the text list: S32 selectionIndex = mSubmenuTextList->getSelectedCell().y; @@ -1934,8 +1934,8 @@ void GuiMenuBar::closeSubmenu() if ( selectionIndex != -1 ) { MenuItem *list = NULL; - if(mouseOverSubmenu) - { + if(mouseOverSubmenu) + { list = mouseOverSubmenu->submenu->firstMenuItem; while(selectionIndex && list) @@ -1943,7 +1943,7 @@ void GuiMenuBar::closeSubmenu() list = list->nextMenuItem; selectionIndex--; } - } + } if(list) menuItemSelected(list->submenuParentMenu, list); } @@ -1981,13 +1981,13 @@ void GuiMenuBar::processTick() { // If we're at a particular number of ticks, notify the script function if(mMouseOverCounter < mMouseHoverAmount) - { + { ++mMouseOverCounter; - } else if(mMouseOverCounter == mMouseHoverAmount) - { + } else if(mMouseOverCounter == mMouseHoverAmount) + { ++mMouseOverCounter; - onMouseInMenu_callback(true); // Last parameter indicates if we've entered or left the menu - } + onMouseInMenu_callback(true); // Last parameter indicates if we've entered or left the menu + } } } diff --git a/Engine/source/gui/editor/guiParticleGraphCtrl.cpp b/Engine/source/gui/editor/guiParticleGraphCtrl.cpp index 1f9465760..8e20bfeef 100644 --- a/Engine/source/gui/editor/guiParticleGraphCtrl.cpp +++ b/Engine/source/gui/editor/guiParticleGraphCtrl.cpp @@ -43,16 +43,16 @@ GuiParticleGraphCtrl::GuiParticleGraphCtrl() for(S32 i = 0; i < MaxPlots; i++) { - mPlots[i].mGraphColor = ColorF(1.0, 1.0, 1.0); - VECTOR_SET_ASSOCIATION(mPlots[i].mGraphData); - mPlots[i].mGraphMax.x = 1; - mPlots[i].mGraphMax.y = 50; - mPlots[i].mGraphMin.x = 0; - mPlots[i].mGraphMin.y = 0; - mPlots[i].mGraphType = Polyline; - mPlots[i].mGraphName = StringTable->insert(""); - mPlots[i].mHidden = false; - mPlots[i].mGraphScale = 0.05f; + mPlots[i].mGraphColor = ColorF(1.0, 1.0, 1.0); + VECTOR_SET_ASSOCIATION(mPlots[i].mGraphData); + mPlots[i].mGraphMax.x = 1; + mPlots[i].mGraphMax.y = 50; + mPlots[i].mGraphMin.x = 0; + mPlots[i].mGraphMin.y = 0; + mPlots[i].mGraphType = Polyline; + mPlots[i].mGraphName = StringTable->insert(""); + mPlots[i].mHidden = false; + mPlots[i].mGraphScale = 0.05f; } mPlots[0].mGraphColor = ColorF(1.0f, 0.2f, 0.2f); @@ -127,87 +127,87 @@ void GuiParticleGraphCtrl::onRender(Point2I offset, const RectI &updateRect) // Fetch Draw Utility. GFXDrawUtil* pDrawUtil = GFX->getDrawUtil(); - if (mProfile->mBorder) - { - const RectI bounds = getBounds(); - RectI rect(offset.x, offset.y, bounds.extent.x, bounds.extent.y); - pDrawUtil->drawRect(rect, mProfile->mBorderColor); - } + if (mProfile->mBorder) + { + const RectI bounds = getBounds(); + RectI rect(offset.x, offset.y, bounds.extent.x, bounds.extent.y); + pDrawUtil->drawRect(rect, mProfile->mBorderColor); + } GuiControlProfile* profile = dynamic_cast(Sim::findObject("GuiDefaultProfile")); Resource font = profile->mFont; - GFXVideoMode videoMode = GFXInit::getDesktopResolution(); + GFXVideoMode videoMode = GFXInit::getDesktopResolution(); - ColorF color(1.0f, 1.0f, 1.0f, 0.5f); - pDrawUtil->drawRectFill(updateRect, color); + ColorF color(1.0f, 1.0f, 1.0f, 0.5f); + pDrawUtil->drawRectFill(updateRect, color); - for (S32 k = 0; k < MaxPlots; k++) - { - // Nothing to graph - if ((mPlots[k].mGraphData.size() == 0) || (mPlots[k].mHidden == true)) - continue; - + for (S32 k = 0; k < MaxPlots; k++) + { + // Nothing to graph + if ((mPlots[k].mGraphData.size() == 0) || (mPlots[k].mHidden == true)) + continue; + Point2F graphExtent = getGraphExtent(k); - // Adjust scale to max value + 5% so we can see high value - F32 ScaleX = (F32(getExtent().x) / (graphExtent.x*(1.00 + (mPlots[k].mGraphScale)))); - F32 ScaleY = (F32(getExtent().y) / (graphExtent.y*(1.00 + (mPlots[k].mGraphScale)))); + // Adjust scale to max value + 5% so we can see high value + F32 ScaleX = (F32(getExtent().x) / (graphExtent.x*(1.00 + (mPlots[k].mGraphScale)))); + F32 ScaleY = (F32(getExtent().y) / (graphExtent.y*(1.00 + (mPlots[k].mGraphScale)))); - if((mPlots[k].mGraphType == Point) || (mPlots[k].mGraphType == Polyline)) - { + if((mPlots[k].mGraphType == Point) || (mPlots[k].mGraphType == Polyline)) + { S32 posX; - S32 posY; - S32 lastPosX = 0; - S32 lastPosY = 0; - Point2F plotPoint; + S32 posY; + S32 lastPosX = 0; + S32 lastPosY = 0; + Point2F plotPoint; - S32 size = 32; + S32 size = 32; - for (S32 sample = 0; sample < mPlots[k].mGraphData.size(); sample++) - { - S32 temp; + for (S32 sample = 0; sample < mPlots[k].mGraphData.size(); sample++) + { + S32 temp; - temp = (S32)(((F32)getExtent().x / (F32)mPlots[k].mGraphData.size()) * (F32)sample); + temp = (S32)(((F32)getExtent().x / (F32)mPlots[k].mGraphData.size()) * (F32)sample); - // calculate the point positions + // calculate the point positions plotPoint = getPlotPoint(k, sample); - posX = (S32)((plotPoint.x - mPlots[k].mGraphMin.x) * (ScaleX /(1.00 + mPlots[k].mGraphScale))); - posY = (getExtent().y) - (S32)((plotPoint.y - mPlots[k].mGraphMin.y) * ScaleY); + posX = (S32)((plotPoint.x - mPlots[k].mGraphMin.x) * (ScaleX /(1.00 + mPlots[k].mGraphScale))); + posY = (getExtent().y) - (S32)((plotPoint.y - mPlots[k].mGraphMin.y) * ScaleY); posX += getExtent().x * (mPlots[k].mGraphScale); - posY /= (1.00 + (mPlots[k].mGraphScale)); + posY /= (1.00 + (mPlots[k].mGraphScale)); posX = localToGlobalCoord(Point2I(posX, posY)).x; - posY = localToGlobalCoord(Point2I(posX, posY)).y; + posY = localToGlobalCoord(Point2I(posX, posY)).y; - // check if this isn't our first loop through, if it is we won't have starting points + // check if this isn't our first loop through, if it is we won't have starting points if(sample > 0) - { - pDrawUtil->drawLine( lastPosX, lastPosY , posX, posY , mPlots[k].mGraphColor ); - } else - { + { + pDrawUtil->drawLine( lastPosX, lastPosY , posX, posY , mPlots[k].mGraphColor ); + } else + { mPlots[k].mNutList.clear(); - } + } mPlots[k].mNutList.push_back( Point2F(posX, posY) ); - // store the last positions to be the starting points drawn into a line next loop - lastPosX = posX; - lastPosY = posY; + // store the last positions to be the starting points drawn into a line next loop + lastPosX = posX; + lastPosY = posY; //Con::printf("red %f green %f blue %f", mPlots[k].mGraphColor.red, mPlots[k].mGraphColor.green, mPlots[k].mGraphColor.blue); - if(mSelectedPoint != -1) - { - mLastSelectedPoint = mSelectedPoint; - } + if(mSelectedPoint != -1) + { + mLastSelectedPoint = mSelectedPoint; + } ColorI nutColor (mPlots[k].mGraphColor); - if(k == mSelectedPlot && sample == mLastSelectedPoint) + if(k == mSelectedPlot && sample == mLastSelectedPoint) { // grab the colors for the nut F32 red = mPlots[k].mGraphColor.red; @@ -224,51 +224,51 @@ void GuiParticleGraphCtrl::onRender(Point2I offset, const RectI &updateRect) } // draw the seleciton nut - drawNut( Point2I(posX, posY), 3, mOutlineColor, nutColor ); + drawNut( Point2I(posX, posY), 3, mOutlineColor, nutColor ); - if((mLastSelectedPoint != -1) || (mRenderAllPoints == true)) - { + if((mLastSelectedPoint != -1) || (mRenderAllPoints == true)) + { if((k == mSelectedPlot && sample == mLastSelectedPoint) || (mRenderAllPoints == true)) - { + { char number[32]; - Point2I comparePos = localToGlobalCoord(Point2I(getPosition().x, getPosition().y)); + Point2I comparePos = localToGlobalCoord(Point2I(getPosition().x, getPosition().y)); dSprintf(number, 32, "%4.3f %4.3f", plotPoint.x, plotPoint.y); S32 textWidth = (S32)font->getStrWidth((const UTF8*)number);; - textWidth /= 2; + textWidth /= 2; - if((((S32)posX - (textWidth/2)) < comparePos.x) || (((S32)posX - textWidth) <= 0)) - { + if((((S32)posX - (textWidth/2)) < comparePos.x) || (((S32)posX - textWidth) <= 0)) + { posX += (textWidth/1.5); - } else if((posX + (textWidth * 1.8)) > (comparePos.x + getExtent().x) || ((posX + textWidth) >= videoMode.resolution.x)) - { + } else if((posX + (textWidth * 1.8)) > (comparePos.x + getExtent().x) || ((posX + textWidth) >= videoMode.resolution.x)) + { posX -= (textWidth * 1.5); - } + } - if((((S32)posY) < comparePos.y) || (((S32)posY - textWidth) <= 0)) - { + if((((S32)posY) < comparePos.y) || (((S32)posY - textWidth) <= 0)) + { posY += 40; - } - - pDrawUtil->setBitmapModulation( profile->mFontColor ); - pDrawUtil->drawText( font, Point2I(posX, posY + 5) - Point2I(size >> 1, size), number ); - pDrawUtil->clearBitmapModulation(); - } - } - } - } - } + } + + pDrawUtil->setBitmapModulation( profile->mFontColor ); + pDrawUtil->drawText( font, Point2I(posX, posY + 5) - Point2I(size >> 1, size), number ); + pDrawUtil->clearBitmapModulation(); + } + } + } + } + } - if(mRenderNextGraphTooltip == true && mRenderGraphTooltip == true) - { + if(mRenderNextGraphTooltip == true && mRenderGraphTooltip == true) + { char argBuffer[1][32]; dSprintf(argBuffer[0], 32, "%s", getGraphName(mTooltipSelectedPlot)); - renderGraphTooltip(mCursorPos, argBuffer[0]); - } + renderGraphTooltip(mCursorPos, argBuffer[0]); + } } S32 GuiParticleGraphCtrl::addPlotPoint(S32 plotID, Point2F v, bool setAdded) @@ -302,44 +302,44 @@ S32 GuiParticleGraphCtrl::addPlotPoint(S32 plotID, Point2F v, bool setAdded) for(S32 i = 0; i < mPlots[plotID].mGraphData.size(); i++) { - if(mFabs(v.x - mPlots[plotID].mGraphData[i].x) < 0.001) - { - if(mAutoRemove == true) - { + if(mFabs(v.x - mPlots[plotID].mGraphData[i].x) < 0.001) + { + if(mAutoRemove == true) + { changePlotPoint(plotID, i, v); - plotChanged = true; - mPlotIndex = i; - } else - { + plotChanged = true; + mPlotIndex = i; + } else + { mPlotIndex = -1; - } - - plotAdded = true; - - break; - } else if(v.x < mPlots[plotID].mGraphData[i].x) - { + } + + plotAdded = true; + + break; + } else if(v.x < mPlots[plotID].mGraphData[i].x) + { insertPlotPoint(plotID, i, v); - plotAdded = true; - mPlotIndex = i; - break; - } + plotAdded = true; + mPlotIndex = i; + break; + } } if(plotAdded == false) { - mPlots[plotID].mGraphData.push_back( v ); - mPlotIndex = mPlots[plotID].mGraphData.size() - 1; + mPlots[plotID].mGraphData.push_back( v ); + mPlotIndex = mPlots[plotID].mGraphData.size() - 1; } if(mAutoMax == true) { // Keep record of maximum data value for scaling purposes. if(v.y > mPlots[plotID].mGraphMax.y) - mPlots[plotID].mGraphMax.y = v.y; + mPlots[plotID].mGraphMax.y = v.y; if(v.x > mPlots[plotID].mGraphMax.x) - mPlots[plotID].mGraphMax.x = v.x; + mPlots[plotID].mGraphMax.x = v.x; } if(plotChanged == true) @@ -348,8 +348,8 @@ S32 GuiParticleGraphCtrl::addPlotPoint(S32 plotID, Point2F v, bool setAdded) } else if(mPlotIndex != -1 && setAdded) { mPointWasAdded = true; - mAddedPoint = v; - mAddedPointIndex = mPlotIndex; + mAddedPoint = v; + mAddedPointIndex = mPlotIndex; } return mPlotIndex; @@ -367,10 +367,10 @@ void GuiParticleGraphCtrl::insertPlotPoint(S32 plotID, S32 i, Point2F v) { // Keep record of maximum data value for scaling purposes. if(v.y > mPlots[plotID].mGraphMax.y) - mPlots[plotID].mGraphMax.y = v.y; + mPlots[plotID].mGraphMax.y = v.y; if(v.x > mPlots[plotID].mGraphMax.x) - mPlots[plotID].mGraphMax.x = v.x; + mPlots[plotID].mGraphMax.x = v.x; } // Argument Buffer. @@ -477,7 +477,7 @@ S32 GuiParticleGraphCtrl::getPlotIndex(S32 plotID, F32 x, F32 y) compareY = mPlots[plotID].mGraphData[i].y; // - //if((x == compareX) && (y == compareY)) + //if((x == compareX) && (y == compareY)) if((mFabs(x - compareX) < 0.001) && (mFabs(y - compareY) < 0.001)) return i; } @@ -487,16 +487,16 @@ S32 GuiParticleGraphCtrl::getPlotIndex(S32 plotID, F32 x, F32 y) void GuiParticleGraphCtrl::setGraphType(S32 plotID, const char *graphType) { - AssertFatal(plotID > -1 && plotID < MaxPlots, "Invalid plot specified!"); - if(!dStricmp(graphType,"Bar")) - mPlots[plotID].mGraphType = Bar; - else if(!dStricmp(graphType,"Filled")) - mPlots[plotID].mGraphType = Filled; - else if(!dStricmp(graphType,"Point")) - mPlots[plotID].mGraphType = Point; - else if(!dStricmp(graphType,"Polyline")) - mPlots[plotID].mGraphType = Polyline; - else AssertWarn(true, "Invalid graph type!"); + AssertFatal(plotID > -1 && plotID < MaxPlots, "Invalid plot specified!"); + if(!dStricmp(graphType,"Bar")) + mPlots[plotID].mGraphType = Bar; + else if(!dStricmp(graphType,"Filled")) + mPlots[plotID].mGraphType = Filled; + else if(!dStricmp(graphType,"Point")) + mPlots[plotID].mGraphType = Point; + else if(!dStricmp(graphType,"Polyline")) + mPlots[plotID].mGraphType = Polyline; + else AssertWarn(true, "Invalid graph type!"); } void GuiParticleGraphCtrl::setSelectedPlot(S32 plotID) @@ -565,8 +565,8 @@ void GuiParticleGraphCtrl::setRenderGraphTooltip(bool renderGraphTooltip) void GuiParticleGraphCtrl::drawNut(const Point2I &nut, S32 size, ColorI &outlineColor, ColorI &nutColor) { - // Fetch Draw Utility. - GFXDrawUtil* pDrawUtil = GFX->getDrawUtil(); + // Fetch Draw Utility. + GFXDrawUtil* pDrawUtil = GFX->getDrawUtil(); //Con::printf("r %d g %d b %d", nutColor.red, nutColor.green, nutColor.blue); S32 NUT_SIZE = size; @@ -588,17 +588,17 @@ Point2I GuiParticleGraphCtrl::findHitNut( Point2I hitPoint ) { for(S32 i = 0; i < MaxPlots; i++) { - if ( (mPlots[i].mGraphData.size() == 0) || (mPlots[i].mHidden == true)) + if ( (mPlots[i].mGraphData.size() == 0) || (mPlots[i].mHidden == true)) continue; for (S32 j = 0 ; j < mPlots[i].mNutList.size(); j++ ) { - if( inNut (Point2I( mPlots[i].mNutList[j].x, mPlots[i].mNutList[j].y), hitPoint.x, hitPoint.y) ) - { + if( inNut (Point2I( mPlots[i].mNutList[j].x, mPlots[i].mNutList[j].y), hitPoint.x, hitPoint.y) ) + { mTooltipSelectedPlot = i; - return Point2I(i,j); - } - } + return Point2I(i,j); + } + } } return Point2I(-1,-1); @@ -718,7 +718,7 @@ StringTableEntry GuiParticleGraphCtrl::getGraphName(S32 plotID) void GuiParticleGraphCtrl::onMouseMove(const GuiEvent &event) { mCursorPos = event.mousePoint; - + Point2I hitNut = findHitNut(event.mousePoint); if( hitNut != Point2I(-1,-1) ) @@ -745,8 +745,8 @@ void GuiParticleGraphCtrl::onMouseDown(const GuiEvent &event) if( hitNut != Point2I(-1,-1) ) { - if(event.mouseClickCount == 2) - { + if(event.mouseClickCount == 2) + { Point2F plotPoint = getPlotPoint(hitNut.x, hitNut.y); S32 point = removePlotPoint(hitNut.x, hitNut.y); @@ -755,31 +755,31 @@ void GuiParticleGraphCtrl::onMouseDown(const GuiEvent &event) dSprintf(argBuffer[0], 32, "%d", mSelectedPlot); dSprintf(argBuffer[1], 32, "%d", point); - dSprintf(argBuffer[2], 32, "%f %f", plotPoint.x, plotPoint.y); + dSprintf(argBuffer[2], 32, "%f %f", plotPoint.x, plotPoint.y); - + // Call Scripts. Con::executef(this, "onPlotPointRemoved", argBuffer[0], argBuffer[1], argBuffer[2]); - } else - { - setSelectedPlot(hitNut.x); + } else + { + setSelectedPlot(hitNut.x); setSelectedPoint(hitNut.y); - mOriginalSelectedPoint = hitNut.y; + mOriginalSelectedPoint = hitNut.y; - char argBuffer[32]; + char argBuffer[32]; dSprintf(argBuffer, 32, "%d", hitNut.y); // Call Scripts. Con::executef(this, "onPlotPointSelectedMouseDown", argBuffer); - } + } } else if( mSelectedPlot != -1 ) { - Point2F mousePos = convertToGraphCoord(mSelectedPlot, event.mousePoint); - mLastSelectedPoint = addPlotPoint(mSelectedPlot, mousePos); + Point2F mousePos = convertToGraphCoord(mSelectedPlot, event.mousePoint); + mLastSelectedPoint = addPlotPoint(mSelectedPlot, mousePos); - // Argument Buffer. + // Argument Buffer. char argBuffer[32]; dSprintf(argBuffer, 32, "%f %f", convertToGraphCoord(mSelectedPlot, event.mousePoint).x, convertToGraphCoord(mSelectedPlot, event.mousePoint).y); @@ -787,41 +787,41 @@ void GuiParticleGraphCtrl::onMouseDown(const GuiEvent &event) // Call Scripts. Con::executef(this, "onMouseDragged", argBuffer); - return; + return; } } void GuiParticleGraphCtrl::onMouseUp(const GuiEvent &event) { if(mSelectedPoint != -1) - mLastSelectedPoint = mSelectedPoint; + mLastSelectedPoint = mSelectedPoint; if(mPointWasAdded == true) { if(mSelectedPoint == -1) - { - // Argument Buffer. + { + // Argument Buffer. char argBuffer[3][32]; dSprintf(argBuffer[0], 32, "%d", mSelectedPlot); dSprintf(argBuffer[1], 32, "%f %f", mAddedPoint.x, mAddedPoint.y); - dSprintf(argBuffer[2], 32, "%d", mAddedPointIndex); + dSprintf(argBuffer[2], 32, "%d", mAddedPointIndex); // Call Scripts. Con::executef(this, "onPlotPointAdded", argBuffer[0], argBuffer[1], argBuffer[2]); - } else - { + } else + { // Argument Buffer. char argBuffer[4][32]; dSprintf(argBuffer[0], 32, "%d", mSelectedPlot); dSprintf(argBuffer[1], 32, "%f %f", mAddedPoint.x, mAddedPoint.y); - dSprintf(argBuffer[2], 32, "%d", mOriginalSelectedPoint); - dSprintf(argBuffer[3], 32, "%d", mAddedPointIndex); + dSprintf(argBuffer[2], 32, "%d", mOriginalSelectedPoint); + dSprintf(argBuffer[3], 32, "%d", mAddedPointIndex); // Call Scripts. Con::executef(this, "onPlotPointChangedUp", argBuffer[0], argBuffer[1], argBuffer[2], argBuffer[3]); - } + } } mPointWasAdded = false; @@ -835,37 +835,37 @@ void GuiParticleGraphCtrl::onMouseDragged(const GuiEvent &event) if(mSelectedPoint != -1) { - Point2F mousePos = convertToGraphCoord(mSelectedPlot, event.mousePoint); + Point2F mousePos = convertToGraphCoord(mSelectedPlot, event.mousePoint); if(mPointXMovementClamped == true) - { + { F32 prevXPos = getPlotPoint(mSelectedPlot, mSelectedPoint).x; - if(mousePos.x != prevXPos) - { - mousePos.x = prevXPos; - } - } + if(mousePos.x != prevXPos) + { + mousePos.x = prevXPos; + } + } - removePlotPoint(mSelectedPlot, mSelectedPoint); - S32 point = addPlotPoint(mSelectedPlot, mousePos); + removePlotPoint(mSelectedPlot, mSelectedPoint); + S32 point = addPlotPoint(mSelectedPlot, mousePos); if(point != -1) - { + { setSelectedPoint(point); - mLastMousePos = mousePos; + mLastMousePos = mousePos; // Argument Buffer. char argBuffer[3][32]; dSprintf(argBuffer[0], 32, "%d", mSelectedPlot); dSprintf(argBuffer[1], 32, "%f %f", mAddedPoint.x, mAddedPoint.y); - dSprintf(argBuffer[2], 32, "%d", point); + dSprintf(argBuffer[2], 32, "%d", point); // Call Scripts. Con::executef(this, "onPlotPointChangedMove", argBuffer[0], argBuffer[1], argBuffer[2]); - } else - { + } else + { point = addPlotPoint(mSelectedPlot, mLastMousePos); - } + } } // Argument Buffer. @@ -891,7 +891,7 @@ void GuiParticleGraphCtrl::onRightMouseDown(const GuiEvent &event) dSprintf(argBuffer[0], 32, "%d", mSelectedPlot); dSprintf(argBuffer[1], 32, "%d", point); - dSprintf(argBuffer[2], 32, "%f %f", plotPoint.x, plotPoint.y); + dSprintf(argBuffer[2], 32, "%f %f", plotPoint.x, plotPoint.y); // Call Scripts. Con::executef(this, "onPlotPointRemoved", argBuffer[0], argBuffer[1], argBuffer[2]); @@ -912,12 +912,12 @@ void GuiParticleGraphCtrl::onRightMouseDragged(const GuiEvent &event) Point2F plotPoint = getPlotPoint(hitNut.x, hitNut.y); S32 point = removePlotPoint(hitNut.x, hitNut.y); - // Argument Buffer. + // Argument Buffer. char argBuffer[3][32]; dSprintf(argBuffer[0], 32, "%d", mSelectedPlot); dSprintf(argBuffer[1], 32, "%d", point); - dSprintf(argBuffer[2], 32, "%f %f", plotPoint.x, plotPoint.y); + dSprintf(argBuffer[2], 32, "%f %f", plotPoint.x, plotPoint.y); // Call Scripts. Con::executef(this, "onPlotPointRemoved", argBuffer[0], argBuffer[1], argBuffer[2]); @@ -987,12 +987,12 @@ bool GuiParticleGraphCtrl::renderGraphTooltip(Point2I cursorPos, StringTableEntr RectI rect(offset, textBounds); GFX->setClipRect(rect); - // Fetch Draw Utility. - GFXDrawUtil* pDrawUtil = GFX->getDrawUtil(); + // Fetch Draw Utility. + GFXDrawUtil* pDrawUtil = GFX->getDrawUtil(); // Draw Filler bit, then border on top of that - pDrawUtil->drawRectFill(rect, ColorI(mTooltipProfile->mFillColor.red, mTooltipProfile->mFillColor.green, mTooltipProfile->mFillColor.blue, 200) ); - pDrawUtil->drawRect( rect, mTooltipProfile->mBorderColor ); + pDrawUtil->drawRectFill(rect, ColorI(mTooltipProfile->mFillColor.red, mTooltipProfile->mFillColor.green, mTooltipProfile->mFillColor.blue, 200) ); + pDrawUtil->drawRect( rect, mTooltipProfile->mBorderColor ); // Draw the text centered in the tool tip box pDrawUtil->setBitmapModulation( mTooltipProfile->mFontColor ); @@ -1006,102 +1006,102 @@ bool GuiParticleGraphCtrl::renderGraphTooltip(Point2I cursorPos, StringTableEntr DefineConsoleMethod(GuiParticleGraphCtrl, setSelectedPoint, void, (S32 point), , "(int point)" "Set the selected point on the graph.\n" - "@return No return value") + "@return No return value") { if(point >= object->mPlots[object->mSelectedPlot].mGraphData.size() || point < 0) { - Con::errorf("Invalid point to select."); - return; + Con::errorf("Invalid point to select."); + return; } object->setSelectedPoint( point ); } DefineConsoleMethod(GuiParticleGraphCtrl, setSelectedPlot, void, (S32 plotID), , "(int plotID)" "Set the selected plot (a.k.a. graph)." - "@return No return value" ) + "@return No return value" ) { if(plotID > object->MaxPlots) { - Con::errorf("Invalid plotID."); - return; + Con::errorf("Invalid plotID."); + return; } object->setSelectedPlot( plotID ); } DefineConsoleMethod(GuiParticleGraphCtrl, clearGraph, void, (S32 plotID), , "(int plotID)" "Clear the graph of the given plot." - "@return No return value") + "@return No return value") { if(plotID > object->MaxPlots) { - Con::errorf("Invalid plotID."); - return; + Con::errorf("Invalid plotID."); + return; } object->clearGraph( plotID ); } DefineConsoleMethod(GuiParticleGraphCtrl, clearAllGraphs, void, (), , "()" "Clear all of the graphs." - "@return No return value") + "@return No return value") { object->clearAllGraphs(); } DefineConsoleMethod(GuiParticleGraphCtrl, addPlotPoint, S32, (S32 plotID, F32 x, F32 y, bool setAdded), (true), "(int plotID, float x, float y, bool setAdded = true;)" "Add a data point to the given plot." - "@return") + "@return") { if(plotID > object->MaxPlots) { - Con::errorf("Invalid plotID."); - return -2; + Con::errorf("Invalid plotID."); + return -2; } return object->addPlotPoint( plotID, Point2F(x, y), setAdded); } DefineConsoleMethod(GuiParticleGraphCtrl, insertPlotPoint, void, (S32 plotID, S32 i, F32 x, F32 y), , "(int plotID, int i, float x, float y)\n" "Insert a data point to the given plot and plot position.\n" - "@param plotID The plot you want to access\n" - "@param i The data point.\n" - "@param x,y The plot position.\n" - "@return No return value.") + "@param plotID The plot you want to access\n" + "@param i The data point.\n" + "@param x,y The plot position.\n" + "@return No return value.") { if(plotID > object->MaxPlots) { - Con::errorf("Invalid plotID."); - return; + Con::errorf("Invalid plotID."); + return; } object->insertPlotPoint( plotID, i, Point2F(x, y)); } DefineConsoleMethod(GuiParticleGraphCtrl, changePlotPoint, S32, (S32 plotID, S32 i, F32 x, F32 y), , "(int plotID, int i, float x, float y)" "Change a data point to the given plot and plot position.\n" - "@param plotID The plot you want to access\n" - "@param i The data point.\n" - "@param x,y The plot position.\n" - "@return No return value.") + "@param plotID The plot you want to access\n" + "@param i The data point.\n" + "@param x,y The plot position.\n" + "@return No return value.") { if(plotID > object->MaxPlots) { - Con::errorf("Invalid plotID."); - return -1; + Con::errorf("Invalid plotID."); + return -1; } return object->changePlotPoint( plotID, i, Point2F(x, y)); } DefineConsoleMethod(GuiParticleGraphCtrl, getSelectedPlot, S32, (), , "() " "Gets the selected Plot (a.k.a. graph).\n" - "@return The plot's ID.") + "@return The plot's ID.") { return object->getSelectedPlot(); } DefineConsoleMethod(GuiParticleGraphCtrl, getSelectedPoint, S32, (), , "()" "Gets the selected Point on the Plot (a.k.a. graph)." - "@return The last selected point ID") + "@return The last selected point ID") { - return object->getSelectedPoint(); + return object->getSelectedPoint(); } DefineConsoleMethod(GuiParticleGraphCtrl, isExistingPoint, bool, (S32 plotID, S32 samples), , "(int plotID, int samples)" @@ -1110,27 +1110,27 @@ DefineConsoleMethod(GuiParticleGraphCtrl, isExistingPoint, bool, (S32 plotID, S3 if(plotID > object->MaxPlots) { - Con::errorf("Invalid plotID."); + Con::errorf("Invalid plotID."); } if(samples > object->MaxDataPoints) { - Con::errorf("Invalid sample."); + Con::errorf("Invalid sample."); } return object->isExistingPoint(plotID, samples); } DefineConsoleMethod(GuiParticleGraphCtrl, getPlotPoint, Point2F, (S32 plotID, S32 samples), , "(int plotID, int samples)" "Get a data point from the plot specified, samples from the start of the graph." - "@return The data point ID") + "@return The data point ID") { if(plotID > object->MaxPlots) { - Con::errorf("Invalid plotID."); + Con::errorf("Invalid plotID."); } if(samples > object->MaxDataPoints) { - Con::errorf("Invalid sample."); + Con::errorf("Invalid sample."); } @@ -1139,26 +1139,26 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getPlotPoint, Point2F, (S32 plotID, S3 DefineConsoleMethod(GuiParticleGraphCtrl, getPlotIndex, S32, (S32 plotID, F32 x, F32 y), , "(int plotID, float x, float y)\n" "Gets the index of the point passed on the plotID passed (graph ID).\n" - "@param plotID The plot you wish to check.\n" - "@param x,y The coordinates of the point to get.\n" - "@return Returns the index of the point.\n") + "@param plotID The plot you wish to check.\n" + "@param x,y The coordinates of the point to get.\n" + "@return Returns the index of the point.\n") { if(plotID > object->MaxPlots) { - Con::errorf("Invalid plotID."); + Con::errorf("Invalid plotID."); } return object->getPlotIndex(plotID, x, y); } DefineConsoleMethod(GuiParticleGraphCtrl, getGraphColor, ColorF, (S32 plotID), , "(int plotID)" "Get the color of the graph passed." - "@return Returns the color of the graph as a string of RGB values formatted as \"R G B\"") + "@return Returns the color of the graph as a string of RGB values formatted as \"R G B\"") { if(plotID > object->MaxPlots) { - Con::errorf("Invalid plotID."); + Con::errorf("Invalid plotID."); } return object->getGraphColor(plotID); @@ -1167,24 +1167,24 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphColor, ColorF, (S32 plotID), , DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMin, Point2F, (S32 plotID), , "(int plotID) " "Get the minimum values of the graph ranges.\n" - "@return Returns the minimum of the range formatted as \"x-min y-min\"") + "@return Returns the minimum of the range formatted as \"x-min y-min\"") { if(plotID > object->MaxPlots) { - Con::errorf("Invalid plotID."); + Con::errorf("Invalid plotID."); } return object->getGraphMin(plotID); } DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMax, Point2F, (S32 plotID), , "(int plotID) " - "Get the maximum values of the graph ranges.\n" - "@return Returns the maximum of the range formatted as \"x-max y-max\"") + "Get the maximum values of the graph ranges.\n" + "@return Returns the maximum of the range formatted as \"x-max y-max\"") { if(plotID > object->MaxPlots) { - Con::errorf("Invalid plotID."); + Con::errorf("Invalid plotID."); } return object->getGraphMax(plotID); @@ -1192,12 +1192,12 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMax, Point2F, (S32 plotID), , DefineConsoleMethod(GuiParticleGraphCtrl, getGraphName, const char*, (S32 plotID), , "(int plotID) " "Get the name of the graph passed.\n" - "@return Returns the name of the plot") + "@return Returns the name of the plot") { if(plotID > object->MaxPlots) { - Con::errorf("Invalid plotID."); + Con::errorf("Invalid plotID."); } const U32 bufSize = 64; @@ -1208,170 +1208,170 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphName, const char*, (S32 plotID } DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMin, void, (S32 plotID, F32 minX, F32 minY), , "(int plotID, float minX, float minY) " - "Set the min values of the graph of plotID.\n" - "@param plotID The plot to modify\n" - "@param minX,minY The minimum bound of the value range.\n" - "@return No return value.") + "Set the min values of the graph of plotID.\n" + "@param plotID The plot to modify\n" + "@param minX,minY The minimum bound of the value range.\n" + "@return No return value.") { - if(plotID > object->MaxPlots) - { - Con::errorf("Invalid plotID."); - return; - } + if(plotID > object->MaxPlots) + { + Con::errorf("Invalid plotID."); + return; + } - object->setGraphMin(plotID, Point2F(minX, minY)); + object->setGraphMin(plotID, Point2F(minX, minY)); } DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMinX, void, (S32 plotID, F32 minX), , "(int plotID, float minX) " - "Set the min X value of the graph of plotID.\n" - "@param plotID The plot to modify.\n" - "@param minX The minimum x value.\n" - "@return No return Value.") + "Set the min X value of the graph of plotID.\n" + "@param plotID The plot to modify.\n" + "@param minX The minimum x value.\n" + "@return No return Value.") { - if(plotID > object->MaxPlots) - { - Con::errorf("Invalid plotID."); - return; - } + if(plotID > object->MaxPlots) + { + Con::errorf("Invalid plotID."); + return; + } - object->setGraphMinX(plotID, minX); + object->setGraphMinX(plotID, minX); } DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMinY, void, (S32 plotID, F32 minX), , "(int plotID, float minY) " - "Set the min Y value of the graph of plotID." - "@param plotID The plot to modify.\n" - "@param minY The minimum y value.\n" - "@return No return Value.") + "Set the min Y value of the graph of plotID." + "@param plotID The plot to modify.\n" + "@param minY The minimum y value.\n" + "@return No return Value.") { - if(plotID > object->MaxPlots) - { - Con::errorf("Invalid plotID."); - return; - } + if(plotID > object->MaxPlots) + { + Con::errorf("Invalid plotID."); + return; + } - object->setGraphMinY(plotID, minX); + object->setGraphMinY(plotID, minX); } DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMax, void, (S32 plotID, F32 maxX, F32 maxY), , "(int plotID, float maxX, float maxY) " - "Set the max values of the graph of plotID." - "@param plotID The plot to modify\n" - "@param maxX,maxY The maximum bound of the value range.\n" - "@return No return value.") + "Set the max values of the graph of plotID." + "@param plotID The plot to modify\n" + "@param maxX,maxY The maximum bound of the value range.\n" + "@return No return value.") { - if(plotID > object->MaxPlots) - { - Con::errorf("Invalid plotID."); - return; - } + if(plotID > object->MaxPlots) + { + Con::errorf("Invalid plotID."); + return; + } - object->setGraphMax(plotID, Point2F(maxX, maxY)); + object->setGraphMax(plotID, Point2F(maxX, maxY)); } DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMaxX, void, (S32 plotID, F32 maxX), , "(int plotID, float maxX)" - "Set the max X value of the graph of plotID." - "@param plotID The plot to modify.\n" - "@param maxX The maximum x value.\n" - "@return No return Value.") + "Set the max X value of the graph of plotID." + "@param plotID The plot to modify.\n" + "@param maxX The maximum x value.\n" + "@return No return Value.") { - if(plotID > object->MaxPlots) - { - Con::errorf("Invalid plotID."); - return; - } + if(plotID > object->MaxPlots) + { + Con::errorf("Invalid plotID."); + return; + } - object->setGraphMaxX(plotID, maxX); + object->setGraphMaxX(plotID, maxX); } DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMaxY, void, (S32 plotID, F32 maxX), , "(int plotID, float maxY)" - "Set the max Y value of the graph of plotID." - "@param plotID The plot to modify.\n" - "@param maxY The maximum y value.\n" - "@return No return Value.") + "Set the max Y value of the graph of plotID." + "@param plotID The plot to modify.\n" + "@param maxY The maximum y value.\n" + "@return No return Value.") { - if(plotID > object->MaxPlots) - { - Con::errorf("Invalid plotID."); - return; - } + if(plotID > object->MaxPlots) + { + Con::errorf("Invalid plotID."); + return; + } - object->setGraphMaxY(plotID, maxX); + object->setGraphMaxY(plotID, maxX); } DefineConsoleMethod(GuiParticleGraphCtrl, setGraphHidden, void, (S32 plotID, bool isHidden), , "(int plotID, bool isHidden)" - "Set whether the graph number passed is hidden or not." - "@return No return value.") + "Set whether the graph number passed is hidden or not." + "@return No return value.") { - if(plotID > object->MaxPlots) - { - Con::errorf("Invalid plotID."); - return; - } + if(plotID > object->MaxPlots) + { + Con::errorf("Invalid plotID."); + return; + } - object->setGraphHidden(plotID, isHidden); + object->setGraphHidden(plotID, isHidden); } DefineConsoleMethod(GuiParticleGraphCtrl, setAutoGraphMax, void, (bool autoMax), , "(bool autoMax) " - "Set whether the max will automatically be set when adding points " - "(ie if you add a value over the current max, the max is increased to that value).\n" - "@return No return value.") + "Set whether the max will automatically be set when adding points " + "(ie if you add a value over the current max, the max is increased to that value).\n" + "@return No return value.") { - object->setAutoGraphMax(autoMax); + object->setAutoGraphMax(autoMax); } DefineConsoleMethod(GuiParticleGraphCtrl, setAutoRemove, void, (bool autoRemove), , "(bool autoRemove) " - "Set whether or not a point should be deleted when you drag another one over it." - "@return No return value.") + "Set whether or not a point should be deleted when you drag another one over it." + "@return No return value.") { - object->setAutoRemove(autoRemove); + object->setAutoRemove(autoRemove); } DefineConsoleMethod(GuiParticleGraphCtrl, setRenderAll, void, (bool autoRemove), , "(bool renderAll)" - "Set whether or not a position should be rendered on every point or just the last selected." - "@return No return value.") + "Set whether or not a position should be rendered on every point or just the last selected." + "@return No return value.") { - object->setRenderAll(autoRemove); + object->setRenderAll(autoRemove); } DefineConsoleMethod(GuiParticleGraphCtrl, setPointXMovementClamped, void, (bool autoRemove), , "(bool clamped)" - "Set whether the x position of the selected graph point should be clamped" - "@return No return value.") + "Set whether the x position of the selected graph point should be clamped" + "@return No return value.") { - object->setPointXMovementClamped(autoRemove); + object->setPointXMovementClamped(autoRemove); } DefineConsoleMethod(GuiParticleGraphCtrl, setRenderGraphTooltip, void, (bool autoRemove), , "(bool renderGraphTooltip)" - "Set whether or not to render the graph tooltip." - "@return No return value.") + "Set whether or not to render the graph tooltip." + "@return No return value.") { - object->setRenderGraphTooltip(autoRemove); + object->setRenderGraphTooltip(autoRemove); } DefineConsoleMethod(GuiParticleGraphCtrl, setGraphName, void, (S32 plotID, const char * graphName), , "(int plotID, string graphName) " - "Set the name of the given plot.\n" - "@param plotID The plot to modify.\n" - "@param graphName The name to set on the plot.\n" - "@return No return value.") + "Set the name of the given plot.\n" + "@param plotID The plot to modify.\n" + "@param graphName The name to set on the plot.\n" + "@return No return value.") { - if(plotID > object->MaxPlots) - { - Con::errorf("Invalid plotID."); - return; - } + if(plotID > object->MaxPlots) + { + Con::errorf("Invalid plotID."); + return; + } - object->setGraphName(plotID, graphName); + object->setGraphName(plotID, graphName); } DefineConsoleMethod(GuiParticleGraphCtrl, resetSelectedPoint, void, (), , "()" - "This will reset the currently selected point to nothing." - "@return No return value.") + "This will reset the currently selected point to nothing." + "@return No return value.") { - object->resetSelectedPoint(); + object->resetSelectedPoint(); } diff --git a/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp b/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp index 735607224..2b122f540 100644 --- a/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp @@ -65,10 +65,10 @@ ConsoleDocClass( GuiChunkedBitmapCtrl, void GuiChunkedBitmapCtrl::initPersistFields() { - addGroup("GuiChunkedBitmapCtrl"); + addGroup("GuiChunkedBitmapCtrl"); addField( "bitmap", TypeFilename, Offset( mBitmapName, GuiChunkedBitmapCtrl ), "This is the bitmap to render to the control." ); addField( "useVariable", TypeBool, Offset( mUseVariable, GuiChunkedBitmapCtrl ), "This decides whether to use the \"bitmap\" file " - "or a bitmap stored in \"variable\""); + "or a bitmap stored in \"variable\""); addField( "tile", TypeBool, Offset( mTile, GuiChunkedBitmapCtrl ), "This is no longer in use"); endGroup("GuiChunkedBitmapCtrl"); Parent::initPersistFields(); diff --git a/Engine/source/gui/worldEditor/undoActions.cpp b/Engine/source/gui/worldEditor/undoActions.cpp index 6c71a0831..94495d89e 100644 --- a/Engine/source/gui/worldEditor/undoActions.cpp +++ b/Engine/source/gui/worldEditor/undoActions.cpp @@ -32,9 +32,9 @@ IMPLEMENT_CONOBJECT( MECreateUndoAction ); ConsoleDocClass( MECreateUndoAction, - "@brief Material Editor create undo instance\n\n" - "Not intended for game development, for editors or internal use only.\n\n " - "@internal"); + "@brief Material Editor create undo instance\n\n" + "Not intended for game development, for editors or internal use only.\n\n " + "@internal"); MECreateUndoAction::MECreateUndoAction( const UTF8* actionName ) : UndoAction( actionName ) @@ -62,7 +62,7 @@ DefineEngineMethod( MECreateUndoAction, addObject, void, ( SimObject* obj),, "Add the object being created to an undo action.\n" "@param obj Object being created you want to create the undo for.") { - if (obj) + if (obj) object->addObject( obj ); } @@ -117,9 +117,9 @@ void MECreateUndoAction::redo() IMPLEMENT_CONOBJECT( MEDeleteUndoAction ); ConsoleDocClass( MEDeleteUndoAction, - "@brief Material Editor delete undo instance\n\n" - "Not intended for game development, for editors or internal use only.\n\n " - "@internal"); + "@brief Material Editor delete undo instance\n\n" + "Not intended for game development, for editors or internal use only.\n\n " + "@internal"); MEDeleteUndoAction::MEDeleteUndoAction( const UTF8 *actionName ) : UndoAction( actionName ) @@ -169,7 +169,7 @@ DefineEngineMethod( MEDeleteUndoAction, deleteObject, void, ( SimObject* obj),, "Delete the object and add it to the undo action.\n" "@param obj Object to delete and add to the undo action.") { - if (obj) + if (obj) object->deleteObject( obj ); } @@ -210,9 +210,9 @@ void MEDeleteUndoAction::redo() IMPLEMENT_CONOBJECT( InspectorFieldUndoAction ); ConsoleDocClass( InspectorFieldUndoAction, - "@brief Inspector Field undo action instance\n\n" - "Not intended for game development, for editors or internal use only.\n\n " - "@internal"); + "@brief Inspector Field undo action instance\n\n" + "Not intended for game development, for editors or internal use only.\n\n " + "@internal"); InspectorFieldUndoAction::InspectorFieldUndoAction() { diff --git a/Engine/source/lighting/lightManager.cpp b/Engine/source/lighting/lightManager.cpp index f53f5284d..fdc9e7c50 100644 --- a/Engine/source/lighting/lightManager.cpp +++ b/Engine/source/lighting/lightManager.cpp @@ -306,7 +306,7 @@ void LightManager::_update4LightConsts( const SceneData &sgData, GFXShaderConstHandle *lightInvRadiusSqSC, GFXShaderConstHandle *lightSpotDirSC, GFXShaderConstHandle *lightSpotAngleSC, - GFXShaderConstHandle *lightSpotFalloffSC, + GFXShaderConstHandle *lightSpotFalloffSC, GFXShaderConstBuffer *shaderConsts ) { PROFILE_SCOPE( LightManager_Update4LightConsts ); @@ -317,7 +317,7 @@ void LightManager::_update4LightConsts( const SceneData &sgData, lightInvRadiusSqSC->isValid() || lightSpotDirSC->isValid() || lightSpotAngleSC->isValid() || - lightSpotFalloffSC->isValid() ) + lightSpotFalloffSC->isValid() ) { PROFILE_SCOPE( LightManager_Update4LightConsts_setLights ); @@ -326,7 +326,7 @@ void LightManager::_update4LightConsts( const SceneData &sgData, static AlignedArray lightColors( 4, sizeof( Point4F ) ); static Point4F lightInvRadiusSq; static Point4F lightSpotAngle; - static Point4F lightSpotFalloff; + static Point4F lightSpotFalloff; F32 range; // Need to clear the buffers so that we don't leak @@ -359,10 +359,10 @@ void LightManager::_update4LightConsts( const SceneData &sgData, lightSpotDirs[2][i] = lightDir.z; if ( light->getType() == LightInfo::Spot ) - { + { lightSpotAngle[i] = mCos( mDegToRad( light->getOuterConeAngle() / 2.0f ) ); - lightSpotFalloff[i] = 1.0f / getMax( F32_MIN, mCos( mDegToRad( light->getInnerConeAngle() / 2.0f ) ) - lightSpotAngle[i] ); - } + lightSpotFalloff[i] = 1.0f / getMax( F32_MIN, mCos( mDegToRad( light->getInnerConeAngle() / 2.0f ) ) - lightSpotAngle[i] ); + } // Prescale the light color by the brightness to // avoid doing this in the shader. @@ -379,7 +379,7 @@ void LightManager::_update4LightConsts( const SceneData &sgData, shaderConsts->setSafe( lightSpotDirSC, lightSpotDirs ); shaderConsts->setSafe( lightSpotAngleSC, lightSpotAngle ); - shaderConsts->setSafe( lightSpotFalloffSC, lightSpotFalloff ); + shaderConsts->setSafe( lightSpotFalloffSC, lightSpotFalloff ); } diff --git a/Engine/source/navigation/navMesh.cpp b/Engine/source/navigation/navMesh.cpp index 64c20a93b..2d4b0ad7e 100644 --- a/Engine/source/navigation/navMesh.cpp +++ b/Engine/source/navigation/navMesh.cpp @@ -1143,10 +1143,10 @@ void NavMesh::buildLinks() // Iterate over links for(U32 j = 0; j < mLinkIDs.size(); j++) { - if (mLinksUnsynced[j]) - { + if (mLinksUnsynced[j]) + { if(tile.box.isContained(getLinkStart(j)) || - tile.box.isContained(getLinkEnd(j))) + tile.box.isContained(getLinkEnd(j))) { // Mark tile for build. mDirtyTiles.push_back_unique(i); @@ -1161,7 +1161,7 @@ void NavMesh::buildLinks() } } } - } + } if(mDirtyTiles.size()) ctx->startTimer(RC_TIMER_TOTAL); } diff --git a/Engine/source/platform/menus/popupMenu.cpp b/Engine/source/platform/menus/popupMenu.cpp index ee8d75a82..a7fc2e989 100644 --- a/Engine/source/platform/menus/popupMenu.cpp +++ b/Engine/source/platform/menus/popupMenu.cpp @@ -54,7 +54,7 @@ PopupMenu::PopupMenu() : mCanvas(NULL) mBarTitle = StringTable->insert(""); mIsPopup = false; - mPopupGUID = sMaxPopupGUID++; + mPopupGUID = sMaxPopupGUID++; } PopupMenu::~PopupMenu() @@ -126,10 +126,10 @@ void PopupMenu::onMenuSelect() //----------------------------------------------------------------------------- void PopupMenu::handleSelectEvent(U32 popID, U32 command) -{ - if (popID == mPopupGUID && canHandleID(command)) - if (handleSelect(command)) - smSelectionEventHandled = true; +{ + if (popID == mPopupGUID && canHandleID(command)) + if (handleSelect(command)) + smSelectionEventHandled = true; } //----------------------------------------------------------------------------- @@ -138,8 +138,8 @@ void PopupMenu::onAttachToMenuBar(GuiCanvas *canvas, S32 pos, const char *title) { mCanvas = canvas; - // Attached menus must be notified of menu events - smPopupMenuEvent.notify(this, &PopupMenu::handleSelectEvent); + // Attached menus must be notified of menu events + smPopupMenuEvent.notify(this, &PopupMenu::handleSelectEvent); // Pass on to sub menus for(SimSet::iterator i = mSubmenus->begin();i != mSubmenus->end();++i) @@ -160,8 +160,8 @@ void PopupMenu::onRemoveFromMenuBar(GuiCanvas *canvas) { mCanvas = NULL; - // We are no longer interested in select events, remove ourselves from the notification list in a safe way - Sim::postCurrentEvent(this, new PopUpNotifyRemoveEvent()); + // We are no longer interested in select events, remove ourselves from the notification list in a safe way + Sim::postCurrentEvent(this, new PopUpNotifyRemoveEvent()); // Pass on to sub menus for(SimSet::iterator i = mSubmenus->begin();i != mSubmenus->end();++i) diff --git a/Engine/source/platform/profiler.cpp b/Engine/source/platform/profiler.cpp index c978b9ac2..cde917b8d 100644 --- a/Engine/source/platform/profiler.cpp +++ b/Engine/source/platform/profiler.cpp @@ -724,37 +724,37 @@ DefineEngineFunction( profilerMarkerEnable, void, ( const char* markerName, bool //----------------------------------------------------------------------------- DefineEngineFunction( profilerEnable, void, ( bool enable ),, - "@brief Enables or disables the profiler.\n\n" - "Data is only gathered while the profiler is enabled.\n\n" - "@note Profiler is not available in shipping builds.\n" - "T3D has predefined profiling areas surrounded by markers, " - "but you may need to define additional markers (in C++) around areas you wish to profile," - " by using the PROFILE_START( markerName ); and PROFILE_END(); macros.\n\n" - "@ingroup Debugging\n" ) + "@brief Enables or disables the profiler.\n\n" + "Data is only gathered while the profiler is enabled.\n\n" + "@note Profiler is not available in shipping builds.\n" + "T3D has predefined profiling areas surrounded by markers, " + "but you may need to define additional markers (in C++) around areas you wish to profile," + " by using the PROFILE_START( markerName ); and PROFILE_END(); macros.\n\n" + "@ingroup Debugging\n" ) { if(gProfiler) gProfiler->enable(enable); } DefineEngineFunction(profilerDump, void, (),, - "@brief Dumps current profiling stats to the console window.\n\n" - "@note Markers disabled with profilerMarkerEnable() will be skipped over. " - "If the profiler is currently running, it will be disabled.\n" - "@ingroup Debugging") + "@brief Dumps current profiling stats to the console window.\n\n" + "@note Markers disabled with profilerMarkerEnable() will be skipped over. " + "If the profiler is currently running, it will be disabled.\n" + "@ingroup Debugging") { if(gProfiler) gProfiler->dumpToConsole(); } DefineEngineFunction( profilerDumpToFile, void, ( const char* fileName ),, - "@brief Dumps current profiling stats to a file.\n\n" - "@note If the profiler is currently running, it will be disabled.\n" - "@param fileName Name and path of file to save profiling stats to. Must use forward slashes (/). " - "Will attempt to create the file if it does not already exist.\n" - "@tsexample\n" - "profilerDumpToFile( \"C:/Torque/log1.txt\" );\n" - "@endtsexample\n\n" - "@ingroup Debugging" ) + "@brief Dumps current profiling stats to a file.\n\n" + "@note If the profiler is currently running, it will be disabled.\n" + "@param fileName Name and path of file to save profiling stats to. Must use forward slashes (/). " + "Will attempt to create the file if it does not already exist.\n" + "@tsexample\n" + "profilerDumpToFile( \"C:/Torque/log1.txt\" );\n" + "@endtsexample\n\n" + "@ingroup Debugging" ) { if(gProfiler) gProfiler->dumpToFile(fileName); @@ -762,9 +762,9 @@ DefineEngineFunction( profilerDumpToFile, void, ( const char* fileName ),, DefineEngineFunction( profilerReset, void, (),, "@brief Resets the profiler, clearing it of all its data.\n\n" - "If the profiler is currently running, it will first be disabled. " - "All markers will retain their current enabled/disabled status.\n\n" - "@ingroup Debugging" ) + "If the profiler is currently running, it will first be disabled. " + "All markers will retain their current enabled/disabled status.\n\n" + "@ingroup Debugging" ) { if(gProfiler) gProfiler->reset(); diff --git a/Engine/source/platformMac/macFileIO.mm b/Engine/source/platformMac/macFileIO.mm index 26dca66bb..7fbc3408d 100644 --- a/Engine/source/platformMac/macFileIO.mm +++ b/Engine/source/platformMac/macFileIO.mm @@ -839,7 +839,7 @@ static bool recurseDumpDirectories(const char *basePath, const char *subPath, Ve while (d = readdir(dip)) { - bool isDir; + bool isDir; isDir = false; if (d->d_type == DT_UNKNOWN) { diff --git a/Engine/source/renderInstance/renderPrePassMgr.cpp b/Engine/source/renderInstance/renderPrePassMgr.cpp index 6175c3eec..81f8782eb 100644 --- a/Engine/source/renderInstance/renderPrePassMgr.cpp +++ b/Engine/source/renderInstance/renderPrePassMgr.cpp @@ -843,7 +843,7 @@ void ProcessedPrePassMaterial::addStateBlockDesc(const GFXStateBlockDesc& desc) if ( isTranslucent ) { prePassStateBlock.setBlend( true, GFXBlendSrcAlpha, GFXBlendInvSrcAlpha ); - prePassStateBlock.setColorWrites(false, false, false, true); + prePassStateBlock.setColorWrites(false, false, false, true); } // Enable z reads, but only enable zwrites if we're not translucent. diff --git a/Engine/source/scene/sceneContainer.cpp b/Engine/source/scene/sceneContainer.cpp index b4dd2058c..298519655 100644 --- a/Engine/source/scene/sceneContainer.cpp +++ b/Engine/source/scene/sceneContainer.cpp @@ -892,7 +892,7 @@ bool SceneContainer::_castRay( U32 type, const Point3F& start, const Point3F& en *info = ri; info->point.interpolate(start, end, info->t); currentT = ri.t; - info->distance = (start - info->point).len(); + info->distance = (start - info->point).len(); } } } @@ -991,7 +991,7 @@ bool SceneContainer::_castRay( U32 type, const Point3F& start, const Point3F& en *info = ri; info->point.interpolate(start, end, info->t); currentT = ri.t; - info->distance = (start - info->point).len(); + info->distance = (start - info->point).len(); } } } @@ -1088,7 +1088,7 @@ bool SceneContainer::_castRay( U32 type, const Point3F& start, const Point3F& en *info = ri; info->point.interpolate(start, end, info->t); currentT = ri.t; - info->distance = (start - info->point).len(); + info->distance = (start - info->point).len(); } } } diff --git a/Engine/source/sim/actionMap.cpp b/Engine/source/sim/actionMap.cpp index e4455d458..27407e502 100644 --- a/Engine/source/sim/actionMap.cpp +++ b/Engine/source/sim/actionMap.cpp @@ -36,138 +36,138 @@ IMPLEMENT_CONOBJECT(ActionMap); ConsoleDocClass( ActionMap, - "@brief ActionMaps assign platform input events to console commands.\n\n" + "@brief ActionMaps assign platform input events to console commands.\n\n" - "Any platform input event can be bound in a single, generic way. In theory, the game doesn't need to know if the event came from the keyboard, mouse, joystick " - "or some other input device. This allows users of the game to map keys and actions according to their own preferences. " - "Game action maps are arranged in a stack for processing so individual parts of the game can define specific " - "actions. For example, when the player jumps into a vehicle it could push a vehicle action map and pop the default player action map.\n\n" + "Any platform input event can be bound in a single, generic way. In theory, the game doesn't need to know if the event came from the keyboard, mouse, joystick " + "or some other input device. This allows users of the game to map keys and actions according to their own preferences. " + "Game action maps are arranged in a stack for processing so individual parts of the game can define specific " + "actions. For example, when the player jumps into a vehicle it could push a vehicle action map and pop the default player action map.\n\n" - "@section ActionMap_creation Creating an ActionMap\n" + "@section ActionMap_creation Creating an ActionMap\n" - "The input system allows for the creation of multiple ActionMaps, so long as they have unique names and do not already exist. It's a simple " - "three step process.\n\n" - "1. Check to see if the ActionMap exists\n" - "2. Delete it if it exists\n" - "3. Instantiate the ActionMap\n\n" + "The input system allows for the creation of multiple ActionMaps, so long as they have unique names and do not already exist. It's a simple " + "three step process.\n\n" + "1. Check to see if the ActionMap exists\n" + "2. Delete it if it exists\n" + "3. Instantiate the ActionMap\n\n" - "The following is an example of how to create a new ActionMap:\n" + "The following is an example of how to create a new ActionMap:\n" - "@tsexample\n" - "if ( isObject( moveMap ) )\n" - " moveMap.delete();\n" - "new ActionMap(moveMap);" - "@endtsexample\n\n\n" - - "@section ActionMap_binding Binding Functions\n" - "Once you have created an ActionMap, you can start binding functionality to events. Currently, Torque 3D supports the following devices out of the box\n\n" - "* Mouse\n\n" - "* Keyboard\n\n" - "* Joystick/Gamepad\n\n" - "* Xbox 360 Controller\n\n" + "@tsexample\n" + "if ( isObject( moveMap ) )\n" + " moveMap.delete();\n" + "new ActionMap(moveMap);" + "@endtsexample\n\n\n" + + "@section ActionMap_binding Binding Functions\n" + "Once you have created an ActionMap, you can start binding functionality to events. Currently, Torque 3D supports the following devices out of the box\n\n" + "* Mouse\n\n" + "* Keyboard\n\n" + "* Joystick/Gamepad\n\n" + "* Xbox 360 Controller\n\n" - "The two most commonly used binding methods are bind() and bindCmd(). Both are similar in that they will bind functionality to a device and event, " + "The two most commonly used binding methods are bind() and bindCmd(). Both are similar in that they will bind functionality to a device and event, " "but different in how the event is interpreted. With bind(), " - "you specify a device, action to bind, then a function to be called when the event happens.\n\n" + "you specify a device, action to bind, then a function to be called when the event happens.\n\n" - "@tsexample\n" - "// Simple function that prints to console\n" - "// %val - Sent by the device letting the user know\n" - "// if an input was pressed (true) or released (false)\n" - "function testInput(%val)\n" - "{\n" - " if(%val)\n" - " echo(\"Key is down\");\n" - " else\n" - " echo(\"Key was released\");\n" - "}\n\n" - "// Bind the \'K\' key to the testInput function\n" - "moveMap.bind(keyboard, \"k\", testInput);\n\n" - "@endtsexample\n\n\n" + "@tsexample\n" + "// Simple function that prints to console\n" + "// %val - Sent by the device letting the user know\n" + "// if an input was pressed (true) or released (false)\n" + "function testInput(%val)\n" + "{\n" + " if(%val)\n" + " echo(\"Key is down\");\n" + " else\n" + " echo(\"Key was released\");\n" + "}\n\n" + "// Bind the \'K\' key to the testInput function\n" + "moveMap.bind(keyboard, \"k\", testInput);\n\n" + "@endtsexample\n\n\n" - "bindCmd is an alternative method for binding commands. This function is similar to bind(), " + "bindCmd is an alternative method for binding commands. This function is similar to bind(), " "except two functions are set to be called when the event is processed.\n\n" - "One will be called when the event is activated (input down), while the other is activated when the event is broken (input release). " + "One will be called when the event is activated (input down), while the other is activated when the event is broken (input release). " "When using bindCmd(), pass the functions as strings rather than the function names.\n\n" - "@tsexample\n" - "// Print to the console when the spacebar is pressed\n" - "function onSpaceDown()\n" - "{\n" - " echo(\"Space bar down!\");\n" - "}\n\n" + "@tsexample\n" + "// Print to the console when the spacebar is pressed\n" + "function onSpaceDown()\n" + "{\n" + " echo(\"Space bar down!\");\n" + "}\n\n" - "// Print to the console when the spacebar is released\n" - "function onSpaceUp()\n" - "{\n" - " echo(\"Space bar up!\");\n" - "}\n\n" + "// Print to the console when the spacebar is released\n" + "function onSpaceUp()\n" + "{\n" + " echo(\"Space bar up!\");\n" + "}\n\n" - "// Bind the commands onSpaceDown and onSpaceUp to spacebar events\n" - "moveMap.bindCmd(keyboard, \"space\", \"onSpaceDown();\", \"onSpaceUp();\");\n" - "@endtsexample\n\n" - - "@section ActionMap_switching Switching ActionMaps\n" - "Let's say you want to have different ActionMaps activated based on game play situations. A classic example would be first person shooter controls and racing controls " - "in the same game. On foot, spacebar may cause your player to jump. In a vehicle, it may cause some kind of \"turbo charge\". You simply need to push/pop the ActionMaps appropriately:\n\n" + "// Bind the commands onSpaceDown and onSpaceUp to spacebar events\n" + "moveMap.bindCmd(keyboard, \"space\", \"onSpaceDown();\", \"onSpaceUp();\");\n" + "@endtsexample\n\n" + + "@section ActionMap_switching Switching ActionMaps\n" + "Let's say you want to have different ActionMaps activated based on game play situations. A classic example would be first person shooter controls and racing controls " + "in the same game. On foot, spacebar may cause your player to jump. In a vehicle, it may cause some kind of \"turbo charge\". You simply need to push/pop the ActionMaps appropriately:\n\n" - "First, create two separate ActionMaps:\n\n" - "@tsexample\n" - "// Create the two ActionMaps\n" - "if ( isObject( moveMap ) )\n" - " moveMap.delete();\n" - "new ActionMap(moveMap);\n\n" - "if ( isObject( carMap ) )\n" - " carMap.delete();\n" - "new ActionMap(carMap);\n\n" - "@endtsexample\n\n" + "First, create two separate ActionMaps:\n\n" + "@tsexample\n" + "// Create the two ActionMaps\n" + "if ( isObject( moveMap ) )\n" + " moveMap.delete();\n" + "new ActionMap(moveMap);\n\n" + "if ( isObject( carMap ) )\n" + " carMap.delete();\n" + "new ActionMap(carMap);\n\n" + "@endtsexample\n\n" - "Next, create the two separate functions. Both will be bound to spacebar, but not the same ActionMap:\n\n" - "@tsexample\n" - "// Print to the console the player is jumping\n" - "function playerJump(%val)\n" - "{\n" - " if(%val)\n" - " echo(\"Player jumping!\");\n" - "}\n\n" - "// Print to the console the vehicle is charging\n" - "function turboCharge()\n" - "{\n" - " if(%val)\n" - " echo(\"Vehicle turbo charging!\");\n" - "}\n" - "@endtsexample\n\n" - - "You are now ready to bind functions to your ActionMaps' devices:\n\n" + "Next, create the two separate functions. Both will be bound to spacebar, but not the same ActionMap:\n\n" + "@tsexample\n" + "// Print to the console the player is jumping\n" + "function playerJump(%val)\n" + "{\n" + " if(%val)\n" + " echo(\"Player jumping!\");\n" + "}\n\n" + "// Print to the console the vehicle is charging\n" + "function turboCharge()\n" + "{\n" + " if(%val)\n" + " echo(\"Vehicle turbo charging!\");\n" + "}\n" + "@endtsexample\n\n" + + "You are now ready to bind functions to your ActionMaps' devices:\n\n" - "@tsexample\n" - "// Bind the spacebar to the playerJump function\n" - "// when moveMap is the active ActionMap\n" - "moveMap.bind(keyboard, \"space\", playerJump);\n\n" - "// Bind the spacebar to the turboCharge function\n" - "// when carMap is the active ActionMap\n" - "carMap.bind(keyboard, \"space\", turboCharge);\n" - "@endtsexample\n" + "@tsexample\n" + "// Bind the spacebar to the playerJump function\n" + "// when moveMap is the active ActionMap\n" + "moveMap.bind(keyboard, \"space\", playerJump);\n\n" + "// Bind the spacebar to the turboCharge function\n" + "// when carMap is the active ActionMap\n" + "carMap.bind(keyboard, \"space\", turboCharge);\n" + "@endtsexample\n" - "Finally, you can use the push() and pop() commands on each ActionMap to toggle activation. To activate an ActionMap, use push():\n\n" + "Finally, you can use the push() and pop() commands on each ActionMap to toggle activation. To activate an ActionMap, use push():\n\n" - "@tsexample\n" - "// Make moveMap the active action map\n" - "// You should now be able to activate playerJump with spacebar\n" - "moveMap.push();\n" - "@endtsexample\n\n" + "@tsexample\n" + "// Make moveMap the active action map\n" + "// You should now be able to activate playerJump with spacebar\n" + "moveMap.push();\n" + "@endtsexample\n\n" - "To switch ActionMaps, first pop() the old one. Then you can push() the new one:\n\n" + "To switch ActionMaps, first pop() the old one. Then you can push() the new one:\n\n" - "@tsexample\n" - "// Deactivate moveMap\n" - "moveMap.pop();\n\n" - "// Activate carMap\n" - "carMap.push();\n\n" - "@endtsexample\n\n\n" + "@tsexample\n" + "// Deactivate moveMap\n" + "moveMap.pop();\n\n" + "// Activate carMap\n" + "carMap.push();\n\n" + "@endtsexample\n\n\n" - "@ingroup Input" - + "@ingroup Input" + ); // This is used for determing keys that have ascii codes for the foreign keyboards. IsAlpha doesn't work on foreign keys. @@ -775,32 +775,32 @@ const char* ActionMap::getBinding( const char* command ) // const char* ActionMap::getCommand( const char* device, const char* action ) { - U32 deviceType; - U32 deviceInst; - if ( getDeviceTypeAndInstance( device, deviceType, deviceInst ) ) - { - EventDescriptor eventDescriptor; - if ( createEventDescriptor( action, &eventDescriptor ) ) - { - const ActionMap::Node* mapNode = findNode( deviceType, deviceInst, eventDescriptor.flags, eventDescriptor.eventCode ); - if ( mapNode ) - { - if ( mapNode->flags & Node::BindCmd ) - { - S32 bufferLen = dStrlen( mapNode->makeConsoleCommand ) + dStrlen( mapNode->breakConsoleCommand ) + 2; - char* returnString = Con::getReturnBuffer( bufferLen ); - dSprintf( returnString, bufferLen, "%s\t%s", - ( mapNode->makeConsoleCommand ? mapNode->makeConsoleCommand : "" ), - ( mapNode->breakConsoleCommand ? mapNode->breakConsoleCommand : "" ) ); - return( returnString ); - } - else - return( mapNode->consoleFunction ); - } - } - } + U32 deviceType; + U32 deviceInst; + if ( getDeviceTypeAndInstance( device, deviceType, deviceInst ) ) + { + EventDescriptor eventDescriptor; + if ( createEventDescriptor( action, &eventDescriptor ) ) + { + const ActionMap::Node* mapNode = findNode( deviceType, deviceInst, eventDescriptor.flags, eventDescriptor.eventCode ); + if ( mapNode ) + { + if ( mapNode->flags & Node::BindCmd ) + { + S32 bufferLen = dStrlen( mapNode->makeConsoleCommand ) + dStrlen( mapNode->breakConsoleCommand ) + 2; + char* returnString = Con::getReturnBuffer( bufferLen ); + dSprintf( returnString, bufferLen, "%s\t%s", + ( mapNode->makeConsoleCommand ? mapNode->makeConsoleCommand : "" ), + ( mapNode->breakConsoleCommand ? mapNode->breakConsoleCommand : "" ) ); + return( returnString ); + } + else + return( mapNode->consoleFunction ); + } + } + } - return( "" ); + return( "" ); } //------------------------------------------------------------------------------ @@ -808,92 +808,92 @@ const char* ActionMap::getCommand( const char* device, const char* action ) // Obviously, this should only be used for axes. bool ActionMap::isInverted( const char* device, const char* action ) { - U32 deviceType; - U32 deviceInst; - if ( getDeviceTypeAndInstance( device, deviceType, deviceInst ) ) - { - EventDescriptor eventDescriptor; - if ( createEventDescriptor( action, &eventDescriptor ) ) - { - const ActionMap::Node* mapNode = findNode( deviceType, deviceInst, eventDescriptor.flags, eventDescriptor.eventCode ); - if ( mapNode ) - return( mapNode->flags & Node::Inverted ); - } - } + U32 deviceType; + U32 deviceInst; + if ( getDeviceTypeAndInstance( device, deviceType, deviceInst ) ) + { + EventDescriptor eventDescriptor; + if ( createEventDescriptor( action, &eventDescriptor ) ) + { + const ActionMap::Node* mapNode = findNode( deviceType, deviceInst, eventDescriptor.flags, eventDescriptor.eventCode ); + if ( mapNode ) + return( mapNode->flags & Node::Inverted ); + } + } - Con::errorf( "The input event specified by %s %s is not in this action map!", device, action ); - return( false ); + Con::errorf( "The input event specified by %s %s is not in this action map!", device, action ); + return( false ); } //------------------------------------------------------------------------------ F32 ActionMap::getScale( const char* device, const char* action ) { - U32 deviceType; - U32 deviceInst; - if ( getDeviceTypeAndInstance( device, deviceType, deviceInst ) ) - { - EventDescriptor eventDescriptor; - if ( createEventDescriptor( action, &eventDescriptor ) ) - { - const ActionMap::Node* mapNode = findNode( deviceType, deviceInst, eventDescriptor.flags, eventDescriptor.eventCode ); - if ( mapNode ) - { - if ( mapNode->flags & Node::HasScale ) - return( mapNode->scaleFactor ); + U32 deviceType; + U32 deviceInst; + if ( getDeviceTypeAndInstance( device, deviceType, deviceInst ) ) + { + EventDescriptor eventDescriptor; + if ( createEventDescriptor( action, &eventDescriptor ) ) + { + const ActionMap::Node* mapNode = findNode( deviceType, deviceInst, eventDescriptor.flags, eventDescriptor.eventCode ); + if ( mapNode ) + { + if ( mapNode->flags & Node::HasScale ) + return( mapNode->scaleFactor ); else return( 1.0f ); } - } - } + } + } - Con::errorf( "The input event specified by %s %s is not in this action map!", device, action ); - return( 1.0f ); + Con::errorf( "The input event specified by %s %s is not in this action map!", device, action ); + return( 1.0f ); } //------------------------------------------------------------------------------ const char* ActionMap::getDeadZone( const char* device, const char* action ) { - U32 deviceType; - U32 deviceInst; - if ( getDeviceTypeAndInstance( device, deviceType, deviceInst ) ) - { - EventDescriptor eventDescriptor; - if ( createEventDescriptor( action, &eventDescriptor ) ) - { - const ActionMap::Node* mapNode = findNode( deviceType, deviceInst, eventDescriptor.flags, eventDescriptor.eventCode ); - if ( mapNode ) - { - if ( mapNode->flags & Node::HasDeadZone ) + U32 deviceType; + U32 deviceInst; + if ( getDeviceTypeAndInstance( device, deviceType, deviceInst ) ) + { + EventDescriptor eventDescriptor; + if ( createEventDescriptor( action, &eventDescriptor ) ) + { + const ActionMap::Node* mapNode = findNode( deviceType, deviceInst, eventDescriptor.flags, eventDescriptor.eventCode ); + if ( mapNode ) + { + if ( mapNode->flags & Node::HasDeadZone ) { - char buf[64]; - dSprintf( buf, sizeof( buf ), "%g %g", mapNode->deadZoneBegin, mapNode->deadZoneEnd ); - char* returnString = Con::getReturnBuffer( dStrlen( buf ) + 1 ); - dStrcpy( returnString, buf ); - return( returnString ); - } - else - return( "0 0" ); - } - } - } + char buf[64]; + dSprintf( buf, sizeof( buf ), "%g %g", mapNode->deadZoneBegin, mapNode->deadZoneEnd ); + char* returnString = Con::getReturnBuffer( dStrlen( buf ) + 1 ); + dStrcpy( returnString, buf ); + return( returnString ); + } + else + return( "0 0" ); + } + } + } - Con::errorf( "The input event specified by %s %s is not in this action map!", device, action ); - return( "" ); + Con::errorf( "The input event specified by %s %s is not in this action map!", device, action ); + return( "" ); } //------------------------------------------------------------------------------ const char* ActionMap::buildActionString( const InputEventInfo* event ) { - const char* modifierString = getModifierString( event->modifier ); + const char* modifierString = getModifierString( event->modifier ); - char objectBuffer[64]; - if ( !getKeyString( event->objInst, objectBuffer ) ) - return( "" ); + char objectBuffer[64]; + if ( !getKeyString( event->objInst, objectBuffer ) ) + return( "" ); - U32 returnLen = dStrlen( modifierString ) + dStrlen( objectBuffer ) + 2; - char* returnString = Con::getReturnBuffer( returnLen ); - dSprintf( returnString, returnLen - 1, "%s%s", modifierString, objectBuffer ); - return( returnString ); + U32 returnLen = dStrlen( modifierString ) + dStrlen( objectBuffer ) + 2; + char* returnString = Con::getReturnBuffer( returnLen ); + dSprintf( returnString, returnLen - 1, "%s%s", modifierString, objectBuffer ); + return( returnString ); } //------------------------------------------------------------------------------ @@ -989,15 +989,15 @@ bool ActionMap::getDeviceName(const U32 deviceType, const U32 deviceInstance, ch //------------------------------------------------------------------------------ const char* ActionMap::getModifierString(const U32 modifiers) { - U32 realModifiers = modifiers; - if ( modifiers & SI_LSHIFT || modifiers & SI_RSHIFT ) - realModifiers |= SI_SHIFT; - if ( modifiers & SI_LCTRL || modifiers & SI_RCTRL ) - realModifiers |= SI_CTRL; - if ( modifiers & SI_LALT || modifiers & SI_RALT ) - realModifiers |= SI_ALT; - if ( modifiers & SI_MAC_LOPT || modifiers & SI_MAC_ROPT ) - realModifiers |= SI_MAC_OPT; + U32 realModifiers = modifiers; + if ( modifiers & SI_LSHIFT || modifiers & SI_RSHIFT ) + realModifiers |= SI_SHIFT; + if ( modifiers & SI_LCTRL || modifiers & SI_RCTRL ) + realModifiers |= SI_CTRL; + if ( modifiers & SI_LALT || modifiers & SI_RALT ) + realModifiers |= SI_ALT; + if ( modifiers & SI_MAC_LOPT || modifiers & SI_MAC_ROPT ) + realModifiers |= SI_MAC_OPT; switch (realModifiers & (SI_SHIFT|SI_CTRL|SI_ALT|SI_MAC_OPT)) { @@ -1820,19 +1820,19 @@ static ConsoleDocFragment _ActionMapbind1( "@param command The function to bind to the action. Function must have a single boolean argument.\n" "@return True if the binding was successful, false if the device was unknown or description failed.\n\n" "@tsexample\n" - "// Simple function that prints to console\n" - "// %val - Sent by the device letting the user know\n" - "// if an input was pressed (true) or released (false)\n" - "function testInput(%val)\n" - "{\n" - " if(%val)\n" - " echo(\"Key is down\");\n" - " else\n" - " echo(\"Key was released\");\n" - "}\n\n" - "// Bind the \'K\' key to the testInput function\n" - "moveMap.bind(keyboard, k, testInput);\n\n" - "@endtsexample\n\n\n", + "// Simple function that prints to console\n" + "// %val - Sent by the device letting the user know\n" + "// if an input was pressed (true) or released (false)\n" + "function testInput(%val)\n" + "{\n" + " if(%val)\n" + " echo(\"Key is down\");\n" + " else\n" + " echo(\"Key was released\");\n" + "}\n\n" + "// Bind the \'K\' key to the testInput function\n" + "moveMap.bind(keyboard, k, testInput);\n\n" + "@endtsexample\n\n\n", "ActionMap", "bool bind( string device, string action, string command );"); @@ -1854,22 +1854,22 @@ static ConsoleDocFragment _ActionMapbind2( "@param command The function bound to the action. Must take in a single argument.\n" "@return True if the binding was successful, false if the device was unknown or description failed.\n\n" "@tsexample\n" - "// Simple function that adjusts the pitch of the camera based on the " + "// Simple function that adjusts the pitch of the camera based on the " "mouse's movement along the X axis.\n" - "function testPitch(%val)\n" - "{\n" - " %pitchAdj = getMouseAdjustAmount(%val);\n" - " $mvPitch += %pitchAdj;\n" - "}\n\n" - "// Bind the mouse's X axis to the testPitch function\n" - "// DI is flagged, meaning input is inverted and has a deadzone\n" - "%this.bind( mouse, \"xaxis\", \"DI\", \"-0.23 0.23\", testPitch );\n" - "@endtsexample\n\n\n", + "function testPitch(%val)\n" + "{\n" + " %pitchAdj = getMouseAdjustAmount(%val);\n" + " $mvPitch += %pitchAdj;\n" + "}\n\n" + "// Bind the mouse's X axis to the testPitch function\n" + "// DI is flagged, meaning input is inverted and has a deadzone\n" + "%this.bind( mouse, \"xaxis\", \"DI\", \"-0.23 0.23\", testPitch );\n" + "@endtsexample\n\n\n", "ActionMap", "bool bind( string device, string action, string flag, string deadZone, string scale, string command );"); ConsoleMethod( ActionMap, bind, bool, 5, 10, "actionMap.bind( device, action, [modifier spec, mod...], command )" - "@hide") + "@hide") { StringStackWrapper args(argc - 2, argv + 2); return object->processBind( args.count(), args, NULL ); @@ -1918,7 +1918,7 @@ static ConsoleDocFragment _ActionMapbindObj2( "bool bindObj( string device, string action, string flag, string deadZone, string scale, string command, SimObjectID object );"); ConsoleMethod( ActionMap, bindObj, bool, 6, 11, "(device, action, [modifier spec, mod...], command, object)" - "@hide") + "@hide") { SimObject* simObject = Sim::findObject(argv[argc - 1]); if ( simObject == NULL ) @@ -1941,20 +1941,20 @@ DefineEngineMethod( ActionMap, bindCmd, bool, ( const char* device, const char* "@param makeCmd The command to execute when the device/action is made.\n" "@param breakCmd [optional] The command to execute when the device or action is unmade.\n" "@return True the bind was successful, false if the device was unknown or description failed.\n" - "@tsexample\n" - "// Print to the console when the spacebar is pressed\n" - "function onSpaceDown()\n" - "{\n" - " echo(\"Space bar down!\");\n" - "}\n\n" - "// Print to the console when the spacebar is released\n" - "function onSpaceUp()\n" - "{\n" - " echo(\"Space bar up!\");\n" - "}\n\n" + "@tsexample\n" + "// Print to the console when the spacebar is pressed\n" + "function onSpaceDown()\n" + "{\n" + " echo(\"Space bar down!\");\n" + "}\n\n" + "// Print to the console when the spacebar is released\n" + "function onSpaceUp()\n" + "{\n" + " echo(\"Space bar up!\");\n" + "}\n\n" "// Bind the commands onSpaceDown() and onSpaceUp() to spacebar events\n\n" - "moveMap.bindCmd(keyboard, \"space\", \"onSpaceDown();\", \"onSpaceUp();\");\n" - "@endtsexample\n\n") + "moveMap.bindCmd(keyboard, \"space\", \"onSpaceDown();\", \"onSpaceUp();\");\n" + "@endtsexample\n\n") { return object->processBindCmd( device, action, makeCmd, breakCmd ); } @@ -1964,9 +1964,9 @@ DefineEngineMethod( ActionMap, unbind, bool, ( const char* device, const char* a "@param device The device to unbind from. Can be a keyboard, mouse, joystick or a gamepad.\n" "@param action The device action to unbind from. The action is dependant upon the device. Specify a key for keyboards.\n" "@return True if the unbind was successful, false if the device was unknown or description failed.\n\n" - "@tsexample\n" - "moveMap.unbind(\"keyboard\", \"space\");\n" - "@endtsexample\n\n") + "@tsexample\n" + "moveMap.unbind(\"keyboard\", \"space\");\n" + "@endtsexample\n\n") { return object->processUnbind( device, action ); } @@ -1977,7 +1977,7 @@ DefineEngineMethod( ActionMap, unbindObj, bool, ( const char* device, const char "@param action The device action to unbind from. The action is dependant upon the device. Specify a key for keyboards.\n" "@param obj The object to perform unbind against.\n" "@return True if the unbind was successful, false if the device was unknown or description failed.\n" - "@tsexample\n" + "@tsexample\n" "moveMap.unbindObj(\"keyboard\", \"numpad1\", \"rangeChange\", %player);" "@endtsexample\n\n\n") { @@ -1996,10 +1996,10 @@ DefineEngineMethod( ActionMap, save, void, ( const char* fileName, bool append ) "@param fileName The file path to save the ActionMap to. If a filename is not specified " " the ActionMap will be dumped to the console.\n" "@param append Whether to write the ActionMap at the end of the file or overwrite it.\n" - "@tsexample\n" - "// Write out the actionmap into the config.cs file\n" + "@tsexample\n" + "// Write out the actionmap into the config.cs file\n" "moveMap.save( \"scripts/client/config.cs\" );" - "@endtsexample\n\n") + "@endtsexample\n\n") { char buffer[1024]; @@ -2015,7 +2015,7 @@ DefineEngineMethod( ActionMap, save, void, ( const char* fileName, bool append ) DefineEngineFunction( getCurrentActionMap, ActionMap*, (),, "@brief Returns the current %ActionMap.\n" "@see ActionMap" - "@ingroup Input") + "@ingroup Input") { SimSet* pActionMapSet = Sim::getActiveActionMapSet(); return dynamic_cast< ActionMap* >( pActionMapSet->last() ); @@ -2024,10 +2024,10 @@ DefineEngineFunction( getCurrentActionMap, ActionMap*, (),, DefineEngineMethod( ActionMap, push, void, (),, "@brief Push the ActionMap onto the %ActionMap stack.\n\n" "Activates an ActionMap and placees it at the top of the ActionMap stack.\n\n" - "@tsexample\n" - "// Make moveMap the active action map\n" - "moveMap.push();\n" - "@endtsexample\n\n" + "@tsexample\n" + "// Make moveMap the active action map\n" + "moveMap.push();\n" + "@endtsexample\n\n" "@see ActionMap") { SimSet* pActionMapSet = Sim::getActiveActionMapSet(); @@ -2037,10 +2037,10 @@ DefineEngineMethod( ActionMap, push, void, (),, DefineEngineMethod( ActionMap, pop, void, (),, "@brief Pop the ActionMap off the %ActionMap stack.\n\n" "Deactivates an %ActionMap and removes it from the @ActionMap stack.\n" - "@tsexample\n" - "// Deactivate moveMap\n" - "moveMap.pop();\n" - "@endtsexample\n\n" + "@tsexample\n" + "// Deactivate moveMap\n" + "moveMap.pop();\n" + "@endtsexample\n\n" "@see ActionMap") { SimSet* pActionMapSet = Sim::getActiveActionMapSet(); @@ -2053,20 +2053,20 @@ DefineEngineMethod( ActionMap, getBinding, const char*, ( const char* command ), "@param command The function to search bindings for.\n" "@return The binding against the specified command. Returns an empty string(\"\") " "if a binding wasn't found.\n" - "@tsexample\n" - "// Find what the function \"jump()\" is bound to in moveMap\n" - "%bind = moveMap.getBinding( \"jump\" );\n\n" - "if ( %bind !$= \"\" )\n" - "{\n" - "// Find out what device is used in the binding\n" - " %device = getField( %bind, 0 );\n\n" - "// Find out what action (such as a key) is used in the binding\n" - " %action = getField( %bind, 1 );\n" - "}\n" - "@endtsexample\n\n" + "@tsexample\n" + "// Find what the function \"jump()\" is bound to in moveMap\n" + "%bind = moveMap.getBinding( \"jump\" );\n\n" + "if ( %bind !$= \"\" )\n" + "{\n" + "// Find out what device is used in the binding\n" + " %device = getField( %bind, 0 );\n\n" + "// Find out what action (such as a key) is used in the binding\n" + " %action = getField( %bind, 1 );\n" + "}\n" + "@endtsexample\n\n" "@see getField") { - return object->getBinding( command ); + return object->getBinding( command ); } DefineEngineMethod( ActionMap, getCommand, const char*, ( const char* device, const char* action ),, @@ -2074,15 +2074,15 @@ DefineEngineMethod( ActionMap, getCommand, const char*, ( const char* device, co "@param device The device that was bound. Can be a keyboard, mouse, joystick or a gamepad.\n" "@param action The device action that was bound. The action is dependant upon the device. Specify a key for keyboards.\n" "@return The command against the specified device and action.\n" - "@tsexample\n" - "// Find what function is bound to a device\'s action\n" - "// In this example, \"jump()\" was assigned to the space key in another script\n" - "%command = moveMap.getCommand(\"keyboard\", \"space\");\n\n" - "// Should print \"jump\" in the console\n" - "echo(%command)\n" - "@endtsexample\n\n") + "@tsexample\n" + "// Find what function is bound to a device\'s action\n" + "// In this example, \"jump()\" was assigned to the space key in another script\n" + "%command = moveMap.getCommand(\"keyboard\", \"space\");\n\n" + "// Should print \"jump\" in the console\n" + "echo(%command)\n" + "@endtsexample\n\n") { - return object->getCommand( device, action ); + return object->getCommand( device, action ); } DefineEngineMethod( ActionMap, isInverted, bool, ( const char* device, const char* action ),, @@ -2091,12 +2091,12 @@ DefineEngineMethod( ActionMap, isInverted, bool, ( const char* device, const cha "@param device The device that was bound. Can be a keyboard, mouse, joystick or a gamepad.\n" "@param action The device action that was bound. The action is dependant upon the device. Specify a key for keyboards.\n" "@return True if the specified device and action is inverted.\n" - "@tsexample\n" + "@tsexample\n" "%if ( moveMap.isInverted( \"mouse\", \"xaxis\"))\n" " echo(\"Mouse's xAxis is inverted\");" - "@endtsexample\n\n") + "@endtsexample\n\n") { - return object->isInverted( device, action ); + return object->isInverted( device, action ); } DefineEngineMethod( ActionMap, getScale, F32, ( const char* device, const char* action ),, @@ -2104,11 +2104,11 @@ DefineEngineMethod( ActionMap, getScale, F32, ( const char* device, const char* "@param device The device that was bound. Can be keyboard, mouse, joystick or gamepad.\n" "@param action The device action that was bound. The action is dependant upon the device. Specify a key for keyboards.\n" "@return Any scaling applied to the specified device and action.\n" - "@tsexample\n" - "%scale = %moveMap.getScale( \"gamepad\", \"thumbrx\");\n" - "@endtsexample\n\n") + "@tsexample\n" + "%scale = %moveMap.getScale( \"gamepad\", \"thumbrx\");\n" + "@endtsexample\n\n") { - return object->getScale( device, action ); + return object->getScale( device, action ); } DefineEngineMethod( ActionMap, getDeadZone, const char*, ( const char* device, const char* action ),, @@ -2117,11 +2117,11 @@ DefineEngineMethod( ActionMap, getDeadZone, const char*, ( const char* device, c "@param action The device action that was bound. The action is dependant upon the device. Specify a key for keyboards.\n" "@return The dead zone for the specified device and action. Returns \"0 0\" if there is no dead zone " "or an empty string(\"\") if the mapping was not found.\n" - "@tsexample\n" - "%deadZone = moveMap.getDeadZone( \"gamepad\", \"thumbrx\");\n" - "@endtsexample\n\n") + "@tsexample\n" + "%deadZone = moveMap.getDeadZone( \"gamepad\", \"thumbrx\");\n" + "@endtsexample\n\n") { - return object->getDeadZone( device, action ); + return object->getDeadZone( device, action ); } //------------------------------------------------------------------------------ From 27e2871b01fb9fee68c3bdd3c67fa90490d2615b Mon Sep 17 00:00:00 2001 From: "Thomas \"elfprince13\" Dickerson" Date: Wed, 11 Jan 2017 23:21:29 -0500 Subject: [PATCH 05/26] Replaced StringTable->insert("") with StringTable->EmptyString() --- Engine/source/T3D/fx/fxFoliageReplicator.h | 48 ++-- Engine/source/T3D/fx/fxShapeReplicator.h | 2 +- Engine/source/T3D/fx/precipitation.cpp | 8 +- Engine/source/T3D/fx/ribbon.cpp | 6 +- Engine/source/T3D/missionMarker.cpp | 14 +- Engine/source/T3D/player.cpp | 46 ++-- Engine/source/T3D/shapeBase.cpp | 214 +++++++++--------- Engine/source/console/SimXMLDocument.cpp | 172 +++++++------- Engine/source/console/astAlloc.cpp | 2 +- Engine/source/console/codeBlock.cpp | 10 +- Engine/source/console/fieldBrushObject.cpp | 4 +- Engine/source/console/persistenceManager.cpp | 2 +- .../source/gui/buttons/guiIconButtonCtrl.cpp | 4 +- .../gui/buttons/guiToggleButtonCtrl.cpp | 2 +- .../gui/buttons/guiToolboxButtonCtrl.cpp | 4 +- Engine/source/gui/containers/guiFormCtrl.cpp | 6 +- Engine/source/gui/containers/guiPaneCtrl.cpp | 2 +- .../source/gui/containers/guiWindowCtrl.cpp | 2 +- .../gui/controls/guiGameListMenuCtrl.cpp | 4 +- Engine/source/gui/controls/guiListBoxCtrl.cpp | 4 +- Engine/source/gui/controls/guiMLTextCtrl.cpp | 4 +- Engine/source/gui/controls/guiPopUpCtrl.cpp | 2 +- Engine/source/gui/controls/guiPopUpCtrlEx.cpp | 2 +- Engine/source/gui/controls/guiTextCtrl.cpp | 4 +- .../source/gui/controls/guiTextEditCtrl.cpp | 2 +- .../source/gui/controls/guiTreeViewCtrl.cpp | 6 +- .../gui/editor/guiParticleGraphCtrl.cpp | 2 +- .../source/gui/game/guiChunkedBitmapCtrl.cpp | 2 +- Engine/source/gui/worldEditor/undoActions.cpp | 10 +- Engine/source/navigation/navMesh.cpp | 4 +- Engine/source/navigation/navPath.cpp | 4 +- Engine/source/platform/menus/popupMenu.cpp | 2 +- .../platform/nativeDialogs/fileDialog.cpp | 8 +- 33 files changed, 304 insertions(+), 304 deletions(-) diff --git a/Engine/source/T3D/fx/fxFoliageReplicator.h b/Engine/source/T3D/fx/fxFoliageReplicator.h index e40554454..c9f8a0804 100644 --- a/Engine/source/T3D/fx/fxFoliageReplicator.h +++ b/Engine/source/T3D/fx/fxFoliageReplicator.h @@ -64,16 +64,16 @@ class fxFoliageItem { public: - MatrixF Transform; - F32 Width; - F32 Height; - Box3F FoliageBox; - bool Flipped; + MatrixF Transform; + F32 Width; + F32 Height; + Box3F FoliageBox; + bool Flipped; F32 SwayPhase; F32 SwayTimeRatio; - F32 LightPhase; + F32 LightPhase; F32 LightTimeRatio; - U32 LastFrameSerialID; + U32 LastFrameSerialID; }; //------------------------------------------------------------------------------ @@ -104,9 +104,9 @@ public: Box3F QuadrantBox; fxFoliageQuadrantNode* QuadrantChildNode[4]; Vector RenderList; - // Used in DrawIndexPrimitive call. - U32 startIndex; - U32 primitiveCount; + // Used in DrawIndexPrimitive call. + U32 startIndex; + U32 primitiveCount; }; @@ -152,7 +152,7 @@ protected: void CreateFoliage(void); void DestroyFoliage(void); - void DestroyFoliageItems(); + void DestroyFoliageItems(); void SyncFoliageReplicators(void); @@ -172,11 +172,11 @@ protected: Vector mReplicatedFoliage; fxFoliageRenderList mFrustumRenderSet; - GFXVertexBufferHandle mVertexBuffer; - GFXPrimitiveBufferHandle mPrimBuffer; + GFXVertexBufferHandle mVertexBuffer; + GFXPrimitiveBufferHandle mPrimBuffer; GFXShaderRef mShader; ShaderData* mShaderData; - GBitmap* mAlphaLookup; + GBitmap* mAlphaLookup; MRandomLCG RandomGen; F32 mFadeInGradient; @@ -193,8 +193,8 @@ protected: U32 mNextAllocatedNodeIdx; // Next Allocated Node Index. U32 mBillboardsAcquired; // Billboards Acquired. - // Used for alpha lookup in the pixel shader - GFXTexHandle mAlphaTexture; + // Used for alpha lookup in the pixel shader + GFXTexHandle mAlphaTexture; GFXStateBlockRef mPlacementSB; GFXStateBlockRef mRenderSB; @@ -223,15 +223,15 @@ protected: bool mDirty; - + void SetupShader(); - void SetupBuffers(); + void SetupBuffers(); void renderObject(ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance*); - void renderBuffers(SceneRenderState* state); - void renderArc(const F32 fRadiusX, const F32 fRadiusY); - void renderPlacementArea(const F32 ElapsedTime); - void renderQuad(fxFoliageQuadrantNode* quadNode, const MatrixF& RenderTransform, const bool UseDebug); - void computeAlphaTex(); + void renderBuffers(SceneRenderState* state); + void renderArc(const F32 fRadiusX, const F32 fRadiusY); + void renderPlacementArea(const F32 ElapsedTime); + void renderQuad(fxFoliageQuadrantNode* quadNode, const MatrixF& RenderTransform, const bool UseDebug); + void computeAlphaTex(); public: fxFoliageReplicator(); ~fxFoliageReplicator(); @@ -325,7 +325,7 @@ public: mUseDebugInfo = false; mDebugBoxHeight = 1.0f; mSeed = 1376312589; - mFoliageFile = StringTable->insert(""); + mFoliageFile = StringTable->EmptyString(); mFoliageTexture = GFXTexHandle(); mFoliageCount = 10; mFoliageRetries = 100; diff --git a/Engine/source/T3D/fx/fxShapeReplicator.h b/Engine/source/T3D/fx/fxShapeReplicator.h index 8cd9efa4e..e83f0e113 100644 --- a/Engine/source/T3D/fx/fxShapeReplicator.h +++ b/Engine/source/T3D/fx/fxShapeReplicator.h @@ -153,7 +153,7 @@ public: { // Set Defaults. mSeed = 1376312589; - mShapeFile = StringTable->insert(""); + mShapeFile = StringTable->EmptyString(); mShapeCount = 10; mShapeRetries = 100; mInnerRadiusX = 0; diff --git a/Engine/source/T3D/fx/precipitation.cpp b/Engine/source/T3D/fx/precipitation.cpp index 19855e26f..232e8ca72 100644 --- a/Engine/source/T3D/fx/precipitation.cpp +++ b/Engine/source/T3D/fx/precipitation.cpp @@ -129,10 +129,10 @@ PrecipitationData::PrecipitationData() { soundProfile = NULL; - mDropName = StringTable->insert(""); - mDropShaderName = StringTable->insert(""); - mSplashName = StringTable->insert(""); - mSplashShaderName = StringTable->insert(""); + mDropName = StringTable->EmptyString(); + mDropShaderName = StringTable->EmptyString(); + mSplashName = StringTable->EmptyString(); + mSplashShaderName = StringTable->EmptyString(); mDropsPerSide = 4; mSplashesPerSide = 2; diff --git a/Engine/source/T3D/fx/ribbon.cpp b/Engine/source/T3D/fx/ribbon.cpp index 6ebcfc932..ef5276857 100644 --- a/Engine/source/T3D/fx/ribbon.cpp +++ b/Engine/source/T3D/fx/ribbon.cpp @@ -57,7 +57,7 @@ RibbonData::RibbonData() mUseFadeOut = false; mFadeAwayStep = 0.032f; segmentsPerUpdate = 1; - mMatName = StringTable->insert(""); + mMatName = StringTable->EmptyString(); mTileScale = 1.0f; mFixedTexcoords = false; mSegmentSkipAmount = 0; @@ -318,7 +318,7 @@ void Ribbon::processTick(const Move* move) safeDeleteObject(); return; //} - //mSegmentPoints.pop_back(); + //mSegmentPoints.pop_back(); } @@ -456,7 +456,7 @@ void Ribbon::setShaderParams() { F32 length = (F32)mDataBlock->mRibbonLength; Point3F radius(numSegments / length, numSegments, length); MaterialParameters* matParams = mRibbonMat->getMaterialParameters(); - matParams->setSafe( mRadiusSC, radius ); + matParams->setSafe( mRadiusSC, radius ); } //-------------------------------------------------------------------------- diff --git a/Engine/source/T3D/missionMarker.cpp b/Engine/source/T3D/missionMarker.cpp index 3a043b095..1480e2f1f 100644 --- a/Engine/source/T3D/missionMarker.cpp +++ b/Engine/source/T3D/missionMarker.cpp @@ -225,7 +225,7 @@ ConsoleDocClass( WayPoint, WayPoint::WayPoint() { - mName = StringTable->insert(""); + mName = StringTable->EmptyString(); } void WayPoint::setHidden(bool hidden) @@ -256,7 +256,7 @@ void WayPoint::inspectPostApply() { Parent::inspectPostApply(); if(!mName || !mName[0]) - mName = StringTable->insert(""); + mName = StringTable->EmptyString(); setMaskBits(UpdateNameMask|UpdateTeamMask); } @@ -281,7 +281,7 @@ void WayPoint::unpackUpdate(NetConnection * con, BitStream * stream) void WayPoint::initPersistFields() { - addGroup("Misc"); + addGroup("Misc"); addField("markerName", TypeCaseString, Offset(mName, WayPoint), "Unique name representing this waypoint"); endGroup("Misc"); Parent::initPersistFields(); @@ -363,7 +363,7 @@ bool SpawnSphere::onAdd() if (!isGhost()) { - onAdd_callback( getId()); + onAdd_callback( getId()); if (mAutoSpawn) spawnObject(); @@ -527,7 +527,7 @@ ConsoleDocClass( CameraBookmark, CameraBookmark::CameraBookmark() { - mName = StringTable->insert(""); + mName = StringTable->EmptyString(); } bool CameraBookmark::onAdd() @@ -571,7 +571,7 @@ void CameraBookmark::inspectPostApply() { Parent::inspectPostApply(); if(!mName || !mName[0]) - mName = StringTable->insert(""); + mName = StringTable->EmptyString(); setMaskBits(UpdateNameMask); if( isMethod("onInspectPostApply") ) @@ -595,7 +595,7 @@ void CameraBookmark::unpackUpdate(NetConnection * con, BitStream * stream) void CameraBookmark::initPersistFields() { - //addGroup("Misc"); + //addGroup("Misc"); //addField("name", TypeCaseString, Offset(mName, CameraBookmark)); //endGroup("Misc"); diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 93cd4f722..916a64c39 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -257,15 +257,15 @@ PlayerData::PlayerData() firstPersonShadows = false; // Used for third person image rendering - imageAnimPrefix = StringTable->insert(""); + imageAnimPrefix = StringTable->EmptyString(); allowImageStateAnimation = false; // Used for first person image rendering - imageAnimPrefixFP = StringTable->insert(""); + imageAnimPrefixFP = StringTable->EmptyString(); for (U32 i=0; iinsert(""); + shapeNameFP[i] = StringTable->EmptyString(); mCRCFP[i] = 0; mValidShapeFP[i] = false; } @@ -418,7 +418,7 @@ PlayerData::PlayerData() jumpTowardsNormal = true; - physicsPlayerType = StringTable->insert(""); + physicsPlayerType = StringTable->EmptyString(); dMemset( actionList, 0, sizeof(actionList) ); } @@ -6652,7 +6652,7 @@ DefineEngineMethod( Player, setActionThread, bool, ( const char* name, bool hold "@tsexample\n" "// Place the player in a sitting position after being mounted\n" "%player.setActionThread( \"sitting\", true, true );\n" - "@endtsexample\n") + "@endtsexample\n") { return object->setActionThread( name, hold, true, fsp); } @@ -6700,11 +6700,11 @@ DefineEngineMethod( Player, clearControlObject, void, (),, "Returns control to the player. This internally calls " "Player::setControlObject(0).\n" "@tsexample\n" - "%player.clearControlObject();\n" + "%player.clearControlObject();\n" "echo(%player.getControlObject()); //<-- Returns 0, player assumes control\n" "%player.setControlObject(%vehicle);\n" "echo(%player.getControlObject()); //<-- Returns %vehicle, player controls the vehicle now.\n" - "@endtsexample\n" + "@endtsexample\n" "@note If the player does not have a control object, the player will receive all moves " "from its GameConnection. If you're looking to remove control from the player itself " "(i.e. stop sending moves to the player) use GameConnection::setControlObject() to transfer " @@ -6762,63 +6762,63 @@ void Player::consoleInit() "@brief Determines if the player is rendered or not.\n\n" "Used on the client side to disable the rendering of all Player objects. This is " "mainly for the tools or debugging.\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::renderMyItems",TypeBool, &sRenderMyItems, "@brief Determines if mounted shapes are rendered or not.\n\n" "Used on the client side to disable the rendering of all Player mounted objects. This is " "mainly used for the tools or debugging.\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::renderCollision", TypeBool, &sRenderPlayerCollision, "@brief Determines if the player's collision mesh should be rendered.\n\n" "This is mainly used for the tools and debugging.\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::minWarpTicks",TypeF32,&sMinWarpTicks, "@brief Fraction of tick at which instant warp occures on the client.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::maxWarpTicks",TypeS32,&sMaxWarpTicks, "@brief When a warp needs to occur due to the client being too far off from the server, this is the " "maximum number of ticks we'll allow the client to warp to catch up.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::maxPredictionTicks",TypeS32,&sMaxPredictionTicks, "@brief Maximum number of ticks to predict on the client from the last known move obtained from the server.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::maxImpulseVelocity", TypeF32, &sMaxImpulseVelocity, "@brief The maximum velocity allowed due to a single impulse.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); // Move triggers Con::addVariable("$player::jumpTrigger", TypeS32, &sJumpTrigger, "@brief The move trigger index used for player jumping.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::crouchTrigger", TypeS32, &sCrouchTrigger, "@brief The move trigger index used for player crouching.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::proneTrigger", TypeS32, &sProneTrigger, "@brief The move trigger index used for player prone pose.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::sprintTrigger", TypeS32, &sSprintTrigger, "@brief The move trigger index used for player sprinting.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::imageTrigger0", TypeS32, &sImageTrigger0, "@brief The move trigger index used to trigger mounted image 0.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::imageTrigger1", TypeS32, &sImageTrigger1, "@brief The move trigger index used to trigger mounted image 1 or alternate fire " "on mounted image 0.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::jumpJetTrigger", TypeS32, &sJumpJetTrigger, "@brief The move trigger index used for player jump jetting.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); Con::addVariable("$player::vehicleDismountTrigger", TypeS32, &sVehicleDismountTrigger, "@brief The move trigger index used to dismount player.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); // ExtendedMove support Con::addVariable("$player::extendedMoveHeadPosRotIndex", TypeS32, &smExtendedMoveHeadPosRotIndex, "@brief The ExtendedMove position/rotation index used for head movements.\n\n" - "@ingroup GameObjects\n"); + "@ingroup GameObjects\n"); } //-------------------------------------------------------------------------- diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 670446ab3..829a78bf6 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -152,13 +152,13 @@ ShapeBaseData::ShapeBaseData() shadowMaxVisibleDistance( 80.0f ), shadowProjectionDistance( 10.0f ), shadowSphereAdjust( 1.0f ), - shapeName( StringTable->insert("") ), - cloakTexName( StringTable->insert("") ), + shapeName( StringTable->EmptyString() ), + cloakTexName( StringTable->EmptyString() ), cubeDescId( 0 ), reflectorDesc( NULL ), debris( NULL ), debrisID( 0 ), - debrisShapeName( StringTable->insert("") ), + debrisShapeName( StringTable->EmptyString() ), explosion( NULL ), explosionID( 0 ), underwaterExplosion( NULL ), @@ -447,12 +447,12 @@ bool ShapeBaseData::_setMass( void* object, const char* index, const char* data { ShapeBaseData* shape = reinterpret_cast< ShapeBaseData* >( object ); - F32 mass = dAtof(data); + F32 mass = dAtof(data); - if (mass <= 0) - mass = 0.01f; + if (mass <= 0) + mass = 0.01f; - shape->mass = mass; + shape->mass = mass; return false; } @@ -935,8 +935,8 @@ ShapeBase::ShapeBase() mScriptThread[i].thread = 0; mScriptThread[i].state = Thread::Stop; mScriptThread[i].atEnd = false; - mScriptThread[i].timescale = 1.f; - mScriptThread[i].position = -1.f; + mScriptThread[i].timescale = 1.f; + mScriptThread[i].position = -1.f; } for (i = 0; i < MaxTriggerKeys; i++) @@ -1042,7 +1042,7 @@ bool ShapeBase::onAdd() } /* - if(mDataBlock->cloakTexName != StringTable->insert("")) + if(mDataBlock->cloakTexName != StringTable->EmptyString()) mCloakTexture = TextureHandle(mDataBlock->cloakTexName, MeshTexture, false); */ // Accumulation and environment mapping @@ -1512,8 +1512,8 @@ void ShapeBase::onCameraScopeQuery(NetConnection *cr, CameraScopeQuery * query) eyeTransform.getColumn(1, &query->orientation); // Get the visible distance. - if (getSceneManager() != NULL) - query->visibleDistance = getSceneManager()->getVisibleDistance(); + if (getSceneManager() != NULL) + query->visibleDistance = getSceneManager()->getVisibleDistance(); Parent::onCameraScopeQuery( cr, query ); } @@ -2154,18 +2154,18 @@ void ShapeBase::updateAudioPos() const char *ShapeBase::getThreadSequenceName( U32 slot ) { - Thread& st = mScriptThread[slot]; - if ( st.sequence == -1 ) - { - // Invalid Animation. - return ""; - } + Thread& st = mScriptThread[slot]; + if ( st.sequence == -1 ) + { + // Invalid Animation. + return ""; + } - // Name Index - const U32 nameIndex = getShape()->sequences[st.sequence].nameIndex; + // Name Index + const U32 nameIndex = getShape()->sequences[st.sequence].nameIndex; - // Return Name. - return getShape()->getName( nameIndex ); + // Return Name. + return getShape()->getName( nameIndex ); } bool ShapeBase::setThreadSequence(U32 slot, S32 seq, bool reset) @@ -2200,39 +2200,39 @@ bool ShapeBase::setThreadSequence(U32 slot, S32 seq, bool reset) void ShapeBase::updateThread(Thread& st) { - switch (st.state) - { - case Thread::Stop: - { - mShapeInstance->setTimeScale( st.thread, 1.f ); - mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f ); - } // Drop through to pause state + switch (st.state) + { + case Thread::Stop: + { + mShapeInstance->setTimeScale( st.thread, 1.f ); + mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f ); + } // Drop through to pause state - case Thread::Pause: - { - mShapeInstance->setTimeScale( st.thread, 0.f ); - } break; + case Thread::Pause: + { + mShapeInstance->setTimeScale( st.thread, 0.f ); + } break; - case Thread::Play: - { - if (st.atEnd) - { - mShapeInstance->setTimeScale(st.thread,1); - mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f ); - mShapeInstance->setTimeScale(st.thread,0); + case Thread::Play: + { + if (st.atEnd) + { + mShapeInstance->setTimeScale(st.thread,1); + mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f ); + mShapeInstance->setTimeScale(st.thread,0); st.state = Thread::Stop; - } - else - { - if ( st.position != -1.f ) - { - mShapeInstance->setTimeScale( st.thread, 1.f ); - mShapeInstance->setPos( st.thread, st.position ); - } + } + else + { + if ( st.position != -1.f ) + { + mShapeInstance->setTimeScale( st.thread, 1.f ); + mShapeInstance->setPos( st.thread, st.position ); + } - mShapeInstance->setTimeScale(st.thread, st.timescale ); - } - } break; + mShapeInstance->setTimeScale(st.thread, st.timescale ); + } + } break; case Thread::Destroy: { @@ -2244,7 +2244,7 @@ void ShapeBase::updateThread(Thread& st) st.thread = 0; } } break; - } + } } bool ShapeBase::stopThread(U32 slot) @@ -2297,50 +2297,50 @@ bool ShapeBase::playThread(U32 slot) bool ShapeBase::setThreadPosition( U32 slot, F32 pos ) { - Thread& st = mScriptThread[slot]; - if (st.sequence != -1) - { - setMaskBits(ThreadMaskN << slot); - st.position = pos; - st.atEnd = false; - updateThread(st); + Thread& st = mScriptThread[slot]; + if (st.sequence != -1) + { + setMaskBits(ThreadMaskN << slot); + st.position = pos; + st.atEnd = false; + updateThread(st); - return true; - } - return false; + return true; + } + return false; } bool ShapeBase::setThreadDir(U32 slot,bool forward) { - Thread& st = mScriptThread[slot]; - if (st.sequence != -1) - { - if ( ( st.timescale >= 0.f ) != forward ) - { - setMaskBits(ThreadMaskN << slot); - st.timescale *= -1.f ; - st.atEnd = false; - updateThread(st); - } - return true; - } - return false; + Thread& st = mScriptThread[slot]; + if (st.sequence != -1) + { + if ( ( st.timescale >= 0.f ) != forward ) + { + setMaskBits(ThreadMaskN << slot); + st.timescale *= -1.f ; + st.atEnd = false; + updateThread(st); + } + return true; + } + return false; } bool ShapeBase::setThreadTimeScale( U32 slot, F32 timeScale ) { - Thread& st = mScriptThread[slot]; - if (st.sequence != -1) - { - if (st.timescale != timeScale) - { - setMaskBits(ThreadMaskN << slot); - st.timescale = timeScale; - updateThread(st); - } - return true; - } - return false; + Thread& st = mScriptThread[slot]; + if (st.sequence != -1) + { + if (st.timescale != timeScale) + { + setMaskBits(ThreadMaskN << slot); + st.timescale = timeScale; + updateThread(st); + } + return true; + } + return false; } void ShapeBase::advanceThreads(F32 dt) @@ -2349,7 +2349,7 @@ void ShapeBase::advanceThreads(F32 dt) Thread& st = mScriptThread[i]; if (st.thread) { if (!mShapeInstance->getShape()->sequences[st.sequence].isCyclic() && !st.atEnd && - ( ( st.timescale > 0.f )? mShapeInstance->getPos(st.thread) >= 1.0: + ( ( st.timescale > 0.f )? mShapeInstance->getPos(st.thread) >= 1.0: mShapeInstance->getPos(st.thread) <= 0)) { st.atEnd = true; updateThread(st); @@ -4392,7 +4392,7 @@ DefineEngineMethod( ShapeBase, isEnabled, bool, (),, DefineEngineMethod(ShapeBase, blowUp, void, (),, "@brief Explodes an object into pieces.") { - object->blowUp(); + object->blowUp(); } DefineEngineMethod( ShapeBase, applyDamage, void, ( F32 amount ),, @@ -4696,22 +4696,22 @@ void ShapeBase::consoleInit() "@see ShapeBase::setDamageFlash()\n" "@see ShapeBase::getDamageFlash()\n" "@note Relies on the flash postFx.\n" - "@ingroup gameObjects\n"); + "@ingroup gameObjects\n"); Con::addVariable("SB::WODec", TypeF32, &sWhiteoutDec, "Speed to reduce the whiteout effect per tick.\n\n" "@see ShapeBase::setWhiteOut()\n" "@see ShapeBase::getWhiteOut" "@note Relies on the flash postFx.\n" - "@ingroup gameObjects\n"); + "@ingroup gameObjects\n"); Con::addVariable("SB::FullCorrectionDistance", TypeF32, &sFullCorrectionDistance, "@brief Distance at which a weapon's muzzle vector is fully corrected to match where the player is looking.\n\n" "When a weapon image has correctMuzzleVector set and the Player is in 1st person, the muzzle vector from the " "weapon is modified to match where the player is looking. Beyond the FullCorrectionDistance the muzzle vector " "is always corrected. Between FullCorrectionDistance and the player, the weapon's muzzle vector is adjusted so that " "the closer the aim point is to the player, the closer the muzzle vector is to the true (non-corrected) one.\n" - "@ingroup gameObjects\n"); + "@ingroup gameObjects\n"); Con::addVariable("SB::CloakSpeed", TypeF32, &sCloakSpeed, "@brief Time to cloak, in seconds.\n\n" - "@ingroup gameObjects\n"); + "@ingroup gameObjects\n"); } void ShapeBase::_updateHiddenMeshes() @@ -4832,17 +4832,17 @@ DefineEngineMethod( ShapeBase, getTargetName, const char*, ( S32 index ),, "@see getTargetCount()\n") { - ShapeBase *obj = dynamic_cast< ShapeBase* > ( object ); - if(obj) - { - // Try to use the client object (so we get the reskinned targets in the Material Editor) - if ((ShapeBase*)obj->getClientObject()) - obj = (ShapeBase*)obj->getClientObject(); + ShapeBase *obj = dynamic_cast< ShapeBase* > ( object ); + if(obj) + { + // Try to use the client object (so we get the reskinned targets in the Material Editor) + if ((ShapeBase*)obj->getClientObject()) + obj = (ShapeBase*)obj->getClientObject(); - return obj->getShapeInstance()->getTargetName(index); - } + return obj->getShapeInstance()->getTargetName(index); + } - return ""; + return ""; } DefineEngineMethod( ShapeBase, getTargetCount, S32, (),, @@ -4861,7 +4861,7 @@ DefineEngineMethod( ShapeBase, getTargetCount, S32, (),, if (obj->getShapeInstance() != NULL) return obj->getShapeInstance()->getTargetCount(); - } + } return -1; } @@ -4938,10 +4938,10 @@ DefineEngineMethod( ShapeBase, getModelFile, const char *, (),, "@return the shape filename\n\n" ) { - GameBaseData * datablock = object->getDataBlock(); - if( !datablock ) - return String::EmptyString; + GameBaseData * datablock = object->getDataBlock(); + if( !datablock ) + return String::EmptyString; - const char *fieldName = StringTable->insert( String("shapeFile") ); + const char *fieldName = StringTable->insert( String("shapeFile") ); return datablock->getDataField( fieldName, NULL ); } diff --git a/Engine/source/console/SimXMLDocument.cpp b/Engine/source/console/SimXMLDocument.cpp index 840f36ca8..b2960105b 100644 --- a/Engine/source/console/SimXMLDocument.cpp +++ b/Engine/source/console/SimXMLDocument.cpp @@ -49,40 +49,40 @@ ConsoleDocClass( SimXMLDocument, "// Thanks to Rex Hiebert for this example\n" "// Given the following XML\n" "\n" - "\n" - " \n" - " Triangle\n" - " Square\n" - " Circle\n" - "
\n" - " \n" - " Pyramid\n" - " Cube\n" - " Sphere\n" - "
\n" - "
\n\n" + "\n" + " \n" + " Triangle\n" + " Square\n" + " Circle\n" + "
\n" + " \n" + " Pyramid\n" + " Cube\n" + " Sphere\n" + "
\n" + "
\n\n" "// Using SimXMLDocument by itself\n" "function readXmlExample(%filename)\n" - "{\n" - " %xml = new SimXMLDocument() {};\n" - " %xml.loadFile(%filename);\n\n" - " %xml.pushChildElement(\"DataTables\");\n" - " %xml.pushFirstChildElement(\"table\");\n" - " while(true)\n" - " {\n" - " echo(\"TABLE:\" SPC %xml.attribute(\"tableName\"));\n" - " %xml.pushFirstChildElement(\"rec\");\n" - " while (true)\n" - " {\n" - " %id = %xml.attribute(\"id\");\n" - " %desc = %xml.getData();\n" - " echo(\" Shape\" SPC %id SPC %desc);\n" - " if (!%xml.nextSiblingElement(\"rec\")) break;\n" - " }\n" - " %xml.popElement();\n" - " if (!%xml.nextSiblingElement(\"table\")) break;\n" - " }\n" - "}\n\n" + "{\n" + " %xml = new SimXMLDocument() {};\n" + " %xml.loadFile(%filename);\n\n" + " %xml.pushChildElement(\"DataTables\");\n" + " %xml.pushFirstChildElement(\"table\");\n" + " while(true)\n" + " {\n" + " echo(\"TABLE:\" SPC %xml.attribute(\"tableName\"));\n" + " %xml.pushFirstChildElement(\"rec\");\n" + " while (true)\n" + " {\n" + " %id = %xml.attribute(\"id\");\n" + " %desc = %xml.getData();\n" + " echo(\" Shape\" SPC %id SPC %desc);\n" + " if (!%xml.nextSiblingElement(\"rec\")) break;\n" + " }\n" + " %xml.popElement();\n" + " if (!%xml.nextSiblingElement(\"table\")) break;\n" + " }\n" + "}\n\n" "// Thanks to Scott Peal for this example\n" "// Using FileObject in conjunction with SimXMLDocument\n" @@ -90,45 +90,45 @@ ConsoleDocClass( SimXMLDocument, "// \n" "// \n" "// \n" - "function getModelsInCatagory()\n" - "{\n" - " %file = \"./Catalog.xml\";\n" - " %fo = new FileObject();\n" - " %text = \"\";\n\n" - " if(%fo.openForRead(%file))\n" - " {\n" - " while(!%fo.isEOF())\n" - " {\n" - " %text = %text @ %fo.readLine();\n" - " if (!%fo.isEOF()) %text = %text @ \"\\n\";\n" - " }\n" - " }\n" - " else\n" - " {\n" - " echo(\"Unable to locate the file: \" @ %file);\n" - " }\n\n" - " %fo.delete();\n\n" - " %xml = new SimXMLDocument() {};\n" - " %xml.parse(%text);\n" - " // \"Get\" inside of the root element, \"Models\".\n" - " %xml.pushChildElement(0);\n\n" - " // \"Get\" into the first child element\n" - " if (%xml.pushFirstChildElement(\"Model\"))\n" - " {\n" - " while (true)\n" - " {\n" - " // \n" - " // Here, i read the element's attributes.\n" - " // You might want to save these values in an array or call the %xml.getElementValue()\n" - " // if you have a different XML structure.\n\n" - " %catagory = %xml.attribute(\"catagory\");\n" - " %name = %xml.attribute(\"name\");\n" - " %path = %xml.attribute(\"path\");\n\n" - " // now, read the next \"Model\"\n" - " if (!%xml.nextSiblingElement(\"Model\")) break;\n" - " }\n" - " }\n" - "}\n" + "function getModelsInCatagory()\n" + "{\n" + " %file = \"./Catalog.xml\";\n" + " %fo = new FileObject();\n" + " %text = \"\";\n\n" + " if(%fo.openForRead(%file))\n" + " {\n" + " while(!%fo.isEOF())\n" + " {\n" + " %text = %text @ %fo.readLine();\n" + " if (!%fo.isEOF()) %text = %text @ \"\\n\";\n" + " }\n" + " }\n" + " else\n" + " {\n" + " echo(\"Unable to locate the file: \" @ %file);\n" + " }\n\n" + " %fo.delete();\n\n" + " %xml = new SimXMLDocument() {};\n" + " %xml.parse(%text);\n" + " // \"Get\" inside of the root element, \"Models\".\n" + " %xml.pushChildElement(0);\n\n" + " // \"Get\" into the first child element\n" + " if (%xml.pushFirstChildElement(\"Model\"))\n" + " {\n" + " while (true)\n" + " {\n" + " // \n" + " // Here, i read the element's attributes.\n" + " // You might want to save these values in an array or call the %xml.getElementValue()\n" + " // if you have a different XML structure.\n\n" + " %catagory = %xml.attribute(\"catagory\");\n" + " %name = %xml.attribute(\"name\");\n" + " %path = %xml.attribute(\"path\");\n\n" + " // now, read the next \"Model\"\n" + " if (!%xml.nextSiblingElement(\"Model\")) break;\n" + " }\n" + " }\n" + "}\n" "@endtsexample\n\n" "@note SimXMLDocument is a wrapper around TinyXml, a standard XML library. If you're familiar " @@ -504,13 +504,13 @@ const char* SimXMLDocument::elementValue() { if(m_paNode.empty()) { - return StringTable->insert(""); + return StringTable->EmptyString(); } const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iLastElement]; if(!pNode) { - return StringTable->insert(""); + return StringTable->EmptyString(); } return pNode->Value(); @@ -545,18 +545,18 @@ const char* SimXMLDocument::attribute(const char* rAttribute) { if(m_paNode.empty()) { - return StringTable->insert(""); + return StringTable->EmptyString(); } const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iLastElement]; if(!pNode) { - return StringTable->insert(""); + return StringTable->EmptyString(); } if(!pNode->Attribute(rAttribute)) { - return StringTable->insert(""); + return StringTable->EmptyString(); } return pNode->Attribute(rAttribute); @@ -629,20 +629,20 @@ const char* SimXMLDocument::firstAttribute() // Get the current element if(m_paNode.empty()) { - return StringTable->insert(""); + return StringTable->EmptyString(); } const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iLastElement]; if(!pNode) { - return StringTable->insert(""); + return StringTable->EmptyString(); } // Gets its first attribute, if any m_CurrentAttribute = pNode->FirstAttribute(); if(!m_CurrentAttribute) { - return StringTable->insert(""); + return StringTable->EmptyString(); } return m_CurrentAttribute->Name(); @@ -666,20 +666,20 @@ const char* SimXMLDocument::lastAttribute() // Get the current element if(m_paNode.empty()) { - return StringTable->insert(""); + return StringTable->EmptyString(); } const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iLastElement]; if(!pNode) { - return StringTable->insert(""); + return StringTable->EmptyString(); } // Gets its last attribute, if any m_CurrentAttribute = pNode->LastAttribute(); if(!m_CurrentAttribute) { - return StringTable->insert(""); + return StringTable->EmptyString(); } return m_CurrentAttribute->Name(); @@ -703,14 +703,14 @@ const char* SimXMLDocument::nextAttribute() { if(!m_CurrentAttribute) { - return StringTable->insert(""); + return StringTable->EmptyString(); } // Gets its next attribute, if any m_CurrentAttribute = m_CurrentAttribute->Next(); if(!m_CurrentAttribute) { - return StringTable->insert(""); + return StringTable->EmptyString(); } return m_CurrentAttribute->Name(); @@ -734,14 +734,14 @@ const char* SimXMLDocument::prevAttribute() { if(!m_CurrentAttribute) { - return StringTable->insert(""); + return StringTable->EmptyString(); } // Gets its next attribute, if any m_CurrentAttribute = m_CurrentAttribute->Previous(); if(!m_CurrentAttribute) { - return StringTable->insert(""); + return StringTable->EmptyString(); } return m_CurrentAttribute->Name(); diff --git a/Engine/source/console/astAlloc.cpp b/Engine/source/console/astAlloc.cpp index 19809a1e2..fb69f49d5 100644 --- a/Engine/source/console/astAlloc.cpp +++ b/Engine/source/console/astAlloc.cpp @@ -411,7 +411,7 @@ ObjectDeclNode *ObjectDeclNode::alloc( S32 lineNumber, ExprNode *classNameExpr, if(parentObject) ret->parentObject = parentObject; else - ret->parentObject = StringTable->insert(""); + ret->parentObject = StringTable->EmptyString(); return ret; } diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index 1559f41d8..192b50f0f 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -435,7 +435,7 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st) if(offset < globalSize) ste = StringTable->insert(globalStrings + offset); else - ste = StringTable->insert(""); + ste = StringTable->EmptyString(); U32 count; st.read(&count); while(count--) @@ -455,8 +455,8 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st) bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, const char *inScript, bool overrideNoDso) { - AssertFatal(Con::isMainThread(), "Compiling code on a secondary thread"); - + AssertFatal(Con::isMainThread(), "Compiling code on a secondary thread"); + // This will return true, but return value is ignored char *script; chompUTF8BOM( inScript, &script ); @@ -572,8 +572,8 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con ConsoleValueRef CodeBlock::compileExec(StringTableEntry fileName, const char *inString, bool noCalls, S32 setFrame) { - AssertFatal(Con::isMainThread(), "Compiling code on a secondary thread"); - + AssertFatal(Con::isMainThread(), "Compiling code on a secondary thread"); + // Check for a UTF8 script file char *string; chompUTF8BOM( inString, &string ); diff --git a/Engine/source/console/fieldBrushObject.cpp b/Engine/source/console/fieldBrushObject.cpp index 484178dec..407a57cb3 100644 --- a/Engine/source/console/fieldBrushObject.cpp +++ b/Engine/source/console/fieldBrushObject.cpp @@ -41,8 +41,8 @@ ConsoleDocClass( FieldBrushObject, FieldBrushObject::FieldBrushObject() { // Reset Description. - mDescription = StringTable->insert(""); - mSortName = StringTable->insert(""); + mDescription = StringTable->EmptyString(); + mSortName = StringTable->EmptyString(); } diff --git a/Engine/source/console/persistenceManager.cpp b/Engine/source/console/persistenceManager.cpp index 7db907475..c4af549ed 100644 --- a/Engine/source/console/persistenceManager.cpp +++ b/Engine/source/console/persistenceManager.cpp @@ -328,7 +328,7 @@ void PersistenceManager::parseObject() if (mParser.tokenICmp(")")) { - mCurrentObject->name = StringTable->insert(""); + mCurrentObject->name = StringTable->EmptyString(); mCurrentObject->nameLine = mParser.getCurrentLine(); mCurrentObject->namePosition = mParser.getTokenLineOffset(); diff --git a/Engine/source/gui/buttons/guiIconButtonCtrl.cpp b/Engine/source/gui/buttons/guiIconButtonCtrl.cpp index f37d69a4c..e9d654d2a 100644 --- a/Engine/source/gui/buttons/guiIconButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiIconButtonCtrl.cpp @@ -85,7 +85,7 @@ ConsoleDocClass( GuiIconButtonCtrl, GuiIconButtonCtrl::GuiIconButtonCtrl() { - mBitmapName = StringTable->insert(""); + mBitmapName = StringTable->EmptyString(); mTextLocation = TextLocLeft; mIconLocation = IconLocLeft; mTextMargin = 4; @@ -94,7 +94,7 @@ GuiIconButtonCtrl::GuiIconButtonCtrl() mFitBitmapToButton = false; mMakeIconSquare = false; - mErrorBitmapName = StringTable->insert(""); + mErrorBitmapName = StringTable->EmptyString(); mErrorTextureHandle = NULL; mAutoSize = false; diff --git a/Engine/source/gui/buttons/guiToggleButtonCtrl.cpp b/Engine/source/gui/buttons/guiToggleButtonCtrl.cpp index 7168f58ca..a2aaaa6c9 100644 --- a/Engine/source/gui/buttons/guiToggleButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiToggleButtonCtrl.cpp @@ -49,7 +49,7 @@ ConsoleDocClass( GuiToggleButtonCtrl, GuiToggleButtonCtrl::GuiToggleButtonCtrl() { setExtent(140, 30); - mButtonText = StringTable->insert(""); + mButtonText = StringTable->EmptyString(); mStateOn = false; mButtonType = ButtonTypeCheck; } diff --git a/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp b/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp index 9242d8aff..ad65b5782 100644 --- a/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp @@ -43,7 +43,7 @@ ConsoleDocClass( GuiToolboxButtonCtrl, //------------------------------------- GuiToolboxButtonCtrl::GuiToolboxButtonCtrl() { - mNormalBitmapName = StringTable->insert(""); + mNormalBitmapName = StringTable->EmptyString(); mLoweredBitmapName = StringTable->insert("sceneeditor/client/images/buttondown"); mHoverBitmapName = StringTable->insert("sceneeditor/client/images/buttonup"); setMinExtent(Point2I(16,16)); @@ -225,4 +225,4 @@ void GuiToolboxButtonCtrl::renderButton(GFXTexHandle &texture, Point2I &offset, GFX->getDrawUtil()->drawBitmap(texture, finalOffset); renderChildControls( offset, updateRect); } -} \ No newline at end of file +} diff --git a/Engine/source/gui/containers/guiFormCtrl.cpp b/Engine/source/gui/containers/guiFormCtrl.cpp index bbd9a7f9e..f94e6c234 100644 --- a/Engine/source/gui/containers/guiFormCtrl.cpp +++ b/Engine/source/gui/containers/guiFormCtrl.cpp @@ -50,8 +50,8 @@ GuiFormCtrl::GuiFormCtrl() mCaption = "[none]"; mUseSmallCaption = false; - mContentLibrary = StringTable->insert(""); - mContent = StringTable->insert(""); + mContentLibrary = StringTable->EmptyString(); + mContent = StringTable->EmptyString(); mCanSaveFieldDictionary = true; mIsContainer = true; @@ -213,7 +213,7 @@ bool GuiFormCtrl::resize(const Point2I &newPosition, const Point2I &newExtent) static char buf[256]; mUseSmallCaption = true; - mSmallCaption = StringTable->insert(""); + mSmallCaption = StringTable->EmptyString(); S32 strlen = dStrlen((const char*)mCaption); for(S32 i=strlen; i>=0; --i) diff --git a/Engine/source/gui/containers/guiPaneCtrl.cpp b/Engine/source/gui/containers/guiPaneCtrl.cpp index c42fc9e51..4d2ae5e61 100644 --- a/Engine/source/gui/containers/guiPaneCtrl.cpp +++ b/Engine/source/gui/containers/guiPaneCtrl.cpp @@ -68,7 +68,7 @@ GuiPaneControl::GuiPaneControl() mMouseOver = false; mDepressed = false; mCaption = "A Pane"; - mCaptionID = StringTable->insert(""); + mCaptionID = StringTable->EmptyString(); mIsContainer = true; mOriginalExtents.set(10,10); diff --git a/Engine/source/gui/containers/guiWindowCtrl.cpp b/Engine/source/gui/containers/guiWindowCtrl.cpp index 2957ec7ec..df8838fa1 100644 --- a/Engine/source/gui/containers/guiWindowCtrl.cpp +++ b/Engine/source/gui/containers/guiWindowCtrl.cpp @@ -1512,7 +1512,7 @@ void GuiWindowCtrl::setCloseCommand(const char *newCmd) if (newCmd) mCloseCommand = StringTable->insert(newCmd); else - mCloseCommand = StringTable->insert(""); + mCloseCommand = StringTable->EmptyString(); } //----------------------------------------------------------------------------- diff --git a/Engine/source/gui/controls/guiGameListMenuCtrl.cpp b/Engine/source/gui/controls/guiGameListMenuCtrl.cpp index 760a0246a..e64f2c7c0 100644 --- a/Engine/source/gui/controls/guiGameListMenuCtrl.cpp +++ b/Engine/source/gui/controls/guiGameListMenuCtrl.cpp @@ -38,7 +38,7 @@ GuiGameListMenuCtrl::GuiGameListMenuCtrl() VECTOR_SET_ASSOCIATION(mRows); // initialize the control callbacks - mCallbackOnA = StringTable->insert(""); + mCallbackOnA = StringTable->EmptyString(); mCallbackOnB = mCallbackOnA; mCallbackOnX = mCallbackOnA; mCallbackOnY = mCallbackOnA; @@ -572,7 +572,7 @@ StringTableEntry GuiGameListMenuCtrl::getRowLabel(S32 rowIndex) const if (! isValidRowIndex(rowIndex)) { // not a valid row index, don't do anything - return StringTable->insert(""); + return StringTable->EmptyString(); } return mRows[rowIndex]->mLabel; } diff --git a/Engine/source/gui/controls/guiListBoxCtrl.cpp b/Engine/source/gui/controls/guiListBoxCtrl.cpp index 5deab67fc..992d64903 100644 --- a/Engine/source/gui/controls/guiListBoxCtrl.cpp +++ b/Engine/source/gui/controls/guiListBoxCtrl.cpp @@ -1530,7 +1530,7 @@ void GuiListBoxCtrl::_mirror() StringTableEntry GuiListBoxCtrl::_makeMirrorItemName( SimObject *inObj ) { - StringTableEntry outName = StringTable->insert(""); + StringTableEntry outName = StringTable->EmptyString(); if ( mMakeNameCallback.isNotEmpty() ) { @@ -1634,4 +1634,4 @@ void GuiListBoxCtrl::removeFilteredItem( String item ) break; } } -} \ No newline at end of file +} diff --git a/Engine/source/gui/controls/guiMLTextCtrl.cpp b/Engine/source/gui/controls/guiMLTextCtrl.cpp index 6cfdf4354..e61a82cc5 100644 --- a/Engine/source/gui/controls/guiMLTextCtrl.cpp +++ b/Engine/source/gui/controls/guiMLTextCtrl.cpp @@ -251,7 +251,7 @@ GuiMLTextCtrl::GuiMLTextCtrl() mIsEditCtrl( false ), mCursorPosition( false ), mMaxBufferSize( -1 ), - mInitialText( StringTable->insert("") ), + mInitialText( StringTable->EmptyString() ), mSelectionActive( false ), mSelectionStart( 0 ), mSelectionEnd( 0 ), @@ -267,7 +267,7 @@ GuiMLTextCtrl::GuiMLTextCtrl() mFontList( NULL ) { mActive = true; - //mInitialText = StringTable->insert(""); + //mInitialText = StringTable->EmptyString(); Sim::findObject("InputDeniedSound", mDeniedSound); } diff --git a/Engine/source/gui/controls/guiPopUpCtrl.cpp b/Engine/source/gui/controls/guiPopUpCtrl.cpp index beb9fbcc8..af172221a 100644 --- a/Engine/source/gui/controls/guiPopUpCtrl.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrl.cpp @@ -277,7 +277,7 @@ GuiPopUpMenuCtrl::GuiPopUpMenuCtrl(void) mRenderScrollInNA = false; // Added mBackgroundCancel = false; // Added mReverseTextList = false; // Added - Don't reverse text list if displaying up - mBitmapName = StringTable->insert(""); // Added + mBitmapName = StringTable->EmptyString(); // Added mBitmapBounds.set(16, 16); // Added mIdMax = -1; } diff --git a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp index 510576f8a..3c6415117 100644 --- a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp @@ -328,7 +328,7 @@ GuiPopUpMenuCtrlEx::GuiPopUpMenuCtrlEx(void) mRenderScrollInNA = false; // Added mBackgroundCancel = false; // Added mReverseTextList = false; // Added - Don't reverse text list if displaying up - mBitmapName = StringTable->insert(""); // Added + mBitmapName = StringTable->EmptyString(); // Added mBitmapBounds.set(16, 16); // Added mHotTrackItems = false; mIdMax = -1; diff --git a/Engine/source/gui/controls/guiTextCtrl.cpp b/Engine/source/gui/controls/guiTextCtrl.cpp index e8c9057f1..8759e3973 100644 --- a/Engine/source/gui/controls/guiTextCtrl.cpp +++ b/Engine/source/gui/controls/guiTextCtrl.cpp @@ -54,8 +54,8 @@ ConsoleDocClass( GuiTextCtrl, GuiTextCtrl::GuiTextCtrl() { //default fonts - mInitialText = StringTable->insert(""); - mInitialTextID = StringTable->insert(""); + mInitialText = StringTable->EmptyString(); + mInitialTextID = StringTable->EmptyString(); mText[0] = '\0'; mMaxStrLen = GuiTextCtrl::MAX_STRING_LENGTH; } diff --git a/Engine/source/gui/controls/guiTextEditCtrl.cpp b/Engine/source/gui/controls/guiTextEditCtrl.cpp index 9084e8d8d..968fe17a6 100644 --- a/Engine/source/gui/controls/guiTextEditCtrl.cpp +++ b/Engine/source/gui/controls/guiTextEditCtrl.cpp @@ -1684,7 +1684,7 @@ DefineEngineMethod( GuiTextEditCtrl, getText, const char*, (),, "@see GuiControl") { if( !object->hasText() ) - return StringTable->insert(""); + return StringTable->EmptyString(); char *retBuffer = Con::getReturnBuffer( GuiTextEditCtrl::MAX_STRING_LENGTH ); object->getText( retBuffer ); diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index e1b20ad5f..e4fb9ab00 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -845,7 +845,7 @@ GuiTreeViewCtrl::GuiTreeViewCtrl() mClearAllOnSingleSelection = true; - mBitmapBase = StringTable->insert(""); + mBitmapBase = StringTable->EmptyString(); mTexRollover = NULL; mTexSelected = NULL; @@ -4746,13 +4746,13 @@ StringTableEntry GuiTreeViewCtrl::getTextToRoot( S32 itemId, const char * delimi if(!item) { Con::errorf(ConsoleLogEntry::General, "GuiTreeViewCtrl::getTextToRoot: invalid start item id!"); - return StringTable->insert(""); + return StringTable->EmptyString(); } if(item->isInspectorData()) { Con::errorf(ConsoleLogEntry::General, "GuiTreeViewCtrl::getTextToRoot: cannot get text to root of inspector data items"); - return StringTable->insert(""); + return StringTable->EmptyString(); } char bufferOne[1024]; diff --git a/Engine/source/gui/editor/guiParticleGraphCtrl.cpp b/Engine/source/gui/editor/guiParticleGraphCtrl.cpp index 8e20bfeef..68ecf81c4 100644 --- a/Engine/source/gui/editor/guiParticleGraphCtrl.cpp +++ b/Engine/source/gui/editor/guiParticleGraphCtrl.cpp @@ -50,7 +50,7 @@ GuiParticleGraphCtrl::GuiParticleGraphCtrl() mPlots[i].mGraphMin.x = 0; mPlots[i].mGraphMin.y = 0; mPlots[i].mGraphType = Polyline; - mPlots[i].mGraphName = StringTable->insert(""); + mPlots[i].mGraphName = StringTable->EmptyString(); mPlots[i].mHidden = false; mPlots[i].mGraphScale = 0.05f; } diff --git a/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp b/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp index 2b122f540..d0f9549e1 100644 --- a/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp @@ -86,7 +86,7 @@ DefineEngineMethod( GuiChunkedBitmapCtrl, setBitmap, void, (const char* filename GuiChunkedBitmapCtrl::GuiChunkedBitmapCtrl() { - mBitmapName = StringTable->insert(""); + mBitmapName = StringTable->EmptyString(); mUseVariable = false; mTile = false; } diff --git a/Engine/source/gui/worldEditor/undoActions.cpp b/Engine/source/gui/worldEditor/undoActions.cpp index 94495d89e..d88b72bcd 100644 --- a/Engine/source/gui/worldEditor/undoActions.cpp +++ b/Engine/source/gui/worldEditor/undoActions.cpp @@ -218,8 +218,8 @@ InspectorFieldUndoAction::InspectorFieldUndoAction() { mObjId = 0; mField = NULL; - mSlotName = StringTable->insert(""); - mArrayIdx = StringTable->insert(""); + mSlotName = StringTable->EmptyString(); + mArrayIdx = StringTable->EmptyString(); } InspectorFieldUndoAction::InspectorFieldUndoAction( const UTF8 *actionName ) @@ -228,8 +228,8 @@ InspectorFieldUndoAction::InspectorFieldUndoAction( const UTF8 *actionName ) mInspector = NULL; mObjId = 0; mField = NULL; - mSlotName = StringTable->insert(""); - mArrayIdx = StringTable->insert(""); + mSlotName = StringTable->EmptyString(); + mArrayIdx = StringTable->EmptyString(); } void InspectorFieldUndoAction::initPersistFields() @@ -272,4 +272,4 @@ void InspectorFieldUndoAction::undo() // Now save the previous data in this UndoAction // since an undo action must become a redo action and vice-versa mData = data; -} \ No newline at end of file +} diff --git a/Engine/source/navigation/navMesh.cpp b/Engine/source/navigation/navMesh.cpp index 2d4b0ad7e..7dbb40d6d 100644 --- a/Engine/source/navigation/navMesh.cpp +++ b/Engine/source/navigation/navMesh.cpp @@ -181,7 +181,7 @@ DefineConsoleFunction(NavMeshUpdateOne, void, (S32 meshid, S32 objid, bool remov NavMesh::NavMesh() { mTypeMask |= StaticShapeObjectType | MarkerObjectType; - mFileName = StringTable->insert(""); + mFileName = StringTable->EmptyString(); mNetFlags.clear(Ghostable); mSaveIntermediates = false; @@ -211,7 +211,7 @@ NavMesh::NavMesh() mLargeCharacters = false; mVehicles = false; - mCoverSet = StringTable->insert(""); + mCoverSet = StringTable->EmptyString(); mInnerCover = false; mCoverDist = 1.0f; mPeekDist = 0.7f; diff --git a/Engine/source/navigation/navPath.cpp b/Engine/source/navigation/navPath.cpp index a945e7f8d..9409cc193 100644 --- a/Engine/source/navigation/navPath.cpp +++ b/Engine/source/navigation/navPath.cpp @@ -170,7 +170,7 @@ const char *NavPath::getProtectedFrom(void *obj, const char *data) if(object->mFromSet) return data; else - return StringTable->insert(""); + return StringTable->EmptyString(); } const char *NavPath::getProtectedTo(void *obj, const char *data) @@ -180,7 +180,7 @@ const char *NavPath::getProtectedTo(void *obj, const char *data) if(object->mToSet) return data; else - return StringTable->insert(""); + return StringTable->EmptyString(); } IRangeValidator ValidIterations(1, S32_MAX); diff --git a/Engine/source/platform/menus/popupMenu.cpp b/Engine/source/platform/menus/popupMenu.cpp index a7fc2e989..7e8aad7ba 100644 --- a/Engine/source/platform/menus/popupMenu.cpp +++ b/Engine/source/platform/menus/popupMenu.cpp @@ -51,7 +51,7 @@ PopupMenu::PopupMenu() : mCanvas(NULL) mSubmenus = new SimSet; mSubmenus->registerObject(); - mBarTitle = StringTable->insert(""); + mBarTitle = StringTable->EmptyString(); mIsPopup = false; mPopupGUID = sMaxPopupGUID++; diff --git a/Engine/source/platform/nativeDialogs/fileDialog.cpp b/Engine/source/platform/nativeDialogs/fileDialog.cpp index 08d689585..09ed1c63e 100644 --- a/Engine/source/platform/nativeDialogs/fileDialog.cpp +++ b/Engine/source/platform/nativeDialogs/fileDialog.cpp @@ -48,10 +48,10 @@ FileDialogData::FileDialogData() if (mDefaultPath == StringTable->lookup("") || !Platform::isDirectory(mDefaultPath)) mDefaultPath = Platform::getCurrentDirectory(); - mDefaultFile = StringTable->insert(""); - mFilters = StringTable->insert(""); - mFile = StringTable->insert(""); - mTitle = StringTable->insert(""); + mDefaultFile = StringTable->EmptyString(); + mFilters = StringTable->EmptyString(); + mFile = StringTable->EmptyString(); + mTitle = StringTable->EmptyString(); mStyle = 0; From de53ac86c7e7e07389628086c58e1d94e3da4cab Mon Sep 17 00:00:00 2001 From: "Thomas \"elfprince13\" Dickerson" Date: Fri, 13 Jan 2017 10:42:52 -0500 Subject: [PATCH 06/26] Somebody broke SDL when they updated it. The new version depends on AudioToolbox, so added that as dependency in torque3d.cmake --- Engine/lib/sdl/Android.mk | 0 Engine/lib/sdl/BUGS.txt | 2 +- Engine/lib/sdl/CMakeLists.txt | 183 +++-- Engine/lib/sdl/Makefile.in | 11 +- Engine/lib/sdl/Makefile.pandora | 2 +- Engine/lib/sdl/Makefile.psp | 1 + Engine/lib/sdl/Makefile.wiz | 10 +- Engine/lib/sdl/README-SDL.txt | 4 +- Engine/lib/sdl/SDL2.spec | 2 +- Engine/lib/sdl/VisualC.html | 4 +- Engine/lib/sdl/VisualC/clean.sh | 4 - Engine/lib/sdl/WhatsNew.txt | 63 ++ Engine/lib/sdl/Xcode/SDL/Info-Framework.plist | 6 +- .../Xcode/SDL/SDL.xcodeproj/project.pbxproj | 117 +-- Engine/lib/sdl/Xcode/SDL/pkg-support/SDL.info | 0 .../SDL/pkg-support/resources/ReadMe.txt | 0 .../SDLTest/SDLTest.xcodeproj/project.pbxproj | 4 +- Engine/lib/sdl/autogen.sh | 6 + Engine/lib/sdl/build-scripts/androidbuild.sh | 8 +- .../lib/sdl/build-scripts/checker-buildbot.sh | 6 +- .../sdl/build-scripts/emscripten-buildbot.sh | 7 +- Engine/lib/sdl/build-scripts/g++-fat.sh | 6 +- Engine/lib/sdl/build-scripts/gcc-fat.sh | 8 +- Engine/lib/sdl/build-scripts/install-sh | 0 Engine/lib/sdl/build-scripts/iosbuild.sh | 0 Engine/lib/sdl/build-scripts/ltmain.sh | 0 Engine/lib/sdl/build-scripts/mkinstalldirs | 0 Engine/lib/sdl/build-scripts/nacl-buildbot.sh | 0 Engine/lib/sdl/build-scripts/naclbuild.sh | 0 .../sdl/build-scripts/raspberrypi-buildbot.sh | 0 Engine/lib/sdl/build-scripts/showrev.sh | 4 +- Engine/lib/sdl/build-scripts/strip_fPIC.sh | 0 .../lib/sdl/build-scripts/update-copyright.sh | 0 Engine/lib/sdl/build-scripts/updaterev.sh | 0 Engine/lib/sdl/cmake/sdlchecks.cmake | 98 ++- Engine/lib/sdl/configure | 289 +++++++- Engine/lib/sdl/configure.in | 200 ++++- Engine/lib/sdl/debian/changelog | 6 + Engine/lib/sdl/debian/copyright | 11 - Engine/lib/sdl/debian/libsdl2-dev.install | 1 + Engine/lib/sdl/debian/rules | 0 Engine/lib/sdl/sdl2-config.cmake.in | 1 + Engine/lib/sdl/sdl2.m4 | 54 +- Engine/lib/sdl/src/audio/SDL_audiomem.h | 25 - .../sdl/src/audio/coreaudio/SDL_coreaudio.c | 698 ------------------ Engine/lib/sdl/src/audio/sdlgenaudiocvt.pl | 0 Engine/lib/sdl/src/dynapi/gendynapi.pl | 0 .../lib/sdl/src/joystick/sort_controllers.py | 0 Engine/lib/sdl/src/video/sdlgenblit.pl | 0 Engine/lib/sdl/test/Makefile.in | 16 + Engine/lib/sdl/test/autogen.sh | 0 Engine/lib/sdl/test/configure | 0 Engine/lib/sdl/test/controllermap.c | 9 +- Engine/lib/sdl/test/gcc-fat.sh | 0 Engine/lib/sdl/test/testatomic.c | 12 +- Engine/lib/sdl/test/testaudiocapture.c | 165 +++++ Engine/lib/sdl/test/testaudiohotplug.c | 28 +- Engine/lib/sdl/test/testaudioinfo.c | 12 +- Engine/lib/sdl/test/testautomation_events.c | 4 +- Engine/lib/sdl/test/testautomation_keyboard.c | 16 +- Engine/lib/sdl/test/testautomation_main.c | 4 +- Engine/lib/sdl/test/testautomation_sdltest.c | 2 +- Engine/lib/sdl/test/testautomation_stdlib.c | 44 +- Engine/lib/sdl/test/testbounds.c | 40 + Engine/lib/sdl/test/testcustomcursor.c | 216 ++++++ Engine/lib/sdl/test/testdisplayinfo.c | 7 + Engine/lib/sdl/test/testdrawchessboard.c | 2 +- Engine/lib/sdl/test/testdropfile.c | 9 +- Engine/lib/sdl/test/testfilesystem.c | 5 +- Engine/lib/sdl/test/testgamecontroller.c | 12 +- Engine/lib/sdl/test/testgles.c | 2 +- Engine/lib/sdl/test/testgles2.c | 4 +- Engine/lib/sdl/test/testime.c | 500 ++++++++++++- Engine/lib/sdl/test/testlock.c | 12 +- Engine/lib/sdl/test/testmultiaudio.c | 11 +- Engine/lib/sdl/test/testqsort.c | 108 +++ Engine/lib/sdl/test/testrendercopyex.c | 4 +- Engine/lib/sdl/test/testshape.c | 4 + Engine/lib/sdl/test/testwm2.c | 14 +- Engine/lib/sdl/test/torturethread.c | 8 +- Engine/source/.gitattributes | 5 + Tools/CMake/torque3d.cmake | 1 + 82 files changed, 2082 insertions(+), 1035 deletions(-) mode change 100644 => 100755 Engine/lib/sdl/Android.mk delete mode 100644 Engine/lib/sdl/VisualC/clean.sh mode change 100644 => 100755 Engine/lib/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj mode change 100644 => 100755 Engine/lib/sdl/Xcode/SDL/pkg-support/SDL.info mode change 100644 => 100755 Engine/lib/sdl/Xcode/SDL/pkg-support/resources/ReadMe.txt mode change 100644 => 100755 Engine/lib/sdl/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj mode change 100644 => 100755 Engine/lib/sdl/autogen.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/androidbuild.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/checker-buildbot.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/emscripten-buildbot.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/g++-fat.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/gcc-fat.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/install-sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/iosbuild.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/ltmain.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/mkinstalldirs mode change 100644 => 100755 Engine/lib/sdl/build-scripts/nacl-buildbot.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/naclbuild.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/raspberrypi-buildbot.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/showrev.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/strip_fPIC.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/update-copyright.sh mode change 100644 => 100755 Engine/lib/sdl/build-scripts/updaterev.sh mode change 100644 => 100755 Engine/lib/sdl/configure mode change 100644 => 100755 Engine/lib/sdl/debian/rules delete mode 100644 Engine/lib/sdl/src/audio/SDL_audiomem.h delete mode 100644 Engine/lib/sdl/src/audio/coreaudio/SDL_coreaudio.c mode change 100644 => 100755 Engine/lib/sdl/src/audio/sdlgenaudiocvt.pl mode change 100644 => 100755 Engine/lib/sdl/src/dynapi/gendynapi.pl mode change 100644 => 100755 Engine/lib/sdl/src/joystick/sort_controllers.py mode change 100644 => 100755 Engine/lib/sdl/src/video/sdlgenblit.pl mode change 100644 => 100755 Engine/lib/sdl/test/autogen.sh mode change 100644 => 100755 Engine/lib/sdl/test/configure mode change 100644 => 100755 Engine/lib/sdl/test/gcc-fat.sh create mode 100644 Engine/lib/sdl/test/testaudiocapture.c create mode 100644 Engine/lib/sdl/test/testbounds.c create mode 100644 Engine/lib/sdl/test/testcustomcursor.c create mode 100644 Engine/lib/sdl/test/testqsort.c create mode 100644 Engine/source/.gitattributes diff --git a/Engine/lib/sdl/Android.mk b/Engine/lib/sdl/Android.mk old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/BUGS.txt b/Engine/lib/sdl/BUGS.txt index c5ed3af23..6a4cbb7ad 100644 --- a/Engine/lib/sdl/BUGS.txt +++ b/Engine/lib/sdl/BUGS.txt @@ -1,7 +1,7 @@ Bugs are now managed in the SDL bug tracker, here: - http://bugzilla.libsdl.org/ + https://bugzilla.libsdl.org/ You may report bugs there, and search to see if a given issue has already been reported, discussed, and maybe even fixed. diff --git a/Engine/lib/sdl/CMakeLists.txt b/Engine/lib/sdl/CMakeLists.txt index 63244a9e2..54a23f0c7 100644 --- a/Engine/lib/sdl/CMakeLists.txt +++ b/Engine/lib/sdl/CMakeLists.txt @@ -2,8 +2,19 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the SDL source code and call cmake from there") endif() -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.5) project(SDL2 C) + +# !!! FIXME: this should probably do "MACOSX_RPATH ON" as a target property +# !!! FIXME: for the SDL2 shared library (so you get an +# !!! FIXME: install_name ("soname") of "@rpath/libSDL-whatever.dylib" +# !!! FIXME: instead of "/usr/local/lib/libSDL-whatever.dylib"), but I'm +# !!! FIXME: punting for now and leaving the existing behavior. Until this +# !!! FIXME: properly resolved, this line silences a warning in CMake 3.0+. +# !!! FIXME: remove it and this comment entirely once the problem is +# !!! FIXME: properly resolved. +#cmake_policy(SET CMP0042 OLD) + include(CheckFunctionExists) include(CheckLibraryExists) include(CheckIncludeFiles) @@ -15,6 +26,7 @@ include(CheckTypeSize) include(CheckStructHasMember) include(CMakeDependentOption) include(FindPkgConfig) +include(GNUInstallDirs) set(CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake") include(${SDL2_SOURCE_DIR}/cmake/macros.cmake) include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake) @@ -29,9 +41,9 @@ include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake) # set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0. set(SDL_MAJOR_VERSION 2) set(SDL_MINOR_VERSION 0) -set(SDL_MICRO_VERSION 4) -set(SDL_INTERFACE_AGE 0) -set(SDL_BINARY_AGE 4) +set(SDL_MICRO_VERSION 5) +set(SDL_INTERFACE_AGE 1) +set(SDL_BINARY_AGE 5) set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}") # Calculate a libtool-like version number @@ -147,8 +159,10 @@ endif() # Default flags, if not set otherwise if("$ENV{CFLAGS}" STREQUAL "") - if(USE_GCC OR USE_CLANG) - set(CMAKE_C_FLAGS "-g -O3") + if(CMAKE_BUILD_TYPE STREQUAL "") + if(USE_GCC OR USE_CLANG) + set(CMAKE_C_FLAGS "-g -O3") + endif() endif() else() set(CMAKE_C_FLAGS "$ENV{CFLAGS}") @@ -183,8 +197,8 @@ endif() set(SDL_LIBS "-lSDL2") set(SDL_CFLAGS "") -# Emscripten toolchain has a nonempty default value for this, and the checks -# in this file need to change that, so remember the original value, and +# Emscripten toolchain has a nonempty default value for this, and the checks +# in this file need to change that, so remember the original value, and # restore back to that afterwards. For check_function_exists() to work in # Emscripten, this value must be at its default value. set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) @@ -192,7 +206,7 @@ set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) if(CYGWIN) # We build SDL on cygwin without the UNIX emulation layer include_directories("-I/usr/include/mingw") - set(CMAKE_REQUIRED_FLAGS "-mno-cygwin") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mno-cygwin") check_c_source_compiles("int main(int argc, char **argv) {}" HAVE_GCC_NO_CYGWIN) set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) @@ -212,7 +226,7 @@ include_directories(${SDL2_BINARY_DIR}/include ${SDL2_SOURCE_DIR}/include) set(OPT_DEF_ASM TRUE) if(EMSCRIPTEN) # Set up default values for the currently supported set of subsystems: - # Emscripten/Javascript does not have assembly support, a dynamic library + # Emscripten/Javascript does not have assembly support, a dynamic library # loading architecture, low-level CPU inspection or multithreading. set(OPT_DEF_ASM FALSE) set(SDL_SHARED_ENABLED_BY_DEFAULT OFF) @@ -299,6 +313,8 @@ set_option(VIDEO_VIVANTE "Use Vivante EGL video driver" ${UNIX_SYS}) set(SDL_SHARED ${SDL_SHARED_ENABLED_BY_DEFAULT} CACHE BOOL "Build a shared version of the library") set(SDL_STATIC ON CACHE BOOL "Build a static version of the library") +dep_option(SDL_STATIC_PIC "Static version of the library should be built with Position Independent Code" OFF "SDL_STATIC" OFF) + # General source files file(GLOB SOURCE_FILES ${SDL2_SOURCE_DIR}/src/*.c @@ -334,6 +350,24 @@ set(HAVE_ASSERTIONS ${ASSERTIONS}) # Compiler option evaluation if(USE_GCC OR USE_CLANG) + # Check for -Wall first, so later things can override pieces of it. + check_c_compiler_flag(-Wall HAVE_GCC_WALL) + if(HAVE_GCC_WALL) + list(APPEND EXTRA_CFLAGS "-Wall") + if(HAIKU) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar") + endif() + endif() + + check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT) + if(HAVE_GCC_WDECLARATION_AFTER_STATEMENT) + check_c_compiler_flag(-Werror=declaration-after-statement HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT) + if(HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT) + list(APPEND EXTRA_CFLAGS "-Werror=declaration-after-statement") + endif() + list(APPEND EXTRA_CFLAGS "-Wdeclaration-after-statement") + endif() + if(DEPENDENCY_TRACKING) check_c_source_compiles(" #if !defined(__GNUC__) || __GNUC__ < 3 @@ -375,26 +409,16 @@ if(USE_GCC OR USE_CLANG) endif() set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) - check_c_compiler_flag(-Wall HAVE_GCC_WALL) - if(HAVE_GCC_WALL) - list(APPEND EXTRA_CFLAGS "-Wall") - if(HAIKU) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar") - endif() - endif() check_c_compiler_flag(-Wshadow HAVE_GCC_WSHADOW) if(HAVE_GCC_WSHADOW) list(APPEND EXTRA_CFLAGS "-Wshadow") endif() - # --no-undefined is unsupported with clang - if(NOT USE_CLANG) - set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined") - check_c_compiler_flag("" HAVE_NO_UNDEFINED) - set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) - if(HAVE_NO_UNDEFINED) - list(APPEND EXTRA_LDFLAGS "-Wl,--no-undefined") - endif() + set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined") + check_c_compiler_flag("" HAVE_NO_UNDEFINED) + set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) + if(HAVE_NO_UNDEFINED) + list(APPEND EXTRA_LDFLAGS "-Wl,--no-undefined") endif() endif() @@ -773,6 +797,16 @@ if(EMSCRIPTEN) set(SOURCE_FILES ${SOURCE_FILES} ${EM_POWER_SOURCES}) set(HAVE_SDL_POWER TRUE) endif() + if(SDL_TIMERS) + set(SDL_TIMER_UNIX 1) + file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES}) + set(HAVE_SDL_TIMERS TRUE) + + if(CLOCK_GETTIME) + set(HAVE_CLOCK_GETTIME 1) + endif() + endif() if(SDL_VIDEO) set(SDL_VIDEO_DRIVER_EMSCRIPTEN 1) file(GLOB EM_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/emscripten/*.c) @@ -839,7 +873,7 @@ elseif(UNIX AND NOT APPLE) #include #include - int main(int argc, char **argv) + int main(int argc, char **argv) { struct kbentry kbe; kbe.kb_table = KG_CTRL; @@ -866,8 +900,24 @@ elseif(UNIX AND NOT APPLE) check_include_file("libudev.h" HAVE_LIBUDEV_H) - # !!! FIXME: this needs pkg-config to find the include path, I think. - check_include_file("dbus/dbus.h" HAVE_DBUS_DBUS_H) + if(PKG_CONFIG_FOUND) + pkg_search_module(DBUS dbus-1 dbus) + if(DBUS_FOUND) + set(HAVE_DBUS_DBUS_H TRUE) + include_directories(${DBUS_INCLUDE_DIRS}) + list(APPEND EXTRA_LIBS ${DBUS_LIBRARIES}) + endif() + + pkg_search_module(IBUS ibus-1.0 ibus) + if(IBUS_FOUND) + set(HAVE_IBUS_IBUS_H TRUE) + include_directories(${IBUS_INCLUDE_DIRS}) + list(APPEND EXTRA_LIBS ${IBUS_LIBRARIES}) + endif() + endif() + + check_include_file("fcitx/frontend.h" HAVE_FCITX_FRONTEND_H) + endif() if(INPUT_TSLIB) @@ -936,7 +986,14 @@ elseif(UNIX AND NOT APPLE) if(RPATH) set(SDL_RLD_FLAGS "") if(BSDI OR FREEBSD OR LINUX OR NETBSD) - set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}") + set(CMAKE_REQUIRED_FLAGS "-Wl,--enable-new-dtags") + check_c_compiler_flag("" HAVE_ENABLE_NEW_DTAGS) + set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) + if(HAVE_ENABLE_NEW_DTAGS) + set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir} -Wl,--enable-new-dtags") + else() + set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}") + endif() elseif(SOLARIS) set(SDL_RLD_FLAGS "-R\${libdir}") endif() @@ -1108,7 +1165,7 @@ elseif(WINDOWS) set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) if(HAVE_DINPUT_H) set(SDL_JOYSTICK_DINPUT 1) - list(APPEND EXTRA_LIBS dinput8 dxguid) + list(APPEND EXTRA_LIBS dinput8) if(CMAKE_COMPILER_IS_MINGW) list(APPEND EXTRA_LIBS dxerr8) elseif (NOT USE_WINSDK_DIRECTX) @@ -1166,16 +1223,20 @@ elseif(APPLE) if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_COREAUDIO 1) - file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.c) + file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.m) set(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) set(SDL_FRAMEWORK_COREAUDIO 1) - set(SDL_FRAMEWORK_AUDIOUNIT 1) + set(SDL_FRAMEWORK_AUDIOTOOLBOX 1) endif() if(SDL_JOYSTICK) set(SDL_JOYSTICK_IOKIT 1) - file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c) + if (IOS) + file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m) + else() + file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c) + endif() set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) set(HAVE_SDL_JOYSTICK TRUE) set(SDL_FRAMEWORK_IOKIT 1) @@ -1184,7 +1245,12 @@ elseif(APPLE) if(SDL_HAPTIC) set(SDL_HAPTIC_IOKIT 1) - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c) + if (IOS) + file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/dummy/*.c) + set(SDL_HAPTIC_DUMMY 1) + else() + file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c) + endif() set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES}) set(HAVE_SDL_HAPTIC TRUE) set(SDL_FRAMEWORK_IOKIT 1) @@ -1196,7 +1262,11 @@ elseif(APPLE) if(SDL_POWER) set(SDL_POWER_MACOSX 1) - file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c) + if (IOS) + file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/uikit/*.m) + else() + file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c) + endif() set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES}) set(HAVE_SDL_POWER TRUE) set(SDL_FRAMEWORK_CARBON 1) @@ -1243,19 +1313,25 @@ elseif(APPLE) find_library(COREAUDIO CoreAudio) list(APPEND EXTRA_LIBS ${COREAUDIO}) endif() - if(SDL_FRAMEWORK_AUDIOUNIT) - find_library(AUDIOUNIT AudioUnit) - list(APPEND EXTRA_LIBS ${AUDIOUNIT}) + if(SDL_FRAMEWORK_AUDIOTOOLBOX) + find_library(AUDIOTOOLBOX AudioToolbox) + list(APPEND EXTRA_LIBS ${AUDIOTOOLBOX}) endif() # iOS hack needed - http://code.google.com/p/ios-cmake/ ? if(SDL_VIDEO) - CheckCOCOA() - if(VIDEO_OPENGL) - set(SDL_VIDEO_OPENGL 1) - set(SDL_VIDEO_OPENGL_CGL 1) - set(SDL_VIDEO_RENDER_OGL 1) - set(HAVE_VIDEO_OPENGL TRUE) + if (IOS) + set(SDL_VIDEO_DRIVER_UIKIT 1) + file(GLOB UIKITVIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/uikit/*.m) + set(SOURCE_FILES ${SOURCE_FILES} ${UIKITVIDEO_SOURCES}) + else() + CheckCOCOA() + if(VIDEO_OPENGL) + set(SDL_VIDEO_OPENGL 1) + set(SDL_VIDEO_OPENGL_CGL 1) + set(SDL_VIDEO_RENDER_OGL 1) + set(HAVE_VIDEO_OPENGL TRUE) + endif() endif() endif() @@ -1442,6 +1518,9 @@ message(STATUS " EXTRA_LIBS: ${EXTRA_LIBS}") message(STATUS "") message(STATUS " Build Shared Library: ${SDL_SHARED}") message(STATUS " Build Static Library: ${SDL_STATIC}") +if(SDL_STATIC) + message(STATUS " Build Static Library with Position Independent Code: ${SDL_STATIC_PIC}") +endif() message(STATUS "") if(UNIX) message(STATUS "If something was not detected, although the libraries") @@ -1458,7 +1537,7 @@ add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) set(_INSTALL_LIBS "SDL2main") if(SDL_SHARED) - add_library(SDL2 SHARED ${SOURCE_FILES}) + add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) if(UNIX) set_target_properties(SDL2 PROPERTIES VERSION ${LT_VERSION} @@ -1484,6 +1563,7 @@ if(SDL_STATIC) set (BUILD_SHARED_LIBS FALSE) add_library(SDL2-static STATIC ${SOURCE_FILES}) set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2") + set_target_properties(SDL2-static PROPERTIES POSITION_INDEPENDENT_CODE ${SDL_STATIC_PIC}) if(MSVC) set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB") set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB") @@ -1510,12 +1590,17 @@ endforeach() list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2) -if(NOT WINDOWS OR CYGWIN) +if(NOT (WINDOWS OR CYGWIN)) if(SDL_SHARED) + if (APPLE) + set(SOEXT "dylib") + else() + set(SOEXT "so") + endif() install(CODE " execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink - \"libSDL2-2.0.so\" \"libSDL2.so\")") - install(FILES ${SDL2_BINARY_DIR}/libSDL2.so DESTINATION "lib${LIB_SUFFIX}") + \"libSDL2-2.0.${SOEXT}\" \"libSDL2.${SOEXT}\")") + install(FILES ${SDL2_BINARY_DIR}/libSDL2.${SOEXT} DESTINATION "lib${LIB_SUFFIX}") endif() if(FREEBSD) # FreeBSD uses ${PREFIX}/libdata/pkgconfig @@ -1526,7 +1611,7 @@ if(NOT WINDOWS OR CYGWIN) endif() install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION bin) # TODO: what about the .spec file? Is it only needed for RPM creation? - install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "share/aclocal") + install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/aclocal") endif() ##### Uninstall target ##### diff --git a/Engine/lib/sdl/Makefile.in b/Engine/lib/sdl/Makefile.in index b66e0f5e2..a7cbddf26 100644 --- a/Engine/lib/sdl/Makefile.in +++ b/Engine/lib/sdl/Makefile.in @@ -3,6 +3,7 @@ top_builddir = . srcdir = @srcdir@ objects = build +gen = gen prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ @@ -31,6 +32,8 @@ WINDRES = @WINDRES@ TARGET = libSDL2.la OBJECTS = @OBJECTS@ +GEN_HEADERS = @GEN_HEADERS@ +GEN_OBJECTS = @GEN_OBJECTS@ VERSION_OBJECTS = @VERSION_OBJECTS@ SDLMAIN_TARGET = libSDL2main.a @@ -39,6 +42,8 @@ SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@ SDLTEST_TARGET = libSDL2_test.a SDLTEST_OBJECTS = @SDLTEST_OBJECTS@ +WAYLAND_SCANNER = @WAYLAND_SCANNER@ + SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.in debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS GEN_DIST = SDL2.spec @@ -48,6 +53,7 @@ RUN_CMD_CC = @echo " CC " $@; RUN_CMD_CXX = @echo " CXX " $@; RUN_CMD_LTLINK = @echo " LTLINK" $@; RUN_CMD_RANLIB = @echo " RANLIB" $@; +RUN_CMD_GEN = @echo " GEN " $@; LIBTOOL += --quiet endif @@ -137,8 +143,8 @@ update-revision: .PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d) -$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS) - $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) +$(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS) + $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS) $(RUN_CMD_AR)$(AR) cru $@ $(SDLMAIN_OBJECTS) @@ -200,6 +206,7 @@ uninstall-data: clean: rm -rf $(objects) + rm -rf $(gen) if test -f test/Makefile; then (cd test; $(MAKE) $@); fi distclean: clean diff --git a/Engine/lib/sdl/Makefile.pandora b/Engine/lib/sdl/Makefile.pandora index bb89d52a6..8b78f2734 100644 --- a/Engine/lib/sdl/Makefile.pandora +++ b/Engine/lib/sdl/Makefile.pandora @@ -19,7 +19,7 @@ SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \ ./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \ ./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \ ./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \ - ./src/atomic/linux/*.c ./src/filesystem/unix/*.c \ + ./src/atomic/*.c ./src/filesystem/unix/*.c \ ./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o ./src/video/x11/*.c diff --git a/Engine/lib/sdl/Makefile.psp b/Engine/lib/sdl/Makefile.psp index 5e7dcd29a..93fb9e447 100644 --- a/Engine/lib/sdl/Makefile.psp +++ b/Engine/lib/sdl/Makefile.psp @@ -49,6 +49,7 @@ OBJS= src/SDL.o \ src/stdlib/SDL_stdlib.o \ src/stdlib/SDL_string.o \ src/thread/SDL_thread.o \ + src/thread/generic/SDL_systls.o \ src/thread/psp/SDL_syssem.o \ src/thread/psp/SDL_systhread.o \ src/thread/psp/SDL_sysmutex.o \ diff --git a/Engine/lib/sdl/Makefile.wiz b/Engine/lib/sdl/Makefile.wiz index bb7705789..0981be853 100644 --- a/Engine/lib/sdl/Makefile.wiz +++ b/Engine/lib/sdl/Makefile.wiz @@ -9,8 +9,8 @@ STRIP = $(WIZSDK)/bin/arm-openwiz-linux-gnu-strip CFLAGS = -Wall -fPIC -I./include -I$(WIZSDK)/include -DWIZ_GLES_LITE -TARGET_STATIC = libSDL13.a -TARGET_SHARED = libSDL13.so +TARGET_STATIC = libSDL2.a +TARGET_SHARED = libSDL2.so SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \ ./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \ @@ -43,7 +43,7 @@ clean: install: mkdir -p $(WIZSDK)/lib - mkdir -p $(WIZSDK)/include/SDL13 + mkdir -p $(WIZSDK)/include/SDL2 cp -f $(TARGET_STATIC) $(WIZSDK)/lib cp -f $(TARGET_SHARED).0.0.1 $(WIZSDK)/lib rm -f $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED) @@ -57,5 +57,5 @@ install: ln -s ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED) cp $(TARGET_SHARED).0.0.1 ../nehe_demos/build/$(TARGET_SHARED).0 - cp -f include/*.h $(WIZSDK)/include/SDL13/ - cp -f include/*.h ../../toolchain/include/SDL13/ + cp -f include/*.h $(WIZSDK)/include/SDL2/ + cp -f include/*.h ../../toolchain/include/SDL2/ diff --git a/Engine/lib/sdl/README-SDL.txt b/Engine/lib/sdl/README-SDL.txt index fade0b958..8eaf051f7 100644 --- a/Engine/lib/sdl/README-SDL.txt +++ b/Engine/lib/sdl/README-SDL.txt @@ -2,8 +2,8 @@ Please distribute this file with the SDL runtime environment: The Simple DirectMedia Layer (SDL for short) is a cross-platform library -designed to make it easy to write multi-media software, such as games and -emulators. +designed to make it easy to write multi-media software, such as games +and emulators. The Simple DirectMedia Layer library source code is available from: http://www.libsdl.org/ diff --git a/Engine/lib/sdl/SDL2.spec b/Engine/lib/sdl/SDL2.spec index 0fe57540f..5dfda5802 100644 --- a/Engine/lib/sdl/SDL2.spec +++ b/Engine/lib/sdl/SDL2.spec @@ -1,6 +1,6 @@ Summary: Simple DirectMedia Layer Name: SDL2 -Version: 2.0.4 +Version: 2.0.5 Release: 2 Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz URL: http://www.libsdl.org/ diff --git a/Engine/lib/sdl/VisualC.html b/Engine/lib/sdl/VisualC.html index 89035d677..0631832e8 100644 --- a/Engine/lib/sdl/VisualC.html +++ b/Engine/lib/sdl/VisualC.html @@ -21,7 +21,7 @@

There are different solution files for the various - versions of the IDE. Please use the appropiate version + versions of the IDE. Please use the appropriate version 2008, 2010, 2012 or 2013.

@@ -101,7 +101,7 @@ files to project")

Instead of adding the files to your project it is more - desireable to add them to the linker options: Project|Properties|Linker|Command + desirable to add them to the linker options: Project|Properties|Linker|Command Line and type the names of the libraries to link with in the "Additional Options:" box.  Note: This must be done for each build configuration (e.g. Release,Debug).

diff --git a/Engine/lib/sdl/VisualC/clean.sh b/Engine/lib/sdl/VisualC/clean.sh deleted file mode 100644 index fd16f9a12..000000000 --- a/Engine/lib/sdl/VisualC/clean.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -find . -type f \( -name '*.user' -o -name '*.sdf' -o -name '*.ncb' -o -name '*.suo' \) -print -delete -find . -type f \( -name '*.bmp' -o -name '*.wav' -o -name '*.dat' \) -print -delete -find . -depth -type d \( -name Win32 -o -name x64 \) -exec rm -rv {} \; diff --git a/Engine/lib/sdl/WhatsNew.txt b/Engine/lib/sdl/WhatsNew.txt index 9b7139f5d..1979ac2b3 100644 --- a/Engine/lib/sdl/WhatsNew.txt +++ b/Engine/lib/sdl/WhatsNew.txt @@ -1,6 +1,69 @@ This is a list of major changes in SDL's version history. +--------------------------------------------------------------------------- +2.0.5: +--------------------------------------------------------------------------- + +General: +* Implemented audio capture support for some platforms +* Added SDL_DequeueAudio() to retrieve audio when buffer queuing is turned on for audio capture +* Added events for dragging and dropping text +* Added events for dragging and dropping multiple items +* By default the click raising a window will not be delivered to the SDL application. You can set the hint SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH to "1" to allow that click through to the window. +* Saving a surface with an alpha channel as a BMP will use a newer BMP format that supports alpha information. You can set the hint SDL_HINT_BMP_SAVE_LEGACY_FORMAT to "1" to use the old format. +* Added SDL_GetHintBoolean() to get the boolean value of a hint +* Added SDL_RenderSetIntegerScale() to set whether to smoothly scale or use integral multiples of the viewport size when scaling the rendering output +* Added SDL_CreateRGBSurfaceWithFormat() and SDL_CreateRGBSurfaceWithFormatFrom() to create an SDL surface with a specific pixel format +* Added SDL_GetDisplayUsableBounds() which returns the area usable for windows. For example, on Mac OS X, this subtracts the area occupied by the menu bar and dock. +* Added SDL_GetWindowBordersSize() which returns the size of the window's borders around the client area +* Added a window event SDL_WINDOWEVENT_HIT_TEST when a window had a hit test that wasn't SDL_HITTEST_NORMAL (e.g. in the title bar or window frame) +* Added SDL_SetWindowResizable() to change whether a window is resizable +* Added SDL_SetWindowOpacity() and SDL_GetWindowOpacity() to affect the window transparency +* Added SDL_SetWindowModalFor() to set a window as modal for another window +* Added support for AUDIO_U16LSB and AUDIO_U16MSB to SDL_MixAudioFormat() +* Fixed flipped images when reading back from target textures when using the OpenGL renderer +* Fixed texture color modulation with SDL_BLENDMODE_NONE when using the OpenGL renderer +* Fixed bug where the alpha value of colorkeys was ignored when blitting in some cases + +Windows: +* Added a hint SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING to prevent SDL from raising a debugger exception to name threads. This exception can cause problems with .NET applications when running under a debugger. +* The hint SDL_HINT_THREAD_STACK_SIZE is now supported on Windows +* Fixed XBox controller triggers automatically being pulled at startup +* The first icon from the executable is used as the default window icon at runtime +* Fixed SDL log messages being printed twice if SDL was built with C library support +* Reset dead keys when the SDL window loses focus, so dead keys pressed in SDL applications don't affect text input into other applications. + +Mac OS X: +* Fixed selecting the dummy video driver +* The caps lock key now generates a pressed event when pressed and a released event when released, instead of a press/release event pair when pressed. +* Fixed mouse wheel events on Mac OS X 10.12 +* The audio driver has been updated to use AVFoundation for better compatibility with newer versions of Mac OS X + +Linux: +* Added support for the Fcitx IME +* Added a window event SDL_WINDOWEVENT_TAKE_FOCUS when a window manager asks the SDL window whether it wants to take focus. +* Refresh rates are now rounded instead of truncated, e.g. 59.94 Hz is rounded up to 60 Hz instead of 59. +* Added initial support for touchscreens on Raspberry Pi + +OpenBSD: +* SDL_GetBasePath() is now implemented on OpenBSD + +iOS: +* Added support for dynamically loaded objects on iOS 8 and newer + +tvOS: +* Added support for Apple TV +* Added a hint SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION to control whether he Apple TV remote's joystick axes will automatically match the rotation of the remote. + +Android: +* Fixed SDL not resizing window when Android screen resolution changes +* Corrected the joystick Z axis reporting for the accelerometer + +Emscripten (running in a web browser): +* Many bug fixes and improvements + + --------------------------------------------------------------------------- 2.0.4: --------------------------------------------------------------------------- diff --git a/Engine/lib/sdl/Xcode/SDL/Info-Framework.plist b/Engine/lib/sdl/Xcode/SDL/Info-Framework.plist index bccaa8afc..da4183466 100644 --- a/Engine/lib/sdl/Xcode/SDL/Info-Framework.plist +++ b/Engine/lib/sdl/Xcode/SDL/Info-Framework.plist @@ -11,7 +11,7 @@ CFBundleIconFile CFBundleIdentifier - org.libsdl.SDL2 + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -19,10 +19,10 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.0.4 + 2.0.5 CFBundleSignature SDLX CFBundleVersion - 2.0.4 + 2.0.5 diff --git a/Engine/lib/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Engine/lib/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj old mode 100644 new mode 100755 index 9fc2a5019..1f16953cf --- a/Engine/lib/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Engine/lib/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -7,15 +7,9 @@ objects = { /* Begin PBXBuildFile section */ - 007317A20858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; }; - 007317A30858DECD00B2BC32 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; }; 007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; }; - 007317A50858DECD00B2BC32 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179E0858DECD00B2BC32 /* CoreAudio.framework */; }; 007317A60858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; }; - 007317A90858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; }; - 007317AA0858DECD00B2BC32 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; }; 007317AB0858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; }; - 007317AC0858DECD00B2BC32 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179E0858DECD00B2BC32 /* CoreAudio.framework */; }; 007317AD0858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; }; 007317C30858E15000B2BC32 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; }; 00CFA89D106B4BA100758660 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; }; @@ -57,14 +51,12 @@ 04BD000912E6671800899322 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; }; 04BD001012E6671800899322 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; }; 04BD001112E6671800899322 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */; }; - 04BD001812E6671800899322 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDA012E6671700899322 /* SDL_coreaudio.c */; }; 04BD001912E6671800899322 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDA112E6671700899322 /* SDL_coreaudio.h */; }; 04BD002612E6671800899322 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB412E6671700899322 /* SDL_audio.c */; }; 04BD002712E6671800899322 /* SDL_audio_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB512E6671700899322 /* SDL_audio_c.h */; }; 04BD002812E6671800899322 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB612E6671700899322 /* SDL_audiocvt.c */; }; 04BD002912E6671800899322 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB712E6671700899322 /* SDL_audiodev.c */; }; 04BD002A12E6671800899322 /* SDL_audiodev_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */; }; - 04BD002B12E6671800899322 /* SDL_audiomem.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB912E6671700899322 /* SDL_audiomem.h */; }; 04BD002C12E6671800899322 /* SDL_audiotypecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */; }; 04BD002D12E6671800899322 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBB12E6671700899322 /* SDL_mixer.c */; }; 04BD003412E6671800899322 /* SDL_sysaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC212E6671700899322 /* SDL_sysaudio.h */; }; @@ -211,14 +203,12 @@ 04BD022512E6671800899322 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; }; 04BD022C12E6671800899322 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; }; 04BD022D12E6671800899322 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */; }; - 04BD023412E6671800899322 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDA012E6671700899322 /* SDL_coreaudio.c */; }; 04BD023512E6671800899322 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDA112E6671700899322 /* SDL_coreaudio.h */; }; 04BD024212E6671800899322 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB412E6671700899322 /* SDL_audio.c */; }; 04BD024312E6671800899322 /* SDL_audio_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB512E6671700899322 /* SDL_audio_c.h */; }; 04BD024412E6671800899322 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB612E6671700899322 /* SDL_audiocvt.c */; }; 04BD024512E6671800899322 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB712E6671700899322 /* SDL_audiodev.c */; }; 04BD024612E6671800899322 /* SDL_audiodev_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */; }; - 04BD024712E6671800899322 /* SDL_audiomem.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB912E6671700899322 /* SDL_audiomem.h */; }; 04BD024812E6671800899322 /* SDL_audiotypecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */; }; 04BD024912E6671800899322 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBB12E6671700899322 /* SDL_mixer.c */; }; 04BD025012E6671800899322 /* SDL_sysaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC212E6671700899322 /* SDL_sysaudio.h */; }; @@ -387,6 +377,10 @@ 04F7805D12FB74A200FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804512FB74A200FC43C0 /* SDL_drawline.h */; }; 04F7805E12FB74A200FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */; }; 04F7805F12FB74A200FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */; }; + 562C4AE91D8F496200AF9EBE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7381E931D8B69C300B177DD /* AudioToolbox.framework */; }; + 562C4AEA1D8F496300AF9EBE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7381E931D8B69C300B177DD /* AudioToolbox.framework */; }; + 562D3C7C1D8F4933003FEEE6 /* SDL_coreaudio.m in Sources */ = {isa = PBXBuildFile; fileRef = FABA34C61D8B5DB100915323 /* SDL_coreaudio.m */; }; + 562D3C7D1D8F4933003FEEE6 /* SDL_coreaudio.m in Sources */ = {isa = PBXBuildFile; fileRef = FABA34C61D8B5DB100915323 /* SDL_coreaudio.m */; }; 566CDE8F148F0AC200C5A9BB /* SDL_dropevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 566CDE8D148F0AC200C5A9BB /* SDL_dropevents_c.h */; }; 566CDE90148F0AC200C5A9BB /* SDL_dropevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 566CDE8E148F0AC200C5A9BB /* SDL_dropevents.c */; }; 567E2F1C17C44BB2005F1892 /* SDL_sysfilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 567E2F1B17C44BB2005F1892 /* SDL_sysfilesystem.m */; }; @@ -406,6 +400,12 @@ 56A6702A185654B40007D20F /* SDL_dynapi_overrides.h in Headers */ = {isa = PBXBuildFile; fileRef = 56A67020185654B40007D20F /* SDL_dynapi_overrides.h */; }; 56A6702B185654B40007D20F /* SDL_dynapi_overrides.h in Headers */ = {isa = PBXBuildFile; fileRef = 56A67020185654B40007D20F /* SDL_dynapi_overrides.h */; }; 56A6702C185654B40007D20F /* SDL_dynapi_overrides.h in Headers */ = {isa = PBXBuildFile; fileRef = 56A67020185654B40007D20F /* SDL_dynapi_overrides.h */; }; + 56C5237E1D8F4985001F2F30 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7381E951D8B69D600B177DD /* CoreAudio.framework */; }; + 56C5237F1D8F4985001F2F30 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7381E951D8B69D600B177DD /* CoreAudio.framework */; }; + 56C523801D8F498B001F2F30 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00D0D08310675DD9004B05EF /* CoreFoundation.framework */; }; + 56C523811D8F498C001F2F30 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00D0D08310675DD9004B05EF /* CoreFoundation.framework */; }; + A7381E961D8B69D600B177DD /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7381E951D8B69D600B177DD /* CoreAudio.framework */; }; + A7381E971D8B6A0300B177DD /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7381E931D8B69C300B177DD /* AudioToolbox.framework */; }; A77E6EB4167AB0A90010E40B /* SDL_gamecontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */; settings = {ATTRIBUTES = (Public, ); }; }; A77E6EB5167AB0A90010E40B /* SDL_gamecontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */; settings = {ATTRIBUTES = (Public, ); }; }; AA0AD09D16648D1700CE5896 /* SDL_gamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = BBFC088A164C6514003E6A99 /* SDL_gamecontroller.c */; }; @@ -563,7 +563,6 @@ DB313F7617554B71006C0E22 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDA112E6671700899322 /* SDL_coreaudio.h */; }; DB313F7717554B71006C0E22 /* SDL_audio_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB512E6671700899322 /* SDL_audio_c.h */; }; DB313F7817554B71006C0E22 /* SDL_audiodev_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */; }; - DB313F7917554B71006C0E22 /* SDL_audiomem.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB912E6671700899322 /* SDL_audiomem.h */; }; DB313F7A17554B71006C0E22 /* SDL_sysaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC212E6671700899322 /* SDL_sysaudio.h */; }; DB313F7B17554B71006C0E22 /* SDL_wave.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC412E6671700899322 /* SDL_wave.h */; }; DB313F7C17554B71006C0E22 /* blank_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD612E6671700899322 /* blank_cursor.h */; }; @@ -698,7 +697,6 @@ DB313FFF17554B71006C0E22 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7512E6671700899322 /* SDL_spinlock.c */; }; DB31400017554B71006C0E22 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD8812E6671700899322 /* SDL_diskaudio.c */; }; DB31400117554B71006C0E22 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; }; - DB31400217554B71006C0E22 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDA012E6671700899322 /* SDL_coreaudio.c */; }; DB31400317554B71006C0E22 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB412E6671700899322 /* SDL_audio.c */; }; DB31400417554B71006C0E22 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB612E6671700899322 /* SDL_audiocvt.c */; }; DB31400517554B71006C0E22 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB712E6671700899322 /* SDL_audiodev.c */; }; @@ -802,10 +800,7 @@ DB31406817554B71006C0E22 /* SDL_x11xinput2.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628ACF159367F2005138DD /* SDL_x11xinput2.c */; }; DB31406917554B71006C0E22 /* SDL_x11messagebox.c in Sources */ = {isa = PBXBuildFile; fileRef = AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */; }; DB31406A17554B71006C0E22 /* SDL_cocoamessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC38C164063D200AB8930 /* SDL_cocoamessagebox.m */; }; - DB31406C17554B71006C0E22 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; }; - DB31406D17554B71006C0E22 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; }; DB31406E17554B71006C0E22 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; }; - DB31406F17554B71006C0E22 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179E0858DECD00B2BC32 /* CoreAudio.framework */; }; DB31407017554B71006C0E22 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; }; DB31407217554B71006C0E22 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; }; DB31408B17554D37006C0E22 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; }; @@ -813,6 +808,7 @@ FA73671D19A540EF004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; }; FA73671E19A54140004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; }; FA73671F19A54144004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; }; + FABA34C71D8B5DB100915323 /* SDL_coreaudio.m in Sources */ = {isa = PBXBuildFile; fileRef = FABA34C61D8B5DB100915323 /* SDL_coreaudio.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -826,10 +822,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; - 0073179C0858DECD00B2BC32 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; 0073179D0858DECD00B2BC32 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 0073179E0858DECD00B2BC32 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 0073179F0858DECD00B2BC32 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 007317C10858E15000B2BC32 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 00794D3F09D0C461003FC8A1 /* License.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = License.txt; sourceTree = ""; }; @@ -857,14 +850,12 @@ 04BDFD8912E6671700899322 /* SDL_diskaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_diskaudio.h; sourceTree = ""; }; 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dummyaudio.c; sourceTree = ""; }; 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dummyaudio.h; sourceTree = ""; }; - 04BDFDA012E6671700899322 /* SDL_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_coreaudio.c; sourceTree = ""; }; 04BDFDA112E6671700899322 /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_coreaudio.h; sourceTree = ""; }; 04BDFDB412E6671700899322 /* SDL_audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audio.c; sourceTree = ""; }; 04BDFDB512E6671700899322 /* SDL_audio_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio_c.h; sourceTree = ""; }; 04BDFDB612E6671700899322 /* SDL_audiocvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiocvt.c; sourceTree = ""; }; 04BDFDB712E6671700899322 /* SDL_audiodev.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiodev.c; sourceTree = ""; }; 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audiodev_c.h; sourceTree = ""; }; - 04BDFDB912E6671700899322 /* SDL_audiomem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audiomem.h; sourceTree = ""; }; 04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiotypecvt.c; sourceTree = ""; }; 04BDFDBB12E6671700899322 /* SDL_mixer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_mixer.c; sourceTree = ""; }; 04BDFDC212E6671700899322 /* SDL_sysaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysaudio.h; sourceTree = ""; }; @@ -1027,6 +1018,8 @@ 56A6701E185654B40007D20F /* SDL_dynapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_dynapi.c; path = ../../src/dynapi/SDL_dynapi.c; sourceTree = ""; }; 56A6701F185654B40007D20F /* SDL_dynapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_dynapi.h; path = ../../src/dynapi/SDL_dynapi.h; sourceTree = ""; }; 56A67020185654B40007D20F /* SDL_dynapi_overrides.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_dynapi_overrides.h; path = ../../src/dynapi/SDL_dynapi_overrides.h; sourceTree = ""; }; + A7381E931D8B69C300B177DD /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + A7381E951D8B69D600B177DD /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gamecontroller.h; sourceTree = ""; }; AA0F8490178D5ECC00823F9D /* SDL_systls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systls.c; sourceTree = ""; }; AA628AC8159367B7005138DD /* SDL_rotate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rotate.c; sourceTree = ""; }; @@ -1106,6 +1099,7 @@ F59C710600D5CB5801000001 /* SDL.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SDL.info; sourceTree = ""; }; F5A2EF3900C6A39A01000001 /* BUGS.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = BUGS.txt; path = ../../BUGS.txt; sourceTree = SOURCE_ROOT; }; FA73671C19A540EF004122E4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = ""; }; + FABA34C61D8B5DB100915323 /* SDL_coreaudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_coreaudio.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1113,11 +1107,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A7381E971D8B6A0300B177DD /* AudioToolbox.framework in Frameworks */, + A7381E961D8B69D600B177DD /* CoreAudio.framework in Frameworks */, FA73671D19A540EF004122E4 /* CoreVideo.framework in Frameworks */, - 007317A20858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */, - 007317A30858DECD00B2BC32 /* AudioUnit.framework in Frameworks */, 007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */, - 007317A50858DECD00B2BC32 /* CoreAudio.framework in Frameworks */, 007317A60858DECD00B2BC32 /* IOKit.framework in Frameworks */, 00D0D08410675DD9004B05EF /* CoreFoundation.framework in Frameworks */, 00D0D0D810675E46004B05EF /* Carbon.framework in Frameworks */, @@ -1129,14 +1122,14 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 56C5237E1D8F4985001F2F30 /* CoreAudio.framework in Frameworks */, FA73671E19A54140004122E4 /* CoreVideo.framework in Frameworks */, - 007317A90858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */, - 007317AA0858DECD00B2BC32 /* AudioUnit.framework in Frameworks */, 007317AB0858DECD00B2BC32 /* Cocoa.framework in Frameworks */, - 007317AC0858DECD00B2BC32 /* CoreAudio.framework in Frameworks */, 007317AD0858DECD00B2BC32 /* IOKit.framework in Frameworks */, + 56C523801D8F498B001F2F30 /* CoreFoundation.framework in Frameworks */, 007317C30858E15000B2BC32 /* Carbon.framework in Frameworks */, DB31408B17554D37006C0E22 /* ForceFeedback.framework in Frameworks */, + 562C4AE91D8F496200AF9EBE /* AudioToolbox.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1144,14 +1137,14 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 56C5237F1D8F4985001F2F30 /* CoreAudio.framework in Frameworks */, FA73671F19A54144004122E4 /* CoreVideo.framework in Frameworks */, - DB31406C17554B71006C0E22 /* AudioToolbox.framework in Frameworks */, - DB31406D17554B71006C0E22 /* AudioUnit.framework in Frameworks */, DB31406E17554B71006C0E22 /* Cocoa.framework in Frameworks */, - DB31406F17554B71006C0E22 /* CoreAudio.framework in Frameworks */, DB31407017554B71006C0E22 /* IOKit.framework in Frameworks */, + 56C523811D8F498C001F2F30 /* CoreFoundation.framework in Frameworks */, DB31407217554B71006C0E22 /* Carbon.framework in Frameworks */, DB31408D17554D3C006C0E22 /* ForceFeedback.framework in Frameworks */, + 562C4AEA1D8F496300AF9EBE /* AudioToolbox.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1307,7 +1300,6 @@ 04BDFDB612E6671700899322 /* SDL_audiocvt.c */, 04BDFDB712E6671700899322 /* SDL_audiodev.c */, 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */, - 04BDFDB912E6671700899322 /* SDL_audiomem.h */, 04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */, 04BDFDBB12E6671700899322 /* SDL_mixer.c */, 04BDFDC212E6671700899322 /* SDL_sysaudio.h */, @@ -1339,8 +1331,8 @@ 04BDFD9F12E6671700899322 /* coreaudio */ = { isa = PBXGroup; children = ( - 04BDFDA012E6671700899322 /* SDL_coreaudio.c */, 04BDFDA112E6671700899322 /* SDL_coreaudio.h */, + FABA34C61D8B5DB100915323 /* SDL_coreaudio.m */, ); path = coreaudio; sourceTree = ""; @@ -1737,13 +1729,12 @@ BEC562FE0761C0E800A33029 /* Linked Frameworks */ = { isa = PBXGroup; children = ( + A7381E931D8B69C300B177DD /* AudioToolbox.framework */, + A7381E951D8B69D600B177DD /* CoreAudio.framework */, FA73671C19A540EF004122E4 /* CoreVideo.framework */, 00D0D08310675DD9004B05EF /* CoreFoundation.framework */, 007317C10858E15000B2BC32 /* Carbon.framework */, - 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */, - 0073179C0858DECD00B2BC32 /* AudioUnit.framework */, 0073179D0858DECD00B2BC32 /* Cocoa.framework */, - 0073179E0858DECD00B2BC32 /* CoreAudio.framework */, 0073179F0858DECD00B2BC32 /* IOKit.framework */, 00CFA89C106B4BA100758660 /* ForceFeedback.framework */, ); @@ -1840,7 +1831,6 @@ 04BD001912E6671800899322 /* SDL_coreaudio.h in Headers */, 04BD002712E6671800899322 /* SDL_audio_c.h in Headers */, 04BD002A12E6671800899322 /* SDL_audiodev_c.h in Headers */, - 04BD002B12E6671800899322 /* SDL_audiomem.h in Headers */, 04BD003412E6671800899322 /* SDL_sysaudio.h in Headers */, 04BD003612E6671800899322 /* SDL_wave.h in Headers */, 04BD004212E6671800899322 /* blank_cursor.h in Headers */, @@ -1996,7 +1986,6 @@ 04BD024312E6671800899322 /* SDL_audio_c.h in Headers */, 04BD024612E6671800899322 /* SDL_audiodev_c.h in Headers */, AAC070FD195606770073DCDF /* SDL_opengles2_gl2.h in Headers */, - 04BD024712E6671800899322 /* SDL_audiomem.h in Headers */, 04BD025012E6671800899322 /* SDL_sysaudio.h in Headers */, 04BD025212E6671800899322 /* SDL_wave.h in Headers */, 04BD025D12E6671800899322 /* blank_cursor.h in Headers */, @@ -2151,7 +2140,6 @@ DB313F7717554B71006C0E22 /* SDL_audio_c.h in Headers */, DB313F7817554B71006C0E22 /* SDL_audiodev_c.h in Headers */, AAC070FE195606770073DCDF /* SDL_opengles2_gl2.h in Headers */, - DB313F7917554B71006C0E22 /* SDL_audiomem.h in Headers */, DB313F7A17554B71006C0E22 /* SDL_sysaudio.h in Headers */, DB313F7B17554B71006C0E22 /* SDL_wave.h in Headers */, DB313F7C17554B71006C0E22 /* blank_cursor.h in Headers */, @@ -2323,7 +2311,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0630; + LastUpgradeCheck = 0730; TargetAttributes = { BECDF5FE0761BA81005FE872 = { DevelopmentTeam = EH385AYQ6F; @@ -2404,7 +2392,6 @@ 04BDFFFC12E6671800899322 /* SDL_spinlock.c in Sources */, 04BD000812E6671800899322 /* SDL_diskaudio.c in Sources */, 04BD001012E6671800899322 /* SDL_dummyaudio.c in Sources */, - 04BD001812E6671800899322 /* SDL_coreaudio.c in Sources */, 04BD002612E6671800899322 /* SDL_audio.c in Sources */, 04BD002812E6671800899322 /* SDL_audiocvt.c in Sources */, 04BD002912E6671800899322 /* SDL_audiodev.c in Sources */, @@ -2440,6 +2427,7 @@ 04BD00A812E6671800899322 /* SDL_string.c in Sources */, 04BD00BD12E6671800899322 /* SDL_syscond.c in Sources */, 04BD00BE12E6671800899322 /* SDL_sysmutex.c in Sources */, + FABA34C71D8B5DB100915323 /* SDL_coreaudio.m in Sources */, 04BD00C012E6671800899322 /* SDL_syssem.c in Sources */, 04BD00C112E6671800899322 /* SDL_systhread.c in Sources */, 04BD00CA12E6671800899322 /* SDL_thread.c in Sources */, @@ -2523,7 +2511,6 @@ 04BD021812E6671800899322 /* SDL_spinlock.c in Sources */, 04BD022412E6671800899322 /* SDL_diskaudio.c in Sources */, 04BD022C12E6671800899322 /* SDL_dummyaudio.c in Sources */, - 04BD023412E6671800899322 /* SDL_coreaudio.c in Sources */, 04BD024212E6671800899322 /* SDL_audio.c in Sources */, 04BD024412E6671800899322 /* SDL_audiocvt.c in Sources */, 04BD024512E6671800899322 /* SDL_audiodev.c in Sources */, @@ -2559,6 +2546,7 @@ 04BD02C012E6671800899322 /* SDL_qsort.c in Sources */, 04BD02C112E6671800899322 /* SDL_stdlib.c in Sources */, 04BD02C212E6671800899322 /* SDL_string.c in Sources */, + 562D3C7C1D8F4933003FEEE6 /* SDL_coreaudio.m in Sources */, 04BD02D712E6671800899322 /* SDL_syscond.c in Sources */, 04BD02D812E6671800899322 /* SDL_sysmutex.c in Sources */, 04BD02DA12E6671800899322 /* SDL_syssem.c in Sources */, @@ -2642,7 +2630,6 @@ DB313FFF17554B71006C0E22 /* SDL_spinlock.c in Sources */, DB31400017554B71006C0E22 /* SDL_diskaudio.c in Sources */, DB31400117554B71006C0E22 /* SDL_dummyaudio.c in Sources */, - DB31400217554B71006C0E22 /* SDL_coreaudio.c in Sources */, DB31400317554B71006C0E22 /* SDL_audio.c in Sources */, DB31400417554B71006C0E22 /* SDL_audiocvt.c in Sources */, DB31400517554B71006C0E22 /* SDL_audiodev.c in Sources */, @@ -2678,6 +2665,7 @@ DB31402417554B71006C0E22 /* SDL_qsort.c in Sources */, DB31402517554B71006C0E22 /* SDL_stdlib.c in Sources */, DB31402617554B71006C0E22 /* SDL_string.c in Sources */, + 562D3C7D1D8F4933003FEEE6 /* SDL_coreaudio.m in Sources */, DB31402717554B71006C0E22 /* SDL_syscond.c in Sources */, DB31402817554B71006C0E22 /* SDL_sysmutex.c in Sources */, DB31402917554B71006C0E22 /* SDL_syssem.c in Sources */, @@ -2767,14 +2755,31 @@ 00CFA621106A567900758660 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEPLOYMENT_POSTPROCESSING = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_ALTIVEC_EXTENSIONS = YES; GCC_AUTO_VECTORIZATION = YES; GCC_ENABLE_SSE3_EXTENSIONS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 3; GCC_SYMBOLS_PRIVATE_EXTERN = YES; - MACOSX_DEPLOYMENT_TARGET = 10.5; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.6; SDKROOT = macosx; STRIP_STYLE = "non-global"; }; @@ -2783,15 +2788,17 @@ 00CFA622106A567900758660 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_LINK_OBJC_RUNTIME = NO; COMBINE_HIDPI_IMAGES = YES; DYLIB_COMPATIBILITY_VERSION = 1.0.0; - DYLIB_CURRENT_VERSION = 5.0.0; + DYLIB_CURRENT_VERSION = 5.1.0; FRAMEWORK_VERSION = A; HEADER_SEARCH_PATHS = /usr/X11R6/include; INFOPLIST_FILE = "Info-Framework.plist"; INSTALL_PATH = "@rpath"; OTHER_LDFLAGS = "-liconv"; + PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL2; PRODUCT_NAME = SDL2; PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = framework; @@ -2827,12 +2834,30 @@ 00CFA627106A568900758660 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_ALTIVEC_EXTENSIONS = YES; GCC_AUTO_VECTORIZATION = YES; GCC_ENABLE_SSE3_EXTENSIONS = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_SYMBOLS_PRIVATE_EXTERN = YES; - MACOSX_DEPLOYMENT_TARGET = 10.5; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.6; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; STRIP_INSTALLED_PRODUCT = NO; @@ -2842,15 +2867,17 @@ 00CFA628106A568900758660 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_LINK_OBJC_RUNTIME = NO; COMBINE_HIDPI_IMAGES = YES; DYLIB_COMPATIBILITY_VERSION = 1.0.0; - DYLIB_CURRENT_VERSION = 5.0.0; + DYLIB_CURRENT_VERSION = 5.1.0; FRAMEWORK_VERSION = A; HEADER_SEARCH_PATHS = /usr/X11R6/include; INFOPLIST_FILE = "Info-Framework.plist"; INSTALL_PATH = "@rpath"; OTHER_LDFLAGS = "-liconv"; + PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL2; PRODUCT_NAME = SDL2; PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = framework; diff --git a/Engine/lib/sdl/Xcode/SDL/pkg-support/SDL.info b/Engine/lib/sdl/Xcode/SDL/pkg-support/SDL.info old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/Xcode/SDL/pkg-support/resources/ReadMe.txt b/Engine/lib/sdl/Xcode/SDL/pkg-support/resources/ReadMe.txt old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj b/Engine/lib/sdl/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj old mode 100644 new mode 100755 index 59cdd631b..144d24ca5 --- a/Engine/lib/sdl/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +++ b/Engine/lib/sdl/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj @@ -3934,7 +3934,7 @@ ); GCC_OPTIMIZATION_LEVEL = 0; HEADER_SEARCH_PATHS = ../../include; - MACOSX_DEPLOYMENT_TARGET = 10.5; + MACOSX_DEPLOYMENT_TARGET = 10.6; }; name = Debug; }; @@ -4060,7 +4060,7 @@ ); GCC_GENERATE_DEBUGGING_SYMBOLS = NO; HEADER_SEARCH_PATHS = ../../include; - MACOSX_DEPLOYMENT_TARGET = 10.5; + MACOSX_DEPLOYMENT_TARGET = 10.6; }; name = Release; }; diff --git a/Engine/lib/sdl/autogen.sh b/Engine/lib/sdl/autogen.sh old mode 100644 new mode 100755 index 649d7b31e..3e958e195 --- a/Engine/lib/sdl/autogen.sh +++ b/Engine/lib/sdl/autogen.sh @@ -3,6 +3,10 @@ echo "Generating build information using autoconf" echo "This may take a while ..." +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. +pushd $srcdir + # Regenerate configuration files cat acinclude/* >aclocal.m4 found=false @@ -15,5 +19,7 @@ if test x$found = xfalse; then fi (cd test; sh autogen.sh) +popd + # Run configure for this platform echo "Now you are ready to run ./configure" diff --git a/Engine/lib/sdl/build-scripts/androidbuild.sh b/Engine/lib/sdl/build-scripts/androidbuild.sh old mode 100644 new mode 100755 index 8ca3c916d..fb48e2e5b --- a/Engine/lib/sdl/build-scripts/androidbuild.sh +++ b/Engine/lib/sdl/build-scripts/androidbuild.sh @@ -87,8 +87,8 @@ else fi cp -r $SDLPATH/Android.mk $BUILDPATH/jni/SDL -sed -i "s|YourSourceHere.c|$MKSOURCES|g" $BUILDPATH/jni/src/Android.mk -sed -i "s|org\.libsdl\.app|$APP|g" $BUILDPATH/AndroidManifest.xml +sed -i -e "s|YourSourceHere.c|$MKSOURCES|g" $BUILDPATH/jni/src/Android.mk +sed -i -e "s|org\.libsdl\.app|$APP|g" $BUILDPATH/AndroidManifest.xml # Copy user sources for src in "${SOURCES[@]}" @@ -105,8 +105,8 @@ do done ACTIVITY="${folder}Activity" -sed -i "s|SDLActivity|$ACTIVITY|g" $BUILDPATH/AndroidManifest.xml -sed -i "s|SDLActivity|$APP|g" $BUILDPATH/build.xml +sed -i -e "s|SDLActivity|$ACTIVITY|g" $BUILDPATH/AndroidManifest.xml +sed -i -e "s|SDLActivity|$APP|g" $BUILDPATH/build.xml # Fill in a default Activity echo "package $APP;" > "$ACTIVITY.java" diff --git a/Engine/lib/sdl/build-scripts/checker-buildbot.sh b/Engine/lib/sdl/build-scripts/checker-buildbot.sh old mode 100644 new mode 100755 index 682e7fbbb..eb014311a --- a/Engine/lib/sdl/build-scripts/checker-buildbot.sh +++ b/Engine/lib/sdl/build-scripts/checker-buildbot.sh @@ -61,13 +61,13 @@ mkdir checker-buildbot cd checker-buildbot # You might want to do this for CMake-backed builds instead... -PATH="$CHECKERDIR:$PATH" scan-build -o analysis cmake -DCMAKE_BUILD_TYPE=Debug .. +PATH="$CHECKERDIR:$PATH" scan-build -o analysis cmake -DCMAKE_BUILD_TYPE=Debug -DASSERTIONS=enabled .. # ...or run configure without the scan-build wrapper... -#CC="$CHECKERDIR/libexec/ccc-analyzer" CFLAGS="-O0" ../configure +#CC="$CHECKERDIR/libexec/ccc-analyzer" CFLAGS="-O0" ../configure --enable-assertions=enabled # ...but this works for our buildbots just fine (EXCEPT ON LATEST MAC OS X). -#CFLAGS="-O0" PATH="$CHECKERDIR:$PATH" scan-build -o analysis ../configure +#CFLAGS="-O0" PATH="$CHECKERDIR:$PATH" scan-build -o analysis ../configure --enable-assertions=enabled rm -rf analysis PATH="$CHECKERDIR:$PATH" scan-build -o analysis $MAKE diff --git a/Engine/lib/sdl/build-scripts/emscripten-buildbot.sh b/Engine/lib/sdl/build-scripts/emscripten-buildbot.sh old mode 100644 new mode 100755 index db5fb8184..42eebb697 --- a/Engine/lib/sdl/build-scripts/emscripten-buildbot.sh +++ b/Engine/lib/sdl/build-scripts/emscripten-buildbot.sh @@ -51,13 +51,14 @@ mkdir buildbot pushd buildbot echo "Configuring..." -emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2 -Wno-warn-absolute-paths -Wdeclaration-after-statement -Werror=declaration-after-statement" --prefix="$PWD/emscripten-sdl2-installed" +emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2 -Wno-warn-absolute-paths -Wdeclaration-after-statement -Werror=declaration-after-statement" --prefix="$PWD/emscripten-sdl2-installed" || exit $? echo "Building..." -emmake $MAKE +emmake $MAKE || exit $? echo "Moving things around..." -emmake $MAKE install +emmake $MAKE install || exit $? + # Fix up a few things to a real install path perl -w -pi -e "s#$PWD/emscripten-sdl2-installed#/usr/local#g;" ./emscripten-sdl2-installed/lib/libSDL2.la ./emscripten-sdl2-installed/lib/pkgconfig/sdl2.pc ./emscripten-sdl2-installed/bin/sdl2-config mkdir -p ./usr diff --git a/Engine/lib/sdl/build-scripts/g++-fat.sh b/Engine/lib/sdl/build-scripts/g++-fat.sh old mode 100644 new mode 100755 index 29b04302f..0dbe99039 --- a/Engine/lib/sdl/build-scripts/g++-fat.sh +++ b/Engine/lib/sdl/build-scripts/g++-fat.sh @@ -6,11 +6,11 @@ DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer" -# Intel 32-bit compiler flags (10.5 runtime compatibility) -GCC_COMPILE_X86="g++ -arch i386 -mmacosx-version-min=10.5 \ +# Intel 32-bit compiler flags (10.6 runtime compatibility) +GCC_COMPILE_X86="g++ -arch i386 -mmacosx-version-min=10.6 \ -I/usr/local/include" -GCC_LINK_X86="-mmacosx-version-min=10.5" +GCC_LINK_X86="-mmacosx-version-min=10.6" # Intel 64-bit compiler flags (10.6 runtime compatibility) GCC_COMPILE_X64="g++ -arch x86_64 -mmacosx-version-min=10.6 \ diff --git a/Engine/lib/sdl/build-scripts/gcc-fat.sh b/Engine/lib/sdl/build-scripts/gcc-fat.sh old mode 100644 new mode 100755 index e556c1dd1..65f759d4a --- a/Engine/lib/sdl/build-scripts/gcc-fat.sh +++ b/Engine/lib/sdl/build-scripts/gcc-fat.sh @@ -6,15 +6,15 @@ DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer" -# Intel 32-bit compiler flags (10.5 runtime compatibility) -GCC_COMPILE_X86="gcc -arch i386 -mmacosx-version-min=10.5 \ +# Intel 32-bit compiler flags (10.6 runtime compatibility) +GCC_COMPILE_X86="gcc -arch i386 -mmacosx-version-min=10.6 \ -I/usr/local/include" -GCC_LINK_X86="-mmacosx-version-min=10.5" +GCC_LINK_X86="-mmacosx-version-min=10.6" # Intel 64-bit compiler flags (10.6 runtime compatibility) GCC_COMPILE_X64="gcc -arch x86_64 -mmacosx-version-min=10.6 \ --DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \ +-DMAC_OS_X_VERSION_MIN_REQUIRED=1060 \ -I/usr/local/include" GCC_LINK_X64="-mmacosx-version-min=10.6" diff --git a/Engine/lib/sdl/build-scripts/install-sh b/Engine/lib/sdl/build-scripts/install-sh old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/build-scripts/iosbuild.sh b/Engine/lib/sdl/build-scripts/iosbuild.sh old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/build-scripts/ltmain.sh b/Engine/lib/sdl/build-scripts/ltmain.sh old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/build-scripts/mkinstalldirs b/Engine/lib/sdl/build-scripts/mkinstalldirs old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/build-scripts/nacl-buildbot.sh b/Engine/lib/sdl/build-scripts/nacl-buildbot.sh old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/build-scripts/naclbuild.sh b/Engine/lib/sdl/build-scripts/naclbuild.sh old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/build-scripts/raspberrypi-buildbot.sh b/Engine/lib/sdl/build-scripts/raspberrypi-buildbot.sh old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/build-scripts/showrev.sh b/Engine/lib/sdl/build-scripts/showrev.sh old mode 100644 new mode 100755 index 2a68fe694..517992d9c --- a/Engine/lib/sdl/build-scripts/showrev.sh +++ b/Engine/lib/sdl/build-scripts/showrev.sh @@ -2,6 +2,4 @@ # # Print the current source revision, if available -# FIXME: this prints the tip, which isn't useful if you're on a different -# branch, or just not sync'd to the tip. -hg tip --template 'hg-{rev}:{node|short}' || (echo "hg-0:baadf00d"; exit 1) +hg parents --template 'hg-{rev}:{node|short}' || (echo "hg-0:baadf00d"; exit 1) diff --git a/Engine/lib/sdl/build-scripts/strip_fPIC.sh b/Engine/lib/sdl/build-scripts/strip_fPIC.sh old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/build-scripts/update-copyright.sh b/Engine/lib/sdl/build-scripts/update-copyright.sh old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/build-scripts/updaterev.sh b/Engine/lib/sdl/build-scripts/updaterev.sh old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/cmake/sdlchecks.cmake b/Engine/lib/sdl/cmake/sdlchecks.cmake index 7ff0985fd..b10078192 100644 --- a/Engine/lib/sdl/cmake/sdlchecks.cmake +++ b/Engine/lib/sdl/cmake/sdlchecks.cmake @@ -105,7 +105,9 @@ macro(CheckALSA) if(ALSA) CHECK_INCLUDE_FILE(alsa/asoundlib.h HAVE_ASOUNDLIB_H) if(HAVE_ASOUNDLIB_H) - CHECK_LIBRARY_EXISTS(asound snd_pcm_open "" HAVE_LIBASOUND) + CHECK_LIBRARY_EXISTS(asound snd_pcm_recover "" HAVE_LIBASOUND) + endif() + if(HAVE_LIBASOUND) set(HAVE_ALSA TRUE) file(GLOB ALSA_SOURCES ${SDL2_SOURCE_DIR}/src/audio/alsa/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${ALSA_SOURCES}) @@ -537,6 +539,27 @@ macro(CheckMir) endif() endmacro() +macro(WaylandProtocolGen _SCANNER _XML _PROTL) + set(_WAYLAND_PROT_C_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-protocol.c") + set(_WAYLAND_PROT_H_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-client-protocol.h") + + add_custom_command( + OUTPUT "${_WAYLAND_PROT_H_CODE}" + DEPENDS "${_XML}" + COMMAND "${_SCANNER}" + ARGS client-header "${_XML}" "${_WAYLAND_PROT_H_CODE}" + ) + + add_custom_command( + OUTPUT "${_WAYLAND_PROT_C_CODE}" + DEPENDS "${_WAYLAND_PROT_H_CODE}" + COMMAND "${_SCANNER}" + ARGS code "${_XML}" "${_WAYLAND_PROT_C_CODE}" + ) + + set(SOURCE_FILES ${SOURCE_FILES} "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-protocol.c") +endmacro() + # Requires: # - EGL # - PkgCheckModules @@ -545,7 +568,51 @@ endmacro() # - HAVE_DLOPEN opt macro(CheckWayland) if(VIDEO_WAYLAND) - pkg_check_modules(WAYLAND wayland-client wayland-cursor wayland-egl egl xkbcommon) + pkg_check_modules(WAYLAND wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon) + + # We have to generate some protocol interface code for some various Wayland features. + if(WAYLAND_FOUND) + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-client + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + RESULT_VARIABLE WAYLAND_CORE_PROTOCOL_DIR_RC + OUTPUT_VARIABLE WAYLAND_CORE_PROTOCOL_DIR + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(NOT WAYLAND_CORE_PROTOCOL_DIR_RC EQUAL 0) + set(WAYLAND_FOUND FALSE) + endif() + endif() + + if(WAYLAND_FOUND) + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + RESULT_VARIABLE WAYLAND_PROTOCOLS_DIR_RC + OUTPUT_VARIABLE WAYLAND_PROTOCOLS_DIR + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(NOT WAYLAND_PROTOCOLS_DIR_RC EQUAL 0) + set(WAYLAND_FOUND FALSE) + endif() + endif() + + if(WAYLAND_FOUND) + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=wayland_scanner wayland-scanner + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + RESULT_VARIABLE WAYLAND_SCANNER_RC + OUTPUT_VARIABLE WAYLAND_SCANNER + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(NOT WAYLAND_SCANNER_RC EQUAL 0) + set(WAYLAND_FOUND FALSE) + endif() + endif() + if(WAYLAND_FOUND) link_directories( ${WAYLAND_LIBRARY_DIRS} @@ -559,6 +626,17 @@ macro(CheckWayland) file(GLOB WAYLAND_SOURCES ${SDL2_SOURCE_DIR}/src/video/wayland/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${WAYLAND_SOURCES}) + # We have to generate some protocol interface code for some unstable Wayland features. + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols") + include_directories("${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols") + + WaylandProtocolGen("${WAYLAND_SCANNER}" "${WAYLAND_CORE_PROTOCOL_DIR}/wayland.xml" "wayland") + + foreach(_PROTL relative-pointer-unstable-v1 pointer-constraints-unstable-v1) + string(REGEX REPLACE "\\-unstable\\-.*$" "" PROTSUBDIR ${_PROTL}) + WaylandProtocolGen("${WAYLAND_SCANNER}" "${WAYLAND_PROTOCOLS_DIR}/unstable/${PROTSUBDIR}/${_PROTL}.xml" "${_PROTL}") + endforeach() + if(VIDEO_WAYLAND_QT_TOUCH) set(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH 1) endif() @@ -679,7 +757,6 @@ macro(CheckOpenGLX11) set(SDL_VIDEO_OPENGL 1) set(SDL_VIDEO_OPENGL_GLX 1) set(SDL_VIDEO_RENDER_OGL 1) - list(APPEND EXTRA_LIBS GL) endif() endif() endmacro() @@ -767,7 +844,8 @@ macro(CheckPTHREAD) endif() # Run some tests - set(CMAKE_REQUIRED_FLAGS "${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS}") + set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS}") if(CMAKE_CROSSCOMPILING) set(HAVE_PTHREADS 1) else() @@ -829,7 +907,7 @@ macro(CheckPTHREAD) int main(int argc, char** argv) { return 0; }" HAVE_PTHREAD_NP_H) check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP) check_function_exists(pthread_set_name_np HAVE_PTHREAD_SET_NAME_NP) - set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}") set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_systhread.c @@ -883,7 +961,8 @@ macro(CheckUSBHID) endif() endif() - set(CMAKE_REQUIRED_FLAGS "${USB_CFLAGS}") + set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${USB_CFLAGS}") set(CMAKE_REQUIRED_LIBRARIES "${USB_LIBS}") check_c_source_compiles(" #include @@ -984,7 +1063,7 @@ macro(CheckUSBHID) set(HAVE_SDL_JOYSTICK TRUE) set(CMAKE_REQUIRED_LIBRARIES) - set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}") endif() endmacro() @@ -998,12 +1077,13 @@ macro(CheckRPI) listtostr(VIDEO_RPI_INCLUDE_DIRS VIDEO_RPI_INCLUDE_FLAGS "-I") listtostr(VIDEO_RPI_LIBRARY_DIRS VIDEO_RPI_LIBRARY_FLAGS "-L") - set(CMAKE_REQUIRED_FLAGS "${VIDEO_RPI_INCLUDE_FLAGS} ${VIDEO_RPI_LIBRARY_FLAGS}") + set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${VIDEO_RPI_INCLUDE_FLAGS} ${VIDEO_RPI_LIBRARY_FLAGS}") set(CMAKE_REQUIRED_LIBRARIES "${VIDEO_RPI_LIBS}") check_c_source_compiles(" #include int main(int argc, char **argv) {}" HAVE_VIDEO_RPI) - set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}") set(CMAKE_REQUIRED_LIBRARIES) if(SDL_VIDEO AND HAVE_VIDEO_RPI) diff --git a/Engine/lib/sdl/configure b/Engine/lib/sdl/configure old mode 100644 new mode 100755 index a41f02595..5070f6e6a --- a/Engine/lib/sdl/configure +++ b/Engine/lib/sdl/configure @@ -630,6 +630,7 @@ ac_includes_default="\ #endif" ac_subst_vars='LTLIBOBJS +WAYLAND_SCANNER EXTRA_LDFLAGS BUILD_LDFLAGS EXTRA_CFLAGS @@ -637,6 +638,8 @@ BUILD_CFLAGS SDLTEST_OBJECTS SDLMAIN_OBJECTS VERSION_OBJECTS +GEN_OBJECTS +GEN_HEADERS OBJECTS INCLUDE ac_aux_dir @@ -846,7 +849,9 @@ enable_video_opengles1 enable_video_opengles2 enable_libudev enable_dbus +enable_ime enable_ibus +enable_fcitx enable_input_tslib enable_pthreads enable_pthread_sem @@ -1584,7 +1589,9 @@ Optional Features: include OpenGL ES 2.0 support [[default=yes]] --enable-libudev enable libudev support [[default=yes]] --enable-dbus enable D-Bus support [[default=yes]] + --enable-ime enable IME support [[default=yes]] --enable-ibus enable IBus support [[default=yes]] + --enable-fcitx enable fcitx support [[default=yes]] --enable-input-tslib use the Touchscreen library for input [[default=yes]] --enable-pthreads use POSIX threads for multi-threading @@ -2683,9 +2690,9 @@ orig_CFLAGS="$CFLAGS" # SDL_MAJOR_VERSION=2 SDL_MINOR_VERSION=0 -SDL_MICRO_VERSION=4 -SDL_INTERFACE_AGE=0 -SDL_BINARY_AGE=4 +SDL_MICRO_VERSION=5 +SDL_INTERFACE_AGE=1 +SDL_BINARY_AGE=5 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION @@ -17601,7 +17608,7 @@ LIBS="$ALSA_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_LIBS" >&5 $as_echo "$ALSA_LIBS" >&6; } -min_alsa_version=0.9.0 +min_alsa_version=1.0.11 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libasound headers version >= $min_alsa_version" >&5 $as_echo_n "checking for libasound headers version >= $min_alsa_version... " >&6; } no_alsa="" @@ -18650,6 +18657,43 @@ $as_echo "$have_gcc_preferred_stack_boundary" >&6; } fi } +CheckDeclarationAfterStatement() +{ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -Wdeclaration-after-statement option" >&5 +$as_echo_n "checking for GCC -Wdeclaration-after-statement option... " >&6; } + have_gcc_declaration_after_statement=no + + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int x = 0; + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_gcc_declaration_after_statement=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_declaration_after_statement" >&5 +$as_echo "$have_gcc_declaration_after_statement" >&6; } + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_declaration_after_statement = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement" + fi +} + CheckWarnAll() { { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -Wall option" >&5 @@ -18767,9 +18811,12 @@ $as_echo_n "checking for Wayland support... " >&6; } if test x$PKG_CONFIG != xno && \ test x$video_opengl_egl = xyes && \ test x$video_opengles_v2 = xyes; then - if $PKG_CONFIG --exists wayland-client wayland-egl wayland-cursor egl xkbcommon ; then + if $PKG_CONFIG --exists wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon ; then WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon` WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon` + WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner` + WAYLAND_CORE_PROTOCOL_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-client` + WAYLAND_PROTOCOLS_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols` video_wayland=yes fi fi @@ -18785,8 +18832,11 @@ $as_echo "#define SDL_VIDEO_DRIVER_WAYLAND 1" >>confdefs.h $as_echo "#define SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH 1" >>confdefs.h fi + + WAYLAND_PROTOCOLS_UNSTABLE="relative-pointer-unstable-v1 pointer-constraints-unstable-v1" + SOURCES="$SOURCES $srcdir/src/video/wayland/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS" + EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS -I\$(gen)" # Check whether --enable-wayland-shared was given. if test "${enable_wayland_shared+set}" = set; then : enableval=$enable_wayland_shared; @@ -18928,7 +18978,7 @@ int main () { - MirMotionToolType tool = mir_motion_tool_type_mouse; + MirTouchAction actions = mir_touch_actions ; return 0; @@ -21604,6 +21654,23 @@ $as_echo "#define HAVE_DBUS_DBUS_H 1" >>confdefs.h fi } +CheckIME() +{ + # Check whether --enable-ime was given. +if test "${enable_ime+set}" = set; then : + enableval=$enable_ime; +else + enable_ime=yes +fi + + if test x$enable_ime = xyes; then + +$as_echo "#define SDL_USE_IME 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c" + fi +} + CheckIBus() { # Check whether --enable-ibus was given. @@ -21677,7 +21744,11 @@ fi CFLAGS="$save_CFLAGS" if test x$have_ibus_ibus_h_hdr = xyes; then - if test x$enable_dbus != xyes; then + if test x$enable_ime != xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IME support is required for IBus." >&5 +$as_echo "$as_me: WARNING: IME support is required for IBus." >&2;} + have_ibus_ibus_h_hdr=no + elif test x$enable_dbus != xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: DBus support is required for IBus." >&5 $as_echo "$as_me: WARNING: DBus support is required for IBus." >&2;} have_ibus_ibus_h_hdr=no @@ -21697,6 +21768,90 @@ $as_echo "#define HAVE_IBUS_IBUS_H 1" >>confdefs.h fi } +CheckFcitx() +{ + # Check whether --enable-fcitx was given. +if test "${enable_fcitx+set}" = set; then : + enableval=$enable_fcitx; +else + enable_fcitx=yes +fi + + if test x$enable_fcitx = xyes; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x$PKG_CONFIG != xno; then + FCITX_CFLAGS=`$PKG_CONFIG --cflags fcitx` + CFLAGS="$CFLAGS $FCITX_CFLAGS" + ac_fn_c_check_header_mongrel "$LINENO" "fcitx/frontend.h" "ac_cv_header_fcitx_frontend_h" "$ac_includes_default" +if test "x$ac_cv_header_fcitx_frontend_h" = xyes; then : + have_fcitx_frontend_h_hdr=yes +else + have_fcitx_frontend_h_hdr=no +fi + + + CFLAGS="$save_CFLAGS" + if test x$have_fcitx_frontend_h_hdr = xyes; then + if test x$enable_ime != xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IME support is required for fcitx." >&5 +$as_echo "$as_me: WARNING: IME support is required for fcitx." >&2;} + have_fcitx_frontend_h_hdr=no + elif test x$enable_dbus != xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: DBus support is required for fcitx." >&5 +$as_echo "$as_me: WARNING: DBus support is required for fcitx." >&2;} + have_fcitx_frontend_h_hdr=no + else + +$as_echo "#define HAVE_FCITX_FRONTEND_H 1" >>confdefs.h + + EXTRA_CFLAGS="$EXTRA_CFLAGS $FCITX_CFLAGS" + SOURCES="$SOURCES $srcdir/src/core/linux/SDL_fcitx.c" + fi + fi + fi + fi +} + CheckTslib() { # Check whether --enable-input-tslib was given. @@ -22894,6 +23049,8 @@ fi } +CheckWarnAll + case "$host" in *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*) case "$host" in @@ -22962,6 +23119,7 @@ case "$host" in *-*-minix*) ARCH=minix ;; esac CheckVisibilityHidden + CheckDeclarationAfterStatement CheckDummyVideo CheckDiskAudio CheckDummyAudio @@ -22982,7 +23140,9 @@ case "$host" in CheckWayland CheckLibUDev CheckDBus + CheckIME CheckIBus + CheckFcitx case $ARCH in linux) CheckInputEvents @@ -23392,6 +23552,7 @@ $as_echo "#define SDL_FILESYSTEM_HAIKU 1" >>confdefs.h ARCH=ios CheckVisibilityHidden + CheckDeclarationAfterStatement CheckDummyVideo CheckDiskAudio CheckDummyAudio @@ -23402,7 +23563,7 @@ $as_echo "#define SDL_FILESYSTEM_HAIKU 1" >>confdefs.h # Set up files for the audio library if test x$enable_audio = xyes; then - SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c" + SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m" SUMMARY_audio="${SUMMARY_audio} coreaudio" have_audio=yes fi @@ -23461,6 +23622,7 @@ $as_echo "#define SDL_FILESYSTEM_HAIKU 1" >>confdefs.h EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX" CheckVisibilityHidden + CheckDeclarationAfterStatement CheckDummyVideo CheckDiskAudio CheckDummyAudio @@ -23476,7 +23638,8 @@ $as_echo "#define SDL_FILESYSTEM_HAIKU 1" >>confdefs.h $as_echo "#define SDL_AUDIO_DRIVER_COREAUDIO 1" >>confdefs.h - SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c" + SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox" SUMMARY_audio="${SUMMARY_audio} coreaudio" have_audio=yes fi @@ -23494,8 +23657,8 @@ $as_echo "#define SDL_JOYSTICK_IOKIT 1" >>confdefs.h $as_echo "#define SDL_HAPTIC_IOKIT 1" >>confdefs.h SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c" - have_haptic=yes EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback" + have_haptic=yes fi # Set up files for the power library if test x$enable_power = xyes; then @@ -23532,10 +23695,6 @@ $as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit" - # If audio is used, add the AudioUnit framework - if test x$enable_audio = xyes; then - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit" - fi ;; *-nacl|*-pnacl) ARCH=nacl @@ -23581,6 +23740,7 @@ $as_echo "#define SDL_AUDIO_DRIVER_EMSCRIPTEN 1" >>confdefs.h fi CheckVisibilityHidden + CheckDeclarationAfterStatement CheckDummyVideo CheckDiskAudio CheckDummyAudio @@ -23630,8 +23790,6 @@ $as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h ;; esac -CheckWarnAll - # Verify that we have all the platform specific files we need if test x$have_joystick != xyes; then @@ -23687,6 +23845,57 @@ if test x$SDLMAIN_SOURCES = x; then fi SDLTEST_SOURCES="$srcdir/src/test/*.c" +if test x$video_wayland = xyes; then + WAYLAND_CORE_PROTOCOL_SOURCE='$(gen)/wayland-protocol.c' + WAYLAND_CORE_PROTOCOL_HEADER='$(gen)/wayland-client-protocol.h' + WAYLAND_PROTOCOLS_UNSTABLE_SOURCES=`echo $WAYLAND_PROTOCOLS_UNSTABLE |\ + sed 's,[^ ]\+,\\$(gen)/&-protocol.c,g'` + WAYLAND_PROTOCOLS_UNSTABLE_HEADERS=`echo $WAYLAND_PROTOCOLS_UNSTABLE |\ + sed 's,[^ ]\+,\\$(gen)/&-client-protocol.h,g'` + GEN_SOURCES="$GEN_SOURCES $WAYLAND_CORE_PROTOCOL_SOURCE $WAYLAND_PROTOCOLS_UNSTABLE_SOURCES" + GEN_HEADERS="$GEN_HEADERS $WAYLAND_CORE_PROTOCOL_HEADER $WAYLAND_PROTOCOLS_UNSTABLE_HEADERS" + + WAYLAND_CORE_PROTOCOL_SOURCE_DEPENDS=" +$WAYLAND_CORE_PROTOCOL_SOURCE: $WAYLAND_CORE_PROTOCOL_DIR/wayland.xml + \$(SHELL) \$(auxdir)/mkinstalldirs \$(gen) + \$(RUN_CMD_GEN)\$(WAYLAND_SCANNER) code \$< \$@" + + WAYLAND_CORE_PROTOCOL_HEADER_DEPENDS=" +$WAYLAND_CORE_PROTOCOL_HEADER: $WAYLAND_CORE_PROTOCOL_DIR/wayland.xml + \$(SHELL) \$(auxdir)/mkinstalldirs \$(gen) + \$(RUN_CMD_GEN)\$(WAYLAND_SCANNER) client-header \$< \$@" + + WAYLAND_CORE_PROTOCOL_OBJECT=" +\$(objects)/`echo $WAYLAND_CORE_PROTOCOL_SOURCE | sed 's/\$(gen)\/\(.*\).c$/\1.lo/'`: $WAYLAND_CORE_PROTOCOL_SOURCE + \$(RUN_CMD_CC)\$(LIBTOOL) --tag=CC --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \$< -o \$@" + + WAYLAND_PROTOCOLS_CLIENT_HEADER_UNSTABLE_DEPENDS=`for p in $WAYLAND_PROTOCOLS_UNSTABLE;\ + do echo ; echo \$p | sed\ + "s,^\\([a-z\\-]\\+\\)-unstable-\\(v[0-9]\+\\)\$,\\$(gen)/&-client-protocol.h: $WAYLAND_PROTOCOLS_DIR/unstable/\1/&.xml\\\\ + \\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)\\\\ + \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) client-header \\$< \\$@," ; done` + + WAYLAND_PROTOCOLS_CODE_UNSTABLE_DEPENDS=`for p in $WAYLAND_PROTOCOLS_UNSTABLE;\ + do echo ; echo \$p | sed\ + "s,^\\([a-z\\-]\\+\\)-unstable-\\(v[0-9]\+\\)\$,\\$(gen)/&-protocol.c: $WAYLAND_PROTOCOLS_DIR/unstable/\1/&.xml\\\\ + \\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)\\\\ + \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) code \\$< \\$@," ; done` + + WAYLAND_PROTOCOLS_OBJECTS_UNSTABLE=`for p in $WAYLAND_PROTOCOLS_UNSTABLE;\ + do echo ; echo \$p | sed\ + "s,^\\([a-z\\-]\\+\\)-unstable-\\(v[0-9]\+\\)\$,\\\$(objects)/&-protocol.lo: \\$(gen)/&-protocol.c \\$(gen)/&-client-protocol.h\\\\ + \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@," ; done` + + WAYLAND_PROTOCOLS_DEPENDS=" +$WAYLAND_CORE_PROTOCOL_SOURCE_DEPENDS +$WAYLAND_CORE_PROTOCOL_HEADER_DEPENDS +$WAYLAND_CORE_PROTOCOL_OBJECT +$WAYLAND_PROTOCOLS_CLIENT_HEADER_UNSTABLE_DEPENDS +$WAYLAND_PROTOCOLS_CODE_UNSTABLE_DEPENDS +$WAYLAND_PROTOCOLS_OBJECTS_UNSTABLE +" +fi + OBJECTS=`echo $SOURCES` DEPENDS=`echo $SOURCES | tr ' ' '\n'` for EXT in asm cc m c S; do @@ -23696,6 +23905,8 @@ for EXT in asm cc m c S; do \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"` done +GEN_OBJECTS=`echo "$GEN_SOURCES" | sed 's,[^ ]*/\([^ ]*\)\.c,$(objects)/\1.lo,g'` + VERSION_OBJECTS=`echo $VERSION_SOURCES` VERSION_DEPENDS=`echo $VERSION_SOURCES` VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.rc,$(objects)/\1.o,g'` @@ -23722,6 +23933,36 @@ SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([^ ]*\\)/\\([^ ]*\\)\\.c,\\ if test "x$enable_rpath" = "xyes"; then if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker option --enable-new-dtags" >&5 +$as_echo_n "checking for linker option --enable-new-dtags... " >&6; } + have_enable_new_dtags=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + have_enable_new_dtags=yes + SDL_RLD_FLAGS="$SDL_RLD_FLAGS -Wl,--enable-new-dtags" + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_enable_new_dtags" >&5 +$as_echo "$have_enable_new_dtags" >&6; } fi if test $ARCH = solaris; then SDL_RLD_FLAGS="-R\${libdir}" @@ -23767,6 +24008,9 @@ fi + + + cat >Makefile.rules <<__EOF__ # Build rules for objects @@ -23778,6 +24022,7 @@ $DEPENDS $VERSION_DEPENDS $SDLMAIN_DEPENDS $SDLTEST_DEPENDS +$WAYLAND_PROTOCOLS_DEPENDS __EOF__ ac_config_files="$ac_config_files Makefile:Makefile.in:Makefile.rules sdl2-config sdl2-config.cmake SDL2.spec sdl2.pc" @@ -23810,11 +24055,21 @@ if test x$have_dbus_dbus_h_hdr = xyes; then else SUMMARY="${SUMMARY}Using dbus : NO\n" fi +if test x$enable_ime = xyes; then + SUMMARY="${SUMMARY}Using ime : YES\n" +else + SUMMARY="${SUMMARY}Using ime : NO\n" +fi if test x$have_ibus_ibus_h_hdr = xyes; then SUMMARY="${SUMMARY}Using ibus : YES\n" else SUMMARY="${SUMMARY}Using ibus : NO\n" fi +if test x$have_fcitx_frontend_h_hdr = xyes; then + SUMMARY="${SUMMARY}Using fcitx : YES\n" +else + SUMMARY="${SUMMARY}Using fcitx : NO\n" +fi ac_config_commands="$ac_config_commands summary" diff --git a/Engine/lib/sdl/configure.in b/Engine/lib/sdl/configure.in index f585d01af..37c57e288 100644 --- a/Engine/lib/sdl/configure.in +++ b/Engine/lib/sdl/configure.in @@ -20,9 +20,9 @@ dnl Set various version strings - taken gratefully from the GTk sources # SDL_MAJOR_VERSION=2 SDL_MINOR_VERSION=0 -SDL_MICRO_VERSION=4 -SDL_INTERFACE_AGE=0 -SDL_BINARY_AGE=4 +SDL_MICRO_VERSION=5 +SDL_INTERFACE_AGE=1 +SDL_BINARY_AGE=5 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION AC_SUBST(SDL_MAJOR_VERSION) @@ -770,7 +770,7 @@ CheckALSA() AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]), , enable_alsa=yes) if test x$enable_audio = xyes -a x$enable_alsa = xyes; then - AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no) + AM_PATH_ALSA(1.0.11, have_alsa=yes, have_alsa=no) # Restore all flags from before the ALSA detection runs CFLAGS="$alsa_save_CFLAGS" LDFLAGS="$alsa_save_LDFLAGS" @@ -1124,6 +1124,30 @@ CheckStackBoundary() fi } +dnl See if GCC's -Wdeclaration-after-statement is supported. +dnl This lets us catch things that would fail on a C89 compiler when using +dnl a modern GCC. +CheckDeclarationAfterStatement() +{ + AC_MSG_CHECKING(for GCC -Wdeclaration-after-statement option) + have_gcc_declaration_after_statement=no + + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement" + AC_TRY_COMPILE([ + int x = 0; + ],[ + ],[ + have_gcc_declaration_after_statement=yes + ]) + AC_MSG_RESULT($have_gcc_declaration_after_statement) + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_declaration_after_statement = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement" + fi +} + dnl See if GCC's -Wall is supported. CheckWarnAll() { @@ -1177,9 +1201,12 @@ AC_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for if test x$PKG_CONFIG != xno && \ test x$video_opengl_egl = xyes && \ test x$video_opengles_v2 = xyes; then - if $PKG_CONFIG --exists wayland-client wayland-egl wayland-cursor egl xkbcommon ; then + if $PKG_CONFIG --exists wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon ; then WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon` WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon` + WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner` + WAYLAND_CORE_PROTOCOL_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-client` + WAYLAND_PROTOCOLS_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols` video_wayland=yes fi fi @@ -1190,8 +1217,11 @@ AC_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for if test x$enable_video_wayland_qt_touch = xyes; then AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ]) fi + + WAYLAND_PROTOCOLS_UNSTABLE="relative-pointer-unstable-v1 pointer-constraints-unstable-v1" + SOURCES="$SOURCES $srcdir/src/video/wayland/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS" + EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS -I\$(gen)" AC_ARG_ENABLE(wayland-shared, AC_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[default=maybe]]]), , enable_wayland_shared=maybe) @@ -1260,12 +1290,12 @@ AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=yes]]]), MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon` save_CFLAGS="$CFLAGS" CFLAGS="$save_CFLAGS $MIR_CFLAGS" - - dnl This will disable Mir on Ubuntu < 14.04 + + dnl This will disable Mir if >= v0.25 is not available AC_TRY_COMPILE([ #include ],[ - MirMotionToolType tool = mir_motion_tool_type_mouse; + MirTouchAction actions = mir_touch_actions ],[ video_mir=yes ]) @@ -2230,6 +2260,18 @@ AC_HELP_STRING([--enable-dbus], [enable D-Bus support [[default=yes]]]), fi } +dnl See if the platform wanna IME support. +CheckIME() +{ + AC_ARG_ENABLE(ime, +AC_HELP_STRING([--enable-ime], [enable IME support [[default=yes]]]), + , enable_ime=yes) + if test x$enable_ime = xyes; then + AC_DEFINE(SDL_USE_IME, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c" + fi +} + dnl See if the platform has libibus IME support. CheckIBus() { @@ -2250,7 +2292,10 @@ AC_HELP_STRING([--enable-ibus], [enable IBus support [[default=yes]]]), have_inotify_inotify_h_hdr=no) CFLAGS="$save_CFLAGS" if test x$have_ibus_ibus_h_hdr = xyes; then - if test x$enable_dbus != xyes; then + if test x$enable_ime != xyes; then + AC_MSG_WARN([IME support is required for IBus.]) + have_ibus_ibus_h_hdr=no + elif test x$enable_dbus != xyes; then AC_MSG_WARN([DBus support is required for IBus.]) have_ibus_ibus_h_hdr=no elif test x$have_inotify_inotify_h_hdr != xyes; then @@ -2266,6 +2311,38 @@ AC_HELP_STRING([--enable-ibus], [enable IBus support [[default=yes]]]), fi } +dnl See if the platform has fcitx IME support. +CheckFcitx() +{ + AC_ARG_ENABLE(fcitx, +AC_HELP_STRING([--enable-fcitx], [enable fcitx support [[default=yes]]]), + , enable_fcitx=yes) + if test x$enable_fcitx = xyes; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + if test x$PKG_CONFIG != xno; then + FCITX_CFLAGS=`$PKG_CONFIG --cflags fcitx` + CFLAGS="$CFLAGS $FCITX_CFLAGS" + AC_CHECK_HEADER(fcitx/frontend.h, + have_fcitx_frontend_h_hdr=yes, + have_fcitx_frontend_h_hdr=no) + CFLAGS="$save_CFLAGS" + if test x$have_fcitx_frontend_h_hdr = xyes; then + if test x$enable_ime != xyes; then + AC_MSG_WARN([IME support is required for fcitx.]) + have_fcitx_frontend_h_hdr=no + elif test x$enable_dbus != xyes; then + AC_MSG_WARN([DBus support is required for fcitx.]) + have_fcitx_frontend_h_hdr=no + else + AC_DEFINE(HAVE_FCITX_FRONTEND_H, 1, [ ]) + EXTRA_CFLAGS="$EXTRA_CFLAGS $FCITX_CFLAGS" + SOURCES="$SOURCES $srcdir/src/core/linux/SDL_fcitx.c" + fi + fi + fi + fi +} + dnl See if we can use the Touchscreen input library CheckTslib() { @@ -2801,6 +2878,9 @@ AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]] , enable_rpath=yes) } +dnl Do this on all platforms, before everything else (other things might want to override it). +CheckWarnAll + dnl Set up the configuration based on the host platform! case "$host" in *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*) @@ -2870,6 +2950,7 @@ case "$host" in *-*-minix*) ARCH=minix ;; esac CheckVisibilityHidden + CheckDeclarationAfterStatement CheckDummyVideo CheckDiskAudio CheckDummyAudio @@ -2890,7 +2971,9 @@ case "$host" in CheckWayland CheckLibUDev CheckDBus + CheckIME CheckIBus + CheckFcitx case $ARCH in linux) CheckInputEvents @@ -3196,6 +3279,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau ARCH=ios CheckVisibilityHidden + CheckDeclarationAfterStatement CheckDummyVideo CheckDiskAudio CheckDummyAudio @@ -3206,7 +3290,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau # Set up files for the audio library if test x$enable_audio = xyes; then - SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c" + SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m" SUMMARY_audio="${SUMMARY_audio} coreaudio" have_audio=yes fi @@ -3265,6 +3349,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX" CheckVisibilityHidden + CheckDeclarationAfterStatement CheckDummyVideo CheckDiskAudio CheckDummyAudio @@ -3278,7 +3363,8 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau # Set up files for the audio library if test x$enable_audio = xyes; then AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c" + SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox" SUMMARY_audio="${SUMMARY_audio} coreaudio" have_audio=yes fi @@ -3292,8 +3378,8 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau if test x$enable_haptic = xyes; then AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ]) SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c" - have_haptic=yes EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback" + have_haptic=yes fi # Set up files for the power library if test x$enable_power = xyes; then @@ -3324,10 +3410,6 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit" - # If audio is used, add the AudioUnit framework - if test x$enable_audio = xyes; then - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit" - fi ;; *-nacl|*-pnacl) ARCH=nacl @@ -3366,6 +3448,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau fi CheckVisibilityHidden + CheckDeclarationAfterStatement CheckDummyVideo CheckDiskAudio CheckDummyAudio @@ -3407,9 +3490,6 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau ;; esac -dnl Do this on all platforms, after everything else. -CheckWarnAll - # Verify that we have all the platform specific files we need if test x$have_joystick != xyes; then @@ -3453,6 +3533,57 @@ if test x$SDLMAIN_SOURCES = x; then fi SDLTEST_SOURCES="$srcdir/src/test/*.c" +if test x$video_wayland = xyes; then + WAYLAND_CORE_PROTOCOL_SOURCE='$(gen)/wayland-protocol.c' + WAYLAND_CORE_PROTOCOL_HEADER='$(gen)/wayland-client-protocol.h' + WAYLAND_PROTOCOLS_UNSTABLE_SOURCES=`echo $WAYLAND_PROTOCOLS_UNSTABLE |\ + sed 's,[[^ ]]\+,\\$(gen)/&-protocol.c,g'` + WAYLAND_PROTOCOLS_UNSTABLE_HEADERS=`echo $WAYLAND_PROTOCOLS_UNSTABLE |\ + sed 's,[[^ ]]\+,\\$(gen)/&-client-protocol.h,g'` + GEN_SOURCES="$GEN_SOURCES $WAYLAND_CORE_PROTOCOL_SOURCE $WAYLAND_PROTOCOLS_UNSTABLE_SOURCES" + GEN_HEADERS="$GEN_HEADERS $WAYLAND_CORE_PROTOCOL_HEADER $WAYLAND_PROTOCOLS_UNSTABLE_HEADERS" + + WAYLAND_CORE_PROTOCOL_SOURCE_DEPENDS=" +$WAYLAND_CORE_PROTOCOL_SOURCE: $WAYLAND_CORE_PROTOCOL_DIR/wayland.xml + \$(SHELL) \$(auxdir)/mkinstalldirs \$(gen) + \$(RUN_CMD_GEN)\$(WAYLAND_SCANNER) code \$< \$@" + + WAYLAND_CORE_PROTOCOL_HEADER_DEPENDS=" +$WAYLAND_CORE_PROTOCOL_HEADER: $WAYLAND_CORE_PROTOCOL_DIR/wayland.xml + \$(SHELL) \$(auxdir)/mkinstalldirs \$(gen) + \$(RUN_CMD_GEN)\$(WAYLAND_SCANNER) client-header \$< \$@" + + WAYLAND_CORE_PROTOCOL_OBJECT=" +\$(objects)/`echo $WAYLAND_CORE_PROTOCOL_SOURCE | sed 's/\$(gen)\/\(.*\).c$/\1.lo/'`: $WAYLAND_CORE_PROTOCOL_SOURCE + \$(RUN_CMD_CC)\$(LIBTOOL) --tag=CC --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \$< -o \$@" + + WAYLAND_PROTOCOLS_CLIENT_HEADER_UNSTABLE_DEPENDS=`for p in $WAYLAND_PROTOCOLS_UNSTABLE;\ + do echo ; echo \$p | sed\ + "s,^\\([[a-z\\-]]\\+\\)-unstable-\\(v[[0-9]]\+\\)\$,\\$(gen)/&-client-protocol.h: $WAYLAND_PROTOCOLS_DIR/unstable/\1/&.xml\\\\ + \\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)\\\\ + \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) client-header \\$< \\$@," ; done` + + WAYLAND_PROTOCOLS_CODE_UNSTABLE_DEPENDS=`for p in $WAYLAND_PROTOCOLS_UNSTABLE;\ + do echo ; echo \$p | sed\ + "s,^\\([[a-z\\-]]\\+\\)-unstable-\\(v[[0-9]]\+\\)\$,\\$(gen)/&-protocol.c: $WAYLAND_PROTOCOLS_DIR/unstable/\1/&.xml\\\\ + \\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)\\\\ + \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) code \\$< \\$@," ; done` + + WAYLAND_PROTOCOLS_OBJECTS_UNSTABLE=`for p in $WAYLAND_PROTOCOLS_UNSTABLE;\ + do echo ; echo \$p | sed\ + "s,^\\([[a-z\\-]]\\+\\)-unstable-\\(v[[0-9]]\+\\)\$,\\\$(objects)/&-protocol.lo: \\$(gen)/&-protocol.c \\$(gen)/&-client-protocol.h\\\\ + \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@," ; done` + + WAYLAND_PROTOCOLS_DEPENDS=" +$WAYLAND_CORE_PROTOCOL_SOURCE_DEPENDS +$WAYLAND_CORE_PROTOCOL_HEADER_DEPENDS +$WAYLAND_CORE_PROTOCOL_OBJECT +$WAYLAND_PROTOCOLS_CLIENT_HEADER_UNSTABLE_DEPENDS +$WAYLAND_PROTOCOLS_CODE_UNSTABLE_DEPENDS +$WAYLAND_PROTOCOLS_OBJECTS_UNSTABLE +" +fi + OBJECTS=`echo $SOURCES` DEPENDS=`echo $SOURCES | tr ' ' '\n'` for EXT in asm cc m c S; do @@ -3462,6 +3593,8 @@ for EXT in asm cc m c S; do \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"` done +GEN_OBJECTS=`echo "$GEN_SOURCES" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'` + VERSION_OBJECTS=`echo $VERSION_SOURCES` VERSION_DEPENDS=`echo $VERSION_SOURCES` VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'` @@ -3488,6 +3621,19 @@ SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\. if test "x$enable_rpath" = "xyes"; then if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}" + + AC_MSG_CHECKING(for linker option --enable-new-dtags) + have_enable_new_dtags=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags" + AC_TRY_LINK([ + ],[ + ],[ + have_enable_new_dtags=yes + SDL_RLD_FLAGS="$SDL_RLD_FLAGS -Wl,--enable-new-dtags" + ]) + LDFLAGS="$save_LDFLAGS" + AC_MSG_RESULT($have_enable_new_dtags) fi if test $ARCH = solaris; then SDL_RLD_FLAGS="-R\${libdir}" @@ -3526,6 +3672,8 @@ dnl Expand the sources and objects needed to build the library AC_SUBST(ac_aux_dir) AC_SUBST(INCLUDE) AC_SUBST(OBJECTS) +AC_SUBST(GEN_HEADERS) +AC_SUBST(GEN_OBJECTS) AC_SUBST(VERSION_OBJECTS) AC_SUBST(SDLMAIN_OBJECTS) AC_SUBST(SDLTEST_OBJECTS) @@ -3534,6 +3682,7 @@ AC_SUBST(EXTRA_CFLAGS) AC_SUBST(BUILD_LDFLAGS) AC_SUBST(EXTRA_LDFLAGS) AC_SUBST(WINDRES) +AC_SUBST(WAYLAND_SCANNER) cat >Makefile.rules <<__EOF__ @@ -3546,6 +3695,7 @@ $DEPENDS $VERSION_DEPENDS $SDLMAIN_DEPENDS $SDLTEST_DEPENDS +$WAYLAND_PROTOCOLS_DEPENDS __EOF__ AC_CONFIG_FILES([ @@ -3578,11 +3728,21 @@ if test x$have_dbus_dbus_h_hdr = xyes; then else SUMMARY="${SUMMARY}Using dbus : NO\n" fi +if test x$enable_ime = xyes; then + SUMMARY="${SUMMARY}Using ime : YES\n" +else + SUMMARY="${SUMMARY}Using ime : NO\n" +fi if test x$have_ibus_ibus_h_hdr = xyes; then SUMMARY="${SUMMARY}Using ibus : YES\n" else SUMMARY="${SUMMARY}Using ibus : NO\n" fi +if test x$have_fcitx_frontend_h_hdr = xyes; then + SUMMARY="${SUMMARY}Using fcitx : YES\n" +else + SUMMARY="${SUMMARY}Using fcitx : NO\n" +fi AC_CONFIG_COMMANDS([summary], [echo -en "$SUMMARY"], [SUMMARY="$SUMMARY"]) AC_OUTPUT diff --git a/Engine/lib/sdl/debian/changelog b/Engine/lib/sdl/debian/changelog index 84d1b878b..6a88d2473 100644 --- a/Engine/lib/sdl/debian/changelog +++ b/Engine/lib/sdl/debian/changelog @@ -1,3 +1,9 @@ +libsdl2 (2.0.4) UNRELEASED; urgency=low + + * Updated SDL to version 2.0.4 + + -- Sam Lantinga Thu, 07 Jan 2016 11:02:39 -0800 + libsdl2 (2.0.3) UNRELEASED; urgency=low * Updated SDL to version 2.0.3 diff --git a/Engine/lib/sdl/debian/copyright b/Engine/lib/sdl/debian/copyright index 8ce26d1c5..99c3d4496 100644 --- a/Engine/lib/sdl/debian/copyright +++ b/Engine/lib/sdl/debian/copyright @@ -31,10 +31,6 @@ Copyright: 1995 Erik Corry 1995 Brown University License: BrownUn_UnCalifornia_ErikCorry -Files: src/stdlib/SDL_qsort.c -Copyright: 1998 Gareth McCaughan -License: Gareth_McCaughan - Files: src/test/SDL_test_md5.c Copyright: 1997-2016 Sam Lantinga 1990 RSA Data Security, Inc. @@ -270,13 +266,6 @@ License: BrownUn_UnCalifornia_ErikCorry * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ -License: Gareth_McCaughan - You may use it in anything you like; you may make money - out of it; you may distribute it in object form or as - part of an executable without including source code; - you don't have to credit me. (But it would be nice if - you did.) - License: Johnson_M._Hart Permission is granted for any and all use providing that this copyright is properly acknowledged. diff --git a/Engine/lib/sdl/debian/libsdl2-dev.install b/Engine/lib/sdl/debian/libsdl2-dev.install index 7f99ff427..af2c5b19d 100644 --- a/Engine/lib/sdl/debian/libsdl2-dev.install +++ b/Engine/lib/sdl/debian/libsdl2-dev.install @@ -5,4 +5,5 @@ usr/lib/*/libSDL2.a usr/lib/*/libSDL2main.a usr/lib/*/libSDL2_test.a usr/lib/*/pkgconfig/sdl2.pc +usr/lib/*/cmake/SDL2/sdl2-config.cmake usr/share/aclocal/sdl2.m4 diff --git a/Engine/lib/sdl/debian/rules b/Engine/lib/sdl/debian/rules old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/sdl2-config.cmake.in b/Engine/lib/sdl/sdl2-config.cmake.in index e5a036adf..03efbe174 100644 --- a/Engine/lib/sdl/sdl2-config.cmake.in +++ b/Engine/lib/sdl/sdl2-config.cmake.in @@ -8,3 +8,4 @@ set(SDL2_EXEC_PREFIX "@prefix@") set(SDL2_LIBDIR "@libdir@") set(SDL2_INCLUDE_DIRS "@includedir@/SDL2") set(SDL2_LIBRARIES "-L${SDL2_LIBDIR} @SDL_RLD_FLAGS@ @SDL_LIBS@") +string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES) diff --git a/Engine/lib/sdl/sdl2.m4 b/Engine/lib/sdl/sdl2.m4 index a03b2d270..b915f99ed 100644 --- a/Engine/lib/sdl/sdl2.m4 +++ b/Engine/lib/sdl/sdl2.m4 @@ -4,6 +4,9 @@ # stolen back from Frank Belew # stolen from Manish Singh # Shamelessly stolen from Owen Taylor +# +# Changelog: +# * also look for SDL2.framework under Mac OS X # serial 1 @@ -20,6 +23,10 @@ AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL sdl_exec_prefix="$withval", sdl_exec_prefix="") AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], , enable_sdltest=yes) +AC_ARG_ENABLE(sdlframework, [ --disable-sdlframework Do not search for SDL2.framework], + , search_sdl_framework=yes) + +AC_ARG_VAR(SDL2_FRAMEWORK, [Path to SDL2.framework]) min_sdl_version=ifelse([$1], ,2.0.0,$1) @@ -53,14 +60,36 @@ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run fi AC_PATH_PROG(SDL2_CONFIG, sdl2-config, no, [$PATH]) PATH="$as_save_PATH" - AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) no_sdl="" - if test "$SDL2_CONFIG" = "no" ; then - no_sdl=yes - else - SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` + if test "$SDL2_CONFIG" = "no" -a "x$search_sdl_framework" = "xyes"; then + AC_MSG_CHECKING(for SDL2.framework) + if test "x$SDL2_FRAMEWORK" != x; then + sdl_framework=$SDL2_FRAMEWORK + else + for d in / ~/ /System/; do + if test -d "$dLibrary/Frameworks/SDL2.framework"; then + sdl_framework="$dLibrary/Frameworks/SDL2.framework" + fi + done + fi + + if test -d $sdl_framework; then + AC_MSG_RESULT($sdl_framework) + sdl_framework_dir=`dirname $sdl_framework` + SDL_CFLAGS="-F$sdl_framework_dir -Wl,-framework,SDL2 -I$sdl_framework/include" + SDL_LIBS="-F$sdl_framework_dir -Wl,-framework,SDL2" + else + no_sdl=yes + fi + fi + + if test "$SDL2_CONFIG" != "no"; then + if test "x$sdl_pc" = "xno"; then + AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) + SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` + SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` + fi sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` @@ -141,12 +170,15 @@ int main (int argc, char *argv[]) CFLAGS="$ac_save_CFLAGS" CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" + + fi + if test "x$sdl_pc" = "xno"; then + if test "x$no_sdl" = "xyes"; then + AC_MSG_RESULT(no) + else + AC_MSG_RESULT(yes) + fi fi - fi - if test "x$no_sdl" = x ; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) fi fi if test "x$no_sdl" = x ; then diff --git a/Engine/lib/sdl/src/audio/SDL_audiomem.h b/Engine/lib/sdl/src/audio/SDL_audiomem.h deleted file mode 100644 index 091d15c29..000000000 --- a/Engine/lib/sdl/src/audio/SDL_audiomem.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../SDL_internal.h" - -#define SDL_AllocAudioMem SDL_malloc -#define SDL_FreeAudioMem SDL_free -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Engine/lib/sdl/src/audio/coreaudio/SDL_coreaudio.c b/Engine/lib/sdl/src/audio/coreaudio/SDL_coreaudio.c deleted file mode 100644 index 46b617dc0..000000000 --- a/Engine/lib/sdl/src/audio/coreaudio/SDL_coreaudio.c +++ /dev/null @@ -1,698 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_COREAUDIO - -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "../SDL_sysaudio.h" -#include "SDL_coreaudio.h" -#include "SDL_assert.h" - -#define DEBUG_COREAUDIO 0 - -static void COREAUDIO_CloseDevice(_THIS); - -#define CHECK_RESULT(msg) \ - if (result != noErr) { \ - COREAUDIO_CloseDevice(this); \ - SDL_SetError("CoreAudio error (%s): %d", msg, (int) result); \ - return 0; \ - } - -#if MACOSX_COREAUDIO -static const AudioObjectPropertyAddress devlist_address = { - kAudioHardwarePropertyDevices, - kAudioObjectPropertyScopeGlobal, - kAudioObjectPropertyElementMaster -}; - -typedef void (*addDevFn)(const char *name, const int iscapture, AudioDeviceID devId, void *data); - -typedef struct AudioDeviceList -{ - AudioDeviceID devid; - SDL_bool alive; - struct AudioDeviceList *next; -} AudioDeviceList; - -static AudioDeviceList *output_devs = NULL; -static AudioDeviceList *capture_devs = NULL; - -static SDL_bool -add_to_internal_dev_list(const int iscapture, AudioDeviceID devId) -{ - AudioDeviceList *item = (AudioDeviceList *) SDL_malloc(sizeof (AudioDeviceList)); - if (item == NULL) { - return SDL_FALSE; - } - item->devid = devId; - item->alive = SDL_TRUE; - item->next = iscapture ? capture_devs : output_devs; - if (iscapture) { - capture_devs = item; - } else { - output_devs = item; - } - - return SDL_TRUE; -} - -static void -addToDevList(const char *name, const int iscapture, AudioDeviceID devId, void *data) -{ - if (add_to_internal_dev_list(iscapture, devId)) { - SDL_AddAudioDevice(iscapture, name, (void *) ((size_t) devId)); - } -} - -static void -build_device_list(int iscapture, addDevFn addfn, void *addfndata) -{ - OSStatus result = noErr; - UInt32 size = 0; - AudioDeviceID *devs = NULL; - UInt32 i = 0; - UInt32 max = 0; - - result = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, - &devlist_address, 0, NULL, &size); - if (result != kAudioHardwareNoError) - return; - - devs = (AudioDeviceID *) alloca(size); - if (devs == NULL) - return; - - result = AudioObjectGetPropertyData(kAudioObjectSystemObject, - &devlist_address, 0, NULL, &size, devs); - if (result != kAudioHardwareNoError) - return; - - max = size / sizeof (AudioDeviceID); - for (i = 0; i < max; i++) { - CFStringRef cfstr = NULL; - char *ptr = NULL; - AudioDeviceID dev = devs[i]; - AudioBufferList *buflist = NULL; - int usable = 0; - CFIndex len = 0; - const AudioObjectPropertyAddress addr = { - kAudioDevicePropertyStreamConfiguration, - iscapture ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput, - kAudioObjectPropertyElementMaster - }; - - const AudioObjectPropertyAddress nameaddr = { - kAudioObjectPropertyName, - iscapture ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput, - kAudioObjectPropertyElementMaster - }; - - result = AudioObjectGetPropertyDataSize(dev, &addr, 0, NULL, &size); - if (result != noErr) - continue; - - buflist = (AudioBufferList *) SDL_malloc(size); - if (buflist == NULL) - continue; - - result = AudioObjectGetPropertyData(dev, &addr, 0, NULL, - &size, buflist); - - if (result == noErr) { - UInt32 j; - for (j = 0; j < buflist->mNumberBuffers; j++) { - if (buflist->mBuffers[j].mNumberChannels > 0) { - usable = 1; - break; - } - } - } - - SDL_free(buflist); - - if (!usable) - continue; - - - size = sizeof (CFStringRef); - result = AudioObjectGetPropertyData(dev, &nameaddr, 0, NULL, &size, &cfstr); - if (result != kAudioHardwareNoError) - continue; - - len = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfstr), - kCFStringEncodingUTF8); - - ptr = (char *) SDL_malloc(len + 1); - usable = ((ptr != NULL) && - (CFStringGetCString - (cfstr, ptr, len + 1, kCFStringEncodingUTF8))); - - CFRelease(cfstr); - - if (usable) { - len = strlen(ptr); - /* Some devices have whitespace at the end...trim it. */ - while ((len > 0) && (ptr[len - 1] == ' ')) { - len--; - } - usable = (len > 0); - } - - if (usable) { - ptr[len] = '\0'; - -#if DEBUG_COREAUDIO - printf("COREAUDIO: Found %s device #%d: '%s' (devid %d)\n", - ((iscapture) ? "capture" : "output"), - (int) *devCount, ptr, (int) dev); -#endif - addfn(ptr, iscapture, dev, addfndata); - } - SDL_free(ptr); /* addfn() would have copied the string. */ - } -} - -static void -free_audio_device_list(AudioDeviceList **list) -{ - AudioDeviceList *item = *list; - while (item) { - AudioDeviceList *next = item->next; - SDL_free(item); - item = next; - } - *list = NULL; -} - -static void -COREAUDIO_DetectDevices(void) -{ - build_device_list(SDL_TRUE, addToDevList, NULL); - build_device_list(SDL_FALSE, addToDevList, NULL); -} - -static void -build_device_change_list(const char *name, const int iscapture, AudioDeviceID devId, void *data) -{ - AudioDeviceList **list = (AudioDeviceList **) data; - AudioDeviceList *item; - for (item = *list; item != NULL; item = item->next) { - if (item->devid == devId) { - item->alive = SDL_TRUE; - return; - } - } - - add_to_internal_dev_list(iscapture, devId); /* new device, add it. */ - SDL_AddAudioDevice(iscapture, name, (void *) ((size_t) devId)); -} - -static void -reprocess_device_list(const int iscapture, AudioDeviceList **list) -{ - AudioDeviceList *item; - AudioDeviceList *prev = NULL; - for (item = *list; item != NULL; item = item->next) { - item->alive = SDL_FALSE; - } - - build_device_list(iscapture, build_device_change_list, list); - - /* free items in the list that aren't still alive. */ - item = *list; - while (item != NULL) { - AudioDeviceList *next = item->next; - if (item->alive) { - prev = item; - } else { - SDL_RemoveAudioDevice(iscapture, (void *) ((size_t) item->devid)); - if (prev) { - prev->next = item->next; - } else { - *list = item->next; - } - SDL_free(item); - } - item = next; - } -} - -/* this is called when the system's list of available audio devices changes. */ -static OSStatus -device_list_changed(AudioObjectID systemObj, UInt32 num_addr, const AudioObjectPropertyAddress *addrs, void *data) -{ - reprocess_device_list(SDL_TRUE, &capture_devs); - reprocess_device_list(SDL_FALSE, &output_devs); - return 0; -} -#endif - -/* The CoreAudio callback */ -static OSStatus -outputCallback(void *inRefCon, - AudioUnitRenderActionFlags * ioActionFlags, - const AudioTimeStamp * inTimeStamp, - UInt32 inBusNumber, UInt32 inNumberFrames, - AudioBufferList * ioData) -{ - SDL_AudioDevice *this = (SDL_AudioDevice *) inRefCon; - AudioBuffer *abuf; - UInt32 remaining, len; - void *ptr; - UInt32 i; - - /* Only do anything if audio is enabled and not paused */ - if (!this->enabled || this->paused) { - for (i = 0; i < ioData->mNumberBuffers; i++) { - abuf = &ioData->mBuffers[i]; - SDL_memset(abuf->mData, this->spec.silence, abuf->mDataByteSize); - } - return 0; - } - - /* No SDL conversion should be needed here, ever, since we accept - any input format in OpenAudio, and leave the conversion to CoreAudio. - */ - /* - SDL_assert(!this->convert.needed); - SDL_assert(this->spec.channels == ioData->mNumberChannels); - */ - - for (i = 0; i < ioData->mNumberBuffers; i++) { - abuf = &ioData->mBuffers[i]; - remaining = abuf->mDataByteSize; - ptr = abuf->mData; - while (remaining > 0) { - if (this->hidden->bufferOffset >= this->hidden->bufferSize) { - /* Generate the data */ - SDL_LockMutex(this->mixer_lock); - (*this->spec.callback)(this->spec.userdata, - this->hidden->buffer, this->hidden->bufferSize); - SDL_UnlockMutex(this->mixer_lock); - this->hidden->bufferOffset = 0; - } - - len = this->hidden->bufferSize - this->hidden->bufferOffset; - if (len > remaining) - len = remaining; - SDL_memcpy(ptr, (char *)this->hidden->buffer + - this->hidden->bufferOffset, len); - ptr = (char *)ptr + len; - remaining -= len; - this->hidden->bufferOffset += len; - } - } - - return 0; -} - -static OSStatus -inputCallback(void *inRefCon, - AudioUnitRenderActionFlags * ioActionFlags, - const AudioTimeStamp * inTimeStamp, - UInt32 inBusNumber, UInt32 inNumberFrames, - AudioBufferList * ioData) -{ - /* err = AudioUnitRender(afr->fAudioUnit, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, afr->fAudioBuffer); */ - /* !!! FIXME: write me! */ - return noErr; -} - - -#if MACOSX_COREAUDIO -static const AudioObjectPropertyAddress alive_address = -{ - kAudioDevicePropertyDeviceIsAlive, - kAudioObjectPropertyScopeGlobal, - kAudioObjectPropertyElementMaster -}; - -static OSStatus -device_unplugged(AudioObjectID devid, UInt32 num_addr, const AudioObjectPropertyAddress *addrs, void *data) -{ - SDL_AudioDevice *this = (SDL_AudioDevice *) data; - SDL_bool dead = SDL_FALSE; - UInt32 isAlive = 1; - UInt32 size = sizeof (isAlive); - OSStatus error; - - if (!this->enabled) { - return 0; /* already known to be dead. */ - } - - error = AudioObjectGetPropertyData(this->hidden->deviceID, &alive_address, - 0, NULL, &size, &isAlive); - - if (error == kAudioHardwareBadDeviceError) { - dead = SDL_TRUE; /* device was unplugged. */ - } else if ((error == kAudioHardwareNoError) && (!isAlive)) { - dead = SDL_TRUE; /* device died in some other way. */ - } - - if (dead) { - SDL_OpenedAudioDeviceDisconnected(this); - } - - return 0; -} -#endif - -static void -COREAUDIO_CloseDevice(_THIS) -{ - if (this->hidden != NULL) { - if (this->hidden->audioUnitOpened) { - #if MACOSX_COREAUDIO - /* Unregister our disconnect callback. */ - AudioObjectRemovePropertyListener(this->hidden->deviceID, &alive_address, device_unplugged, this); - #endif - - AURenderCallbackStruct callback; - const AudioUnitElement output_bus = 0; - const AudioUnitElement input_bus = 1; - const int iscapture = this->iscapture; - const AudioUnitElement bus = - ((iscapture) ? input_bus : output_bus); - const AudioUnitScope scope = - ((iscapture) ? kAudioUnitScope_Output : - kAudioUnitScope_Input); - - /* stop processing the audio unit */ - AudioOutputUnitStop(this->hidden->audioUnit); - - /* Remove the input callback */ - SDL_memset(&callback, 0, sizeof(AURenderCallbackStruct)); - AudioUnitSetProperty(this->hidden->audioUnit, - kAudioUnitProperty_SetRenderCallback, - scope, bus, &callback, sizeof(callback)); - - #if MACOSX_COREAUDIO - CloseComponent(this->hidden->audioUnit); - #else - AudioComponentInstanceDispose(this->hidden->audioUnit); - #endif - - this->hidden->audioUnitOpened = 0; - } - SDL_free(this->hidden->buffer); - SDL_free(this->hidden); - this->hidden = NULL; - } -} - -#if MACOSX_COREAUDIO -static int -prepare_device(_THIS, void *handle, int iscapture) -{ - AudioDeviceID devid = (AudioDeviceID) ((size_t) handle); - OSStatus result = noErr; - UInt32 size = 0; - UInt32 alive = 0; - pid_t pid = 0; - - AudioObjectPropertyAddress addr = { - 0, - kAudioObjectPropertyScopeGlobal, - kAudioObjectPropertyElementMaster - }; - - if (handle == NULL) { - size = sizeof (AudioDeviceID); - addr.mSelector = - ((iscapture) ? kAudioHardwarePropertyDefaultInputDevice : - kAudioHardwarePropertyDefaultOutputDevice); - result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr, - 0, NULL, &size, &devid); - CHECK_RESULT("AudioHardwareGetProperty (default device)"); - } - - addr.mSelector = kAudioDevicePropertyDeviceIsAlive; - addr.mScope = iscapture ? kAudioDevicePropertyScopeInput : - kAudioDevicePropertyScopeOutput; - - size = sizeof (alive); - result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &alive); - CHECK_RESULT - ("AudioDeviceGetProperty (kAudioDevicePropertyDeviceIsAlive)"); - - if (!alive) { - SDL_SetError("CoreAudio: requested device exists, but isn't alive."); - return 0; - } - - addr.mSelector = kAudioDevicePropertyHogMode; - size = sizeof (pid); - result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &pid); - - /* some devices don't support this property, so errors are fine here. */ - if ((result == noErr) && (pid != -1)) { - SDL_SetError("CoreAudio: requested device is being hogged."); - return 0; - } - - this->hidden->deviceID = devid; - return 1; -} -#endif - -static int -prepare_audiounit(_THIS, void *handle, int iscapture, - const AudioStreamBasicDescription * strdesc) -{ - OSStatus result = noErr; - AURenderCallbackStruct callback; -#if MACOSX_COREAUDIO - ComponentDescription desc; - Component comp = NULL; -#else - AudioComponentDescription desc; - AudioComponent comp = NULL; -#endif - const AudioUnitElement output_bus = 0; - const AudioUnitElement input_bus = 1; - const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus); - const AudioUnitScope scope = ((iscapture) ? kAudioUnitScope_Output : - kAudioUnitScope_Input); - -#if MACOSX_COREAUDIO - if (!prepare_device(this, handle, iscapture)) { - return 0; - } -#endif - - SDL_zero(desc); - desc.componentType = kAudioUnitType_Output; - desc.componentManufacturer = kAudioUnitManufacturer_Apple; - -#if MACOSX_COREAUDIO - desc.componentSubType = kAudioUnitSubType_DefaultOutput; - comp = FindNextComponent(NULL, &desc); -#else - desc.componentSubType = kAudioUnitSubType_RemoteIO; - comp = AudioComponentFindNext(NULL, &desc); -#endif - - if (comp == NULL) { - SDL_SetError("Couldn't find requested CoreAudio component"); - return 0; - } - - /* Open & initialize the audio unit */ -#if MACOSX_COREAUDIO - result = OpenAComponent(comp, &this->hidden->audioUnit); - CHECK_RESULT("OpenAComponent"); -#else - /* - AudioComponentInstanceNew only available on iPhone OS 2.0 and Mac OS X 10.6 - We can't use OpenAComponent on iPhone because it is not present - */ - result = AudioComponentInstanceNew(comp, &this->hidden->audioUnit); - CHECK_RESULT("AudioComponentInstanceNew"); -#endif - - this->hidden->audioUnitOpened = 1; - -#if MACOSX_COREAUDIO - result = AudioUnitSetProperty(this->hidden->audioUnit, - kAudioOutputUnitProperty_CurrentDevice, - kAudioUnitScope_Global, 0, - &this->hidden->deviceID, - sizeof(AudioDeviceID)); - CHECK_RESULT - ("AudioUnitSetProperty (kAudioOutputUnitProperty_CurrentDevice)"); -#endif - - /* Set the data format of the audio unit. */ - result = AudioUnitSetProperty(this->hidden->audioUnit, - kAudioUnitProperty_StreamFormat, - scope, bus, strdesc, sizeof(*strdesc)); - CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)"); - - /* Set the audio callback */ - SDL_memset(&callback, 0, sizeof(AURenderCallbackStruct)); - callback.inputProc = ((iscapture) ? inputCallback : outputCallback); - callback.inputProcRefCon = this; - result = AudioUnitSetProperty(this->hidden->audioUnit, - kAudioUnitProperty_SetRenderCallback, - scope, bus, &callback, sizeof(callback)); - CHECK_RESULT - ("AudioUnitSetProperty (kAudioUnitProperty_SetRenderCallback)"); - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&this->spec); - - /* Allocate a sample buffer */ - this->hidden->bufferOffset = this->hidden->bufferSize = this->spec.size; - this->hidden->buffer = SDL_malloc(this->hidden->bufferSize); - - result = AudioUnitInitialize(this->hidden->audioUnit); - CHECK_RESULT("AudioUnitInitialize"); - - /* Finally, start processing of the audio unit */ - result = AudioOutputUnitStart(this->hidden->audioUnit); - CHECK_RESULT("AudioOutputUnitStart"); - -#if MACOSX_COREAUDIO - /* Fire a callback if the device stops being "alive" (disconnected, etc). */ - AudioObjectAddPropertyListener(this->hidden->deviceID, &alive_address, device_unplugged, this); -#endif - - /* We're running! */ - return 1; -} - - -static int -COREAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) -{ - AudioStreamBasicDescription strdesc; - SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); - int valid_datatype = 0; - - /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Setup a AudioStreamBasicDescription with the requested format */ - SDL_memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription)); - strdesc.mFormatID = kAudioFormatLinearPCM; - strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked; - strdesc.mChannelsPerFrame = this->spec.channels; - strdesc.mSampleRate = this->spec.freq; - strdesc.mFramesPerPacket = 1; - - while ((!valid_datatype) && (test_format)) { - this->spec.format = test_format; - /* Just a list of valid SDL formats, so people don't pass junk here. */ - switch (test_format) { - case AUDIO_U8: - case AUDIO_S8: - case AUDIO_U16LSB: - case AUDIO_S16LSB: - case AUDIO_U16MSB: - case AUDIO_S16MSB: - case AUDIO_S32LSB: - case AUDIO_S32MSB: - case AUDIO_F32LSB: - case AUDIO_F32MSB: - valid_datatype = 1; - strdesc.mBitsPerChannel = SDL_AUDIO_BITSIZE(this->spec.format); - if (SDL_AUDIO_ISBIGENDIAN(this->spec.format)) - strdesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian; - - if (SDL_AUDIO_ISFLOAT(this->spec.format)) - strdesc.mFormatFlags |= kLinearPCMFormatFlagIsFloat; - else if (SDL_AUDIO_ISSIGNED(this->spec.format)) - strdesc.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; - break; - } - } - - if (!valid_datatype) { /* shouldn't happen, but just in case... */ - COREAUDIO_CloseDevice(this); - return SDL_SetError("Unsupported audio format"); - } - - strdesc.mBytesPerFrame = - strdesc.mBitsPerChannel * strdesc.mChannelsPerFrame / 8; - strdesc.mBytesPerPacket = - strdesc.mBytesPerFrame * strdesc.mFramesPerPacket; - - if (!prepare_audiounit(this, handle, iscapture, &strdesc)) { - COREAUDIO_CloseDevice(this); - return -1; /* prepare_audiounit() will call SDL_SetError()... */ - } - - return 0; /* good to go. */ -} - -static void -COREAUDIO_Deinitialize(void) -{ -#if MACOSX_COREAUDIO - AudioObjectRemovePropertyListener(kAudioObjectSystemObject, &devlist_address, device_list_changed, NULL); - free_audio_device_list(&capture_devs); - free_audio_device_list(&output_devs); -#endif -} - -static int -COREAUDIO_Init(SDL_AudioDriverImpl * impl) -{ - /* Set the function pointers */ - impl->OpenDevice = COREAUDIO_OpenDevice; - impl->CloseDevice = COREAUDIO_CloseDevice; - impl->Deinitialize = COREAUDIO_Deinitialize; - -#if MACOSX_COREAUDIO - impl->DetectDevices = COREAUDIO_DetectDevices; - AudioObjectAddPropertyListener(kAudioObjectSystemObject, &devlist_address, device_list_changed, NULL); -#else - impl->OnlyHasDefaultOutputDevice = 1; - - /* Set category to ambient sound so that other music continues playing. - You can change this at runtime in your own code if you need different - behavior. If this is common, we can add an SDL hint for this. - */ - AudioSessionInitialize(NULL, NULL, NULL, nil); - UInt32 category = kAudioSessionCategory_AmbientSound; - AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(UInt32), &category); -#endif - - impl->ProvidesOwnCallbackThread = 1; - - return 1; /* this audio target is available. */ -} - -AudioBootStrap COREAUDIO_bootstrap = { - "coreaudio", "CoreAudio", COREAUDIO_Init, 0 -}; - -#endif /* SDL_AUDIO_DRIVER_COREAUDIO */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Engine/lib/sdl/src/audio/sdlgenaudiocvt.pl b/Engine/lib/sdl/src/audio/sdlgenaudiocvt.pl old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/src/dynapi/gendynapi.pl b/Engine/lib/sdl/src/dynapi/gendynapi.pl old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/src/joystick/sort_controllers.py b/Engine/lib/sdl/src/joystick/sort_controllers.py old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/src/video/sdlgenblit.pl b/Engine/lib/sdl/src/video/sdlgenblit.pl old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/test/Makefile.in b/Engine/lib/sdl/test/Makefile.in index 9a1df774e..68f0d3dab 100644 --- a/Engine/lib/sdl/test/Makefile.in +++ b/Engine/lib/sdl/test/Makefile.in @@ -13,7 +13,10 @@ TARGETS = \ loopwavequeue$(EXE) \ testatomic$(EXE) \ testaudioinfo$(EXE) \ + testaudiocapture$(EXE) \ testautomation$(EXE) \ + testbounds$(EXE) \ + testcustomcursor$(EXE) \ testdraw2$(EXE) \ testdrawchessboard$(EXE) \ testdropfile$(EXE) \ @@ -61,6 +64,7 @@ TARGETS = \ testrendercopyex$(EXE) \ testmessage$(EXE) \ testdisplayinfo$(EXE) \ + testqsort$(EXE) \ controllermap$(EXE) \ all: Makefile $(TARGETS) @@ -110,6 +114,9 @@ testmultiaudio$(EXE): $(srcdir)/testmultiaudio.c testaudiohotplug$(EXE): $(srcdir)/testaudiohotplug.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) +testaudiocapture$(EXE): $(srcdir)/testaudiocapture.c + $(CC) -o $@ $^ $(CFLAGS) $(LIBS) + testatomic$(EXE): $(srcdir)/testatomic.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @@ -270,6 +277,15 @@ testmessage$(EXE): $(srcdir)/testmessage.c testdisplayinfo$(EXE): $(srcdir)/testdisplayinfo.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) +testqsort$(EXE): $(srcdir)/testqsort.c + $(CC) -o $@ $^ $(CFLAGS) $(LIBS) + +testbounds$(EXE): $(srcdir)/testbounds.c + $(CC) -o $@ $^ $(CFLAGS) $(LIBS) + +testcustomcursor$(EXE): $(srcdir)/testcustomcursor.c + $(CC) -o $@ $^ $(CFLAGS) $(LIBS) + controllermap$(EXE): $(srcdir)/controllermap.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) diff --git a/Engine/lib/sdl/test/autogen.sh b/Engine/lib/sdl/test/autogen.sh old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/test/configure b/Engine/lib/sdl/test/configure old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/test/controllermap.c b/Engine/lib/sdl/test/controllermap.c index 3fb30d68a..d626f9f89 100644 --- a/Engine/lib/sdl/test/controllermap.c +++ b/Engine/lib/sdl/test/controllermap.c @@ -26,12 +26,9 @@ #define SCREEN_HEIGHT 480 #else #define SCREEN_WIDTH 512 -#define SCREEN_HEIGHT 317 +#define SCREEN_HEIGHT 320 #endif -#define MAP_WIDTH 512 -#define MAP_HEIGHT 317 - #define MARKER_BUTTON 1 #define MARKER_AXIS 2 @@ -47,7 +44,7 @@ typedef struct MappingStep SDL_Texture * -LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) +LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent) { SDL_Surface *temp; SDL_Texture *texture; @@ -226,7 +223,7 @@ WatchJoystick(SDL_Joystick * joystick) SDL_RenderCopy(screen, background, NULL, NULL); SDL_SetTextureAlphaMod(marker, alpha); SDL_SetTextureColorMod(marker, 10, 255, 21); - SDL_RenderCopyEx(screen, marker, NULL, &dst, step->angle, NULL, 0); + SDL_RenderCopyEx(screen, marker, NULL, &dst, step->angle, NULL, SDL_FLIP_NONE); SDL_RenderPresent(screen); if (SDL_PollEvent(&event)) { diff --git a/Engine/lib/sdl/test/gcc-fat.sh b/Engine/lib/sdl/test/gcc-fat.sh old mode 100644 new mode 100755 diff --git a/Engine/lib/sdl/test/testatomic.c b/Engine/lib/sdl/test/testatomic.c index 41cc9ab1b..d371ef31f 100644 --- a/Engine/lib/sdl/test/testatomic.c +++ b/Engine/lib/sdl/test/testatomic.c @@ -284,7 +284,7 @@ typedef struct char cache_pad4[SDL_CACHELINE_SIZE-sizeof(SDL_SpinLock)-2*sizeof(SDL_atomic_t)]; #endif - volatile SDL_bool active; + SDL_atomic_t active; /* Only needed for the mutex test */ SDL_mutex *mutex; @@ -305,7 +305,7 @@ static void InitEventQueue(SDL_EventQueue *queue) SDL_AtomicSet(&queue->rwcount, 0); SDL_AtomicSet(&queue->watcher, 0); #endif - queue->active = SDL_TRUE; + SDL_AtomicSet(&queue->active, 1); } static SDL_bool EnqueueEvent_LockFree(SDL_EventQueue *queue, const SDL_Event *event) @@ -538,7 +538,7 @@ static int FIFO_Reader(void* _data) if (DequeueEvent_LockFree(queue, &event)) { WriterData *writer = (WriterData*)event.user.data1; ++data->counters[writer->index]; - } else if (queue->active) { + } else if (SDL_AtomicGet(&queue->active)) { ++data->waits; SDL_Delay(0); } else { @@ -551,7 +551,7 @@ static int FIFO_Reader(void* _data) if (DequeueEvent_Mutex(queue, &event)) { WriterData *writer = (WriterData*)event.user.data1; ++data->counters[writer->index]; - } else if (queue->active) { + } else if (SDL_AtomicGet(&queue->active)) { ++data->waits; SDL_Delay(0); } else { @@ -571,7 +571,7 @@ static int FIFO_Watcher(void* _data) { SDL_EventQueue *queue = (SDL_EventQueue *)_data; - while (queue->active) { + while (SDL_AtomicGet(&queue->active)) { SDL_AtomicLock(&queue->lock); SDL_AtomicIncRef(&queue->watcher); while (SDL_AtomicGet(&queue->rwcount) > 0) { @@ -652,7 +652,7 @@ static void RunFIFOTest(SDL_bool lock_free) } /* Shut down the queue so readers exit */ - queue.active = SDL_FALSE; + SDL_AtomicSet(&queue.active, 0); /* Wait for the readers */ while (SDL_AtomicGet(&readersRunning) > 0) { diff --git a/Engine/lib/sdl/test/testaudiocapture.c b/Engine/lib/sdl/test/testaudiocapture.c new file mode 100644 index 000000000..26321a71c --- /dev/null +++ b/Engine/lib/sdl/test/testaudiocapture.c @@ -0,0 +1,165 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +#include "SDL.h" + +#include + +#ifdef __EMSCRIPTEN__ +#include +#endif + +static SDL_Window *window = NULL; +static SDL_Renderer *renderer = NULL; +static SDL_AudioSpec spec; +static SDL_AudioDeviceID devid_in = 0; +static SDL_AudioDeviceID devid_out = 0; + +static void +loop() +{ + SDL_bool please_quit = SDL_FALSE; + SDL_Event e; + + while (SDL_PollEvent(&e)) { + if (e.type == SDL_QUIT) { + please_quit = SDL_TRUE; + } else if (e.type == SDL_KEYDOWN) { + if (e.key.keysym.sym == SDLK_ESCAPE) { + please_quit = SDL_TRUE; + } + } else if (e.type == SDL_MOUSEBUTTONDOWN) { + if (e.button.button == 1) { + SDL_PauseAudioDevice(devid_out, SDL_TRUE); + SDL_PauseAudioDevice(devid_in, SDL_FALSE); + } + } else if (e.type == SDL_MOUSEBUTTONUP) { + if (e.button.button == 1) { + SDL_PauseAudioDevice(devid_in, SDL_TRUE); + SDL_PauseAudioDevice(devid_out, SDL_FALSE); + } + } + } + + if (SDL_GetAudioDeviceStatus(devid_in) == SDL_AUDIO_PLAYING) { + SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255); + } else { + SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); + } + SDL_RenderClear(renderer); + SDL_RenderPresent(renderer); + + if (please_quit) { + /* stop playing back, quit. */ + SDL_Log("Shutting down.\n"); + SDL_PauseAudioDevice(devid_in, 1); + SDL_CloseAudioDevice(devid_in); + SDL_PauseAudioDevice(devid_out, 1); + SDL_CloseAudioDevice(devid_out); + SDL_DestroyRenderer(renderer); + SDL_DestroyWindow(window); + SDL_Quit(); + #ifdef __EMSCRIPTEN__ + emscripten_cancel_main_loop(); + #endif + exit(0); + } + + /* Note that it would be easier to just have a one-line function that + calls SDL_QueueAudio() as a capture device callback, but we're + trying to test the API, so we use SDL_DequeueAudio() here. */ + while (SDL_TRUE) { + Uint8 buf[1024]; + const Uint32 br = SDL_DequeueAudio(devid_in, buf, sizeof (buf)); + SDL_QueueAudio(devid_out, buf, br); + if (br < sizeof (buf)) { + break; + } + } +} + +int +main(int argc, char **argv) +{ + /* (argv[1] == NULL means "open default device.") */ + const char *devname = argv[1]; + SDL_AudioSpec wanted; + int devcount; + int i; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Load the SDL library */ + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return (1); + } + + window = SDL_CreateWindow("testaudiocapture", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 320, 240, 0); + renderer = SDL_CreateRenderer(window, -1, 0); + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderClear(renderer); + SDL_RenderPresent(renderer); + + SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver()); + + devcount = SDL_GetNumAudioDevices(SDL_TRUE); + for (i = 0; i < devcount; i++) { + SDL_Log(" Capture device #%d: '%s'\n", i, SDL_GetAudioDeviceName(i, SDL_TRUE)); + } + + SDL_zero(wanted); + wanted.freq = 44100; + wanted.format = AUDIO_F32SYS; + wanted.channels = 1; + wanted.samples = 4096; + wanted.callback = NULL; + + SDL_zero(spec); + + /* DirectSound can fail in some instances if you open the same hardware + for both capture and output and didn't open the output end first, + according to the docs, so if you're doing something like this, always + open your capture devices second in case you land in those bizarre + circumstances. */ + + SDL_Log("Opening default playback device...\n"); + devid_out = SDL_OpenAudioDevice(NULL, SDL_FALSE, &wanted, &spec, SDL_AUDIO_ALLOW_ANY_CHANGE); + if (!devid_out) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open an audio device for playback: %s!\n", SDL_GetError()); + SDL_Quit(); + exit(1); + } + + SDL_Log("Opening capture device %s%s%s...\n", + devname ? "'" : "", + devname ? devname : "[[default]]", + devname ? "'" : ""); + + devid_in = SDL_OpenAudioDevice(argv[1], SDL_TRUE, &spec, &spec, 0); + if (!devid_in) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open an audio device for capture: %s!\n", SDL_GetError()); + SDL_Quit(); + exit(1); + } + + SDL_Log("Ready! Hold down mouse or finger to record!\n"); + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (1) { loop(); SDL_Delay(16); } +#endif + + return 0; +} + diff --git a/Engine/lib/sdl/test/testaudiohotplug.c b/Engine/lib/sdl/test/testaudiohotplug.c index e13868ec2..73d480505 100644 --- a/Engine/lib/sdl/test/testaudiohotplug.c +++ b/Engine/lib/sdl/test/testaudiohotplug.c @@ -74,6 +74,12 @@ poked(int sig) done = 1; } +static const char* +devtypestr(int iscapture) +{ + return iscapture ? "capture" : "output"; +} + static void iteration() { @@ -82,10 +88,21 @@ iteration() while (SDL_PollEvent(&e)) { if (e.type == SDL_QUIT) { done = 1; + } else if (e.type == SDL_KEYUP) { + if (e.key.keysym.sym == SDLK_ESCAPE) + done = 1; } else if (e.type == SDL_AUDIODEVICEADDED) { - const char *name = SDL_GetAudioDeviceName(e.adevice.which, 0); - SDL_Log("New %s audio device: %s\n", e.adevice.iscapture ? "capture" : "output", name); - if (!e.adevice.iscapture) { + int index = e.adevice.which; + int iscapture = e.adevice.iscapture; + const char *name = SDL_GetAudioDeviceName(index, iscapture); + if (name != NULL) + SDL_Log("New %s audio device at index %u: %s\n", devtypestr(iscapture), (unsigned int) index, name); + else { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Got new %s device at index %u, but failed to get the name: %s\n", + devtypestr(iscapture), (unsigned int) index, SDL_GetError()); + continue; + } + if (!iscapture) { positions[posindex] = 0; spec.userdata = &positions[posindex++]; spec.callback = fillerup; @@ -99,7 +116,7 @@ iteration() } } else if (e.type == SDL_AUDIODEVICEREMOVED) { dev = (SDL_AudioDeviceID) e.adevice.which; - SDL_Log("%s device %u removed.\n", e.adevice.iscapture ? "capture" : "output", (unsigned int) dev); + SDL_Log("%s device %u removed.\n", devtypestr(e.adevice.iscapture), (unsigned int) dev); SDL_CloseAudioDevice(dev); } } @@ -163,6 +180,7 @@ main(int argc, char *argv[]) SDL_Log("%i: %s", i, SDL_GetAudioDriver(i)); } + SDL_Log("Select a driver with the SDL_AUDIODRIVER environment variable.\n"); SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver()); #ifdef __EMSCRIPTEN__ @@ -175,6 +193,8 @@ main(int argc, char *argv[]) #endif /* Clean up on signal */ + /* Quit audio first, then free WAV. This prevents access violations in the audio threads. */ + SDL_QuitSubSystem(SDL_INIT_AUDIO); SDL_FreeWAV(sound); SDL_Quit(); return (0); diff --git a/Engine/lib/sdl/test/testaudioinfo.c b/Engine/lib/sdl/test/testaudioinfo.c index 53bf0f5e2..485fd0a38 100644 --- a/Engine/lib/sdl/test/testaudioinfo.c +++ b/Engine/lib/sdl/test/testaudioinfo.c @@ -18,7 +18,7 @@ print_devices(int iscapture) const char *typestr = ((iscapture) ? "capture" : "output"); int n = SDL_GetNumAudioDevices(iscapture); - SDL_Log("%s devices:\n", typestr); + SDL_Log("Found %d %s device%s:\n", n, typestr, n != 1 ? "s" : ""); if (n == -1) SDL_Log(" Driver can't detect specific %s devices.\n\n", typestr); @@ -27,7 +27,11 @@ print_devices(int iscapture) else { int i; for (i = 0; i < n; i++) { - SDL_Log(" %s\n", SDL_GetAudioDeviceName(i, iscapture)); + const char *name = SDL_GetAudioDeviceName(i, iscapture); + if (name != NULL) + SDL_Log(" %d: %s\n", i, name); + else + SDL_Log(" %d Error: %s\n", i, SDL_GetError()); } SDL_Log("\n"); } @@ -55,9 +59,9 @@ main(int argc, char **argv) int i; SDL_Log("Built-in audio drivers:\n"); for (i = 0; i < n; ++i) { - SDL_Log(" %s\n", SDL_GetAudioDriver(i)); + SDL_Log(" %d: %s\n", i, SDL_GetAudioDriver(i)); } - SDL_Log("\n"); + SDL_Log("Select a driver with the SDL_AUDIODRIVER environment variable.\n"); } SDL_Log("Using audio driver: %s\n\n", SDL_GetCurrentAudioDriver()); diff --git a/Engine/lib/sdl/test/testautomation_events.c b/Engine/lib/sdl/test/testautomation_events.c index f9eb5bb9e..a0119bdbe 100644 --- a/Engine/lib/sdl/test/testautomation_events.c +++ b/Engine/lib/sdl/test/testautomation_events.c @@ -87,7 +87,7 @@ events_addDelEventWatch(void *arg) /* Create user event */ event.type = SDL_USEREVENT; - event.user.code = SDLTest_RandomSint32();; + event.user.code = SDLTest_RandomSint32(); event.user.data1 = (void *)&_userdataValue1; event.user.data2 = (void *)&_userdataValue2; @@ -137,7 +137,7 @@ events_addDelEventWatchWithUserdata(void *arg) /* Create user event */ event.type = SDL_USEREVENT; - event.user.code = SDLTest_RandomSint32();; + event.user.code = SDLTest_RandomSint32(); event.user.data1 = (void *)&_userdataValue1; event.user.data2 = (void *)&_userdataValue2; diff --git a/Engine/lib/sdl/test/testautomation_keyboard.c b/Engine/lib/sdl/test/testautomation_keyboard.c index 453832e25..b2c3b9ae1 100644 --- a/Engine/lib/sdl/test/testautomation_keyboard.c +++ b/Engine/lib/sdl/test/testautomation_keyboard.c @@ -401,8 +401,8 @@ keyboard_setTextInputRect(void *arg) SDL_Rect refRect; /* Normal visible refRect, origin inside */ - refRect.x = SDLTest_RandomIntegerInRange(1, 50);; - refRect.y = SDLTest_RandomIntegerInRange(1, 50);; + refRect.x = SDLTest_RandomIntegerInRange(1, 50); + refRect.y = SDLTest_RandomIntegerInRange(1, 50); refRect.w = SDLTest_RandomIntegerInRange(10, 50); refRect.h = SDLTest_RandomIntegerInRange(10, 50); _testSetTextInputRect(refRect); @@ -415,8 +415,8 @@ keyboard_setTextInputRect(void *arg) _testSetTextInputRect(refRect); /* 1Pixel refRect */ - refRect.x = SDLTest_RandomIntegerInRange(10, 50);; - refRect.y = SDLTest_RandomIntegerInRange(10, 50);; + refRect.x = SDLTest_RandomIntegerInRange(10, 50); + refRect.y = SDLTest_RandomIntegerInRange(10, 50); refRect.w = 1; refRect.h = 1; _testSetTextInputRect(refRect); @@ -450,15 +450,15 @@ keyboard_setTextInputRect(void *arg) _testSetTextInputRect(refRect); /* negative refRect */ - refRect.x = SDLTest_RandomIntegerInRange(-200, -100);; - refRect.y = SDLTest_RandomIntegerInRange(-200, -100);; + refRect.x = SDLTest_RandomIntegerInRange(-200, -100); + refRect.y = SDLTest_RandomIntegerInRange(-200, -100); refRect.w = 50; refRect.h = 50; _testSetTextInputRect(refRect); /* oversized refRect */ - refRect.x = SDLTest_RandomIntegerInRange(1, 50);; - refRect.y = SDLTest_RandomIntegerInRange(1, 50);; + refRect.x = SDLTest_RandomIntegerInRange(1, 50); + refRect.y = SDLTest_RandomIntegerInRange(1, 50); refRect.w = 5000; refRect.h = 5000; _testSetTextInputRect(refRect); diff --git a/Engine/lib/sdl/test/testautomation_main.c b/Engine/lib/sdl/test/testautomation_main.c index ef8f19e9e..ae060cdd1 100644 --- a/Engine/lib/sdl/test/testautomation_main.c +++ b/Engine/lib/sdl/test/testautomation_main.c @@ -137,7 +137,7 @@ static const SDLTest_TestCaseReference mainTest3 = static const SDLTest_TestCaseReference mainTest4 = { (SDLTest_TestCaseFp)main_testImpliedJoystickQuit, "main_testImpliedJoystickQuit", "Tests that quit for gamecontroller doesn't quit joystick if you inited it explicitly", TEST_ENABLED}; -/* Sequence of Platform test cases */ +/* Sequence of Main test cases */ static const SDLTest_TestCaseReference *mainTests[] = { &mainTest1, &mainTest2, @@ -146,7 +146,7 @@ static const SDLTest_TestCaseReference *mainTests[] = { NULL }; -/* Platform test suite (global) */ +/* Main test suite (global) */ SDLTest_TestSuiteReference mainTestSuite = { "Main", NULL, diff --git a/Engine/lib/sdl/test/testautomation_sdltest.c b/Engine/lib/sdl/test/testautomation_sdltest.c index ec1da8a50..54cd6e257 100644 --- a/Engine/lib/sdl/test/testautomation_sdltest.c +++ b/Engine/lib/sdl/test/testautomation_sdltest.c @@ -1093,7 +1093,7 @@ sdltest_randomIntegerInRange(void *arg) SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result); /* Range with max at integer limit */ - min = long_min - (Sint32)SDLTest_RandomSint16();; + min = long_min - (Sint32)SDLTest_RandomSint16(); max = long_max; result = SDLTest_RandomIntegerInRange(min, max); SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(...,SINT32_MAX)"); diff --git a/Engine/lib/sdl/test/testautomation_stdlib.c b/Engine/lib/sdl/test/testautomation_stdlib.c index 89245fdcb..b541995f5 100644 --- a/Engine/lib/sdl/test/testautomation_stdlib.c +++ b/Engine/lib/sdl/test/testautomation_stdlib.c @@ -253,6 +253,43 @@ stdlib_getsetenv(void *arg) return TEST_COMPLETED; } +/** + * @brief Call to SDL_sscanf + */ +#undef SDL_sscanf +int +stdlib_sscanf(void *arg) +{ + int output; + int result; + int expected_output; + int expected_result; + + expected_output = output = 123; + expected_result = -1; + result = SDL_sscanf("", "%i", &output); + SDLTest_AssertPass("Call to SDL_sscanf(\"\", \"%%i\", &output)"); + SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + expected_output = output = 123; + expected_result = 0; + result = SDL_sscanf("a", "%i", &output); + SDLTest_AssertPass("Call to SDL_sscanf(\"a\", \"%%i\", &output)"); + SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + output = 123; + expected_output = 2; + expected_result = 1; + result = SDL_sscanf("2", "%i", &output); + SDLTest_AssertPass("Call to SDL_sscanf(\"2\", \"%%i\", &output)"); + SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + return TEST_COMPLETED; +} + /* ================= Test References ================== */ /* Standard C routine test cases */ @@ -265,12 +302,15 @@ static const SDLTest_TestCaseReference stdlibTest2 = static const SDLTest_TestCaseReference stdlibTest3 = { (SDLTest_TestCaseFp)stdlib_getsetenv, "stdlib_getsetenv", "Call to SDL_getenv and SDL_setenv", TEST_ENABLED }; +static const SDLTest_TestCaseReference stdlibTest4 = + { (SDLTest_TestCaseFp)stdlib_sscanf, "stdlib_sscanf", "Call to SDL_sscanf", TEST_ENABLED }; + /* Sequence of Standard C routine test cases */ static const SDLTest_TestCaseReference *stdlibTests[] = { - &stdlibTest1, &stdlibTest2, &stdlibTest3, NULL + &stdlibTest1, &stdlibTest2, &stdlibTest3, &stdlibTest4, NULL }; -/* Timer test suite (global) */ +/* Standard C routine test suite (global) */ SDLTest_TestSuiteReference stdlibTestSuite = { "Stdlib", NULL, diff --git a/Engine/lib/sdl/test/testbounds.c b/Engine/lib/sdl/test/testbounds.c new file mode 100644 index 000000000..b410be96c --- /dev/null +++ b/Engine/lib/sdl/test/testbounds.c @@ -0,0 +1,40 @@ +/* + Copyright (C) 1997-2014 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +#include "SDL.h" + +int main(int argc, char **argv) +{ + int total, i; + + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + SDL_Log("SDL_Init(SDL_INIT_VIDEO) failed: %s", SDL_GetError()); + return 1; + } + + total = SDL_GetNumVideoDisplays(); + for (i = 0; i < total; i++) { + SDL_Rect bounds = { -1,-1,-1,-1 }, usable = { -1,-1,-1,-1 }; + SDL_GetDisplayBounds(i, &bounds); + SDL_GetDisplayUsableBounds(i, &usable); + SDL_Log("Display #%d ('%s'): bounds={(%d,%d),%dx%d}, usable={(%d,%d),%dx%d}", + i, SDL_GetDisplayName(i), + bounds.x, bounds.y, bounds.w, bounds.h, + usable.x, usable.y, usable.w, usable.h); + } + + SDL_Quit(); + return 0; +} + +/* vi: set ts=4 sw=4 expandtab: */ + diff --git a/Engine/lib/sdl/test/testcustomcursor.c b/Engine/lib/sdl/test/testcustomcursor.c new file mode 100644 index 000000000..88b5c322d --- /dev/null +++ b/Engine/lib/sdl/test/testcustomcursor.c @@ -0,0 +1,216 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +#include +#include + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#include "SDL_test_common.h" + +/* Stolen from the mailing list */ +/* Creates a new mouse cursor from an XPM */ + + +/* XPM */ +static const char *arrow[] = { + /* width height num_colors chars_per_pixel */ + " 32 32 3 1", + /* colors */ + "X c #000000", + ". c #ffffff", + " c None", + /* pixels */ + "X ", + "XX ", + "X.X ", + "X..X ", + "X...X ", + "X....X ", + "X.....X ", + "X......X ", + "X.......X ", + "X........X ", + "X.....XXXXX ", + "X..X..X ", + "X.X X..X ", + "XX X..X ", + "X X..X ", + " X..X ", + " X..X ", + " X..X ", + " XX ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "0,0" +}; + +static SDL_Cursor* +init_color_cursor(const char *file) +{ + SDL_Cursor *cursor = NULL; + SDL_Surface *surface = SDL_LoadBMP(file); + if (surface) { + cursor = SDL_CreateColorCursor(surface, 0, 0); + SDL_FreeSurface(surface); + } + return cursor; +} + +static SDL_Cursor* +init_system_cursor(const char *image[]) +{ + int i, row, col; + Uint8 data[4*32]; + Uint8 mask[4*32]; + int hot_x, hot_y; + + i = -1; + for (row=0; row<32; ++row) { + for (col=0; col<32; ++col) { + if (col % 8) { + data[i] <<= 1; + mask[i] <<= 1; + } else { + ++i; + data[i] = mask[i] = 0; + } + switch (image[4+row][col]) { + case 'X': + data[i] |= 0x01; + mask[i] |= 0x01; + break; + case '.': + mask[i] |= 0x01; + break; + case ' ': + break; + } + } + } + sscanf(image[4+row], "%d,%d", &hot_x, &hot_y); + return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y); +} + +static SDLTest_CommonState *state; +int done; +SDL_Cursor *cursor = NULL; + +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + SDLTest_CommonQuit(state); + exit(rc); +} + +void +loop() +{ + int i; + SDL_Event event; + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + + for (i = 0; i < state->num_windows; ++i) { + SDL_Renderer *renderer = state->renderers[i]; + SDL_RenderClear(renderer); + SDL_RenderPresent(renderer); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + +int +main(int argc, char *argv[]) +{ + int i; + const char *color_cursor = NULL; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Initialize test framework */ + state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); + if (!state) { + return 1; + } + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + if (consumed == 0) { + color_cursor = argv[i]; + break; + } + if (consumed < 0) { + SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state)); + quit(1); + } + i += consumed; + } + + if (!SDLTest_CommonInit(state)) { + quit(2); + } + + for (i = 0; i < state->num_windows; ++i) { + SDL_Renderer *renderer = state->renderers[i]; + SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); + SDL_RenderClear(renderer); + } + + if (color_cursor) { + cursor = init_color_cursor(color_cursor); + } else { + cursor = init_system_cursor(arrow); + } + if (!cursor) { + SDL_Log("Error, couldn't create cursor\n"); + quit(2); + } + SDL_SetCursor(cursor); + + /* Main render loop */ + done = 0; +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + loop(); + } +#endif + + SDL_FreeCursor(cursor); + quit(0); + + /* keep the compiler happy ... */ + return(0); +} diff --git a/Engine/lib/sdl/test/testdisplayinfo.c b/Engine/lib/sdl/test/testdisplayinfo.c index c228eb6b2..f06722e88 100644 --- a/Engine/lib/sdl/test/testdisplayinfo.c +++ b/Engine/lib/sdl/test/testdisplayinfo.c @@ -51,11 +51,18 @@ main(int argc, char *argv[]) for (dpy = 0; dpy < num_displays; dpy++) { const int num_modes = SDL_GetNumDisplayModes(dpy); SDL_Rect rect = { 0, 0, 0, 0 }; + float ddpi, hdpi, vdpi; int m; SDL_GetDisplayBounds(dpy, &rect); SDL_Log("%d: \"%s\" (%dx%d, (%d, %d)), %d modes.\n", dpy, SDL_GetDisplayName(dpy), rect.w, rect.h, rect.x, rect.y, num_modes); + if (SDL_GetDisplayDPI(dpy, &ddpi, &hdpi, &vdpi) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, " DPI: failed to query (%s)\n", SDL_GetError()); + } else { + SDL_Log(" DPI: ddpi=%f; hdpi=%f; vdpi=%f\n", ddpi, hdpi, vdpi); + } + if (SDL_GetCurrentDisplayMode(dpy, &mode) == -1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, " CURRENT: failed to query (%s)\n", SDL_GetError()); } else { diff --git a/Engine/lib/sdl/test/testdrawchessboard.c b/Engine/lib/sdl/test/testdrawchessboard.c index f2a1469d4..af929e9c3 100644 --- a/Engine/lib/sdl/test/testdrawchessboard.c +++ b/Engine/lib/sdl/test/testdrawchessboard.c @@ -100,7 +100,7 @@ main(int argc, char *argv[]) /* Create window and renderer for given surface */ - window = SDL_CreateWindow("Chess Board", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN); + window = SDL_CreateWindow("Chess Board", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, 0); if(!window) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Window creation fail : %s\n",SDL_GetError()); diff --git a/Engine/lib/sdl/test/testdropfile.c b/Engine/lib/sdl/test/testdropfile.c index b7f215ee8..b729b2f64 100644 --- a/Engine/lib/sdl/test/testdropfile.c +++ b/Engine/lib/sdl/test/testdropfile.c @@ -77,9 +77,14 @@ main(int argc, char *argv[]) while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done); - if (event.type == SDL_DROPFILE) { + if (event.type == SDL_DROPBEGIN) { + SDL_Log("Drop beginning on window %u", (unsigned int) event.drop.windowID); + } else if (event.type == SDL_DROPCOMPLETE) { + SDL_Log("Drop complete on window %u", (unsigned int) event.drop.windowID); + } else if ((event.type == SDL_DROPFILE) || (event.type == SDL_DROPTEXT)) { + const char *typestr = (event.type == SDL_DROPFILE) ? "File" : "Text"; char *dropped_filedir = event.drop.file; - SDL_Log("File dropped on window: %s", dropped_filedir); + SDL_Log("%s dropped on window %u: %s", typestr, (unsigned int) event.drop.windowID, dropped_filedir); SDL_free(dropped_filedir); } } diff --git a/Engine/lib/sdl/test/testfilesystem.c b/Engine/lib/sdl/test/testfilesystem.c index abd301c0e..61a6d5a5a 100644 --- a/Engine/lib/sdl/test/testfilesystem.c +++ b/Engine/lib/sdl/test/testfilesystem.c @@ -32,9 +32,8 @@ main(int argc, char *argv[]) if(base_path == NULL){ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find base path: %s\n", SDL_GetError()); - return 0; + return 1; } - SDL_Log("base path: '%s'\n", base_path); SDL_free(base_path); @@ -42,7 +41,7 @@ main(int argc, char *argv[]) if(pref_path == NULL){ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path: %s\n", SDL_GetError()); - return 0; + return 1; } SDL_Log("pref path: '%s'\n", pref_path); SDL_free(pref_path); diff --git a/Engine/lib/sdl/test/testgamecontroller.c b/Engine/lib/sdl/test/testgamecontroller.c index ec1dfd322..38d2f7708 100644 --- a/Engine/lib/sdl/test/testgamecontroller.c +++ b/Engine/lib/sdl/test/testgamecontroller.c @@ -29,7 +29,7 @@ #define SCREEN_HEIGHT 320 #else #define SCREEN_WIDTH 512 -#define SCREEN_HEIGHT 317 +#define SCREEN_HEIGHT 320 #endif /* This is indexed by SDL_GameControllerButton. */ @@ -67,7 +67,7 @@ SDL_bool done = SDL_FALSE; SDL_Texture *background, *button, *axis; static SDL_Texture * -LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) +LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent) { SDL_Surface *temp = NULL; SDL_Texture *texture = NULL; @@ -129,7 +129,7 @@ loop(void *arg) for (i = 0; i < SDL_CONTROLLER_BUTTON_MAX; ++i) { if (SDL_GameControllerGetButton(gamecontroller, (SDL_GameControllerButton)i) == SDL_PRESSED) { const SDL_Rect dst = { button_positions[i].x, button_positions[i].y, 50, 50 }; - SDL_RenderCopyEx(screen, button, NULL, &dst, 0, NULL, 0); + SDL_RenderCopyEx(screen, button, NULL, &dst, 0, NULL, SDL_FLIP_NONE); } } @@ -139,11 +139,11 @@ loop(void *arg) if (value < -deadzone) { const SDL_Rect dst = { axis_positions[i].x, axis_positions[i].y, 50, 50 }; const double angle = axis_positions[i].angle; - SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, 0); + SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, SDL_FLIP_NONE); } else if (value > deadzone) { const SDL_Rect dst = { axis_positions[i].x, axis_positions[i].y, 50, 50 }; const double angle = axis_positions[i].angle + 180.0; - SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, 0); + SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, SDL_FLIP_NONE); } } @@ -181,6 +181,8 @@ WatchGameController(SDL_GameController * gamecontroller) window = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, SCREEN_HEIGHT, 0); + SDL_free(title); + title = NULL; if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); return SDL_FALSE; diff --git a/Engine/lib/sdl/test/testgles.c b/Engine/lib/sdl/test/testgles.c index 291661a09..5be48ac56 100644 --- a/Engine/lib/sdl/test/testgles.c +++ b/Engine/lib/sdl/test/testgles.c @@ -173,7 +173,7 @@ main(int argc, char *argv[]) quit(2); } - context = SDL_calloc(state->num_windows, sizeof(context)); + context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(context)); if (context == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); diff --git a/Engine/lib/sdl/test/testgles2.c b/Engine/lib/sdl/test/testgles2.c index af5962ba4..45b3d79a3 100644 --- a/Engine/lib/sdl/test/testgles2.c +++ b/Engine/lib/sdl/test/testgles2.c @@ -546,7 +546,7 @@ main(int argc, char *argv[]) return 0; } - context = SDL_calloc(state->num_windows, sizeof(context)); + context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(context)); if (context == NULL) { SDL_Log("Out of memory!\n"); quit(2); @@ -640,7 +640,7 @@ main(int argc, char *argv[]) } } - datas = SDL_calloc(state->num_windows, sizeof(shader_data)); + datas = (shader_data *)SDL_calloc(state->num_windows, sizeof(shader_data)); /* Set rendering settings for each context */ for (i = 0; i < state->num_windows; ++i) { diff --git a/Engine/lib/sdl/test/testime.c b/Engine/lib/sdl/test/testime.c index d6e7ea1f2..39a40f82f 100644 --- a/Engine/lib/sdl/test/testime.c +++ b/Engine/lib/sdl/test/testime.c @@ -9,7 +9,9 @@ including commercial applications, and to alter it and redistribute it freely. */ -/* A simple program to test the Input Method support in the SDL library (2.0+) */ +/* A simple program to test the Input Method support in the SDL library (2.0+) + If you build without SDL_ttf, you can use the GNU Unifont hex file instead. + Download at http://unifoundry.com/unifont.html */ #include #include @@ -22,19 +24,342 @@ #include "SDL_test_common.h" -#define DEFAULT_PTSIZE 30 -#define DEFAULT_FONT "/System/Library/Fonts/华文细黑.ttf" +#define DEFAULT_PTSIZE 30 +#ifdef HAVE_SDL_TTF +#ifdef __MACOSX__ +#define DEFAULT_FONT "/System/Library/Fonts/华文细黑.ttf" +#elif __WIN32__ +/* Some japanese font present on at least Windows 8.1. */ +#define DEFAULT_FONT "C:\\Windows\\Fonts\\yugothic.ttf" +#else +#define DEFAULT_FONT "NoDefaultFont.ttf" +#endif +#else +#define DEFAULT_FONT "unifont-9.0.02.hex" +#endif #define MAX_TEXT_LENGTH 256 static SDLTest_CommonState *state; static SDL_Rect textRect, markedRect; -static SDL_Color lineColor = {0,0,0,0}; -static SDL_Color backColor = {255,255,255,0}; -static SDL_Color textColor = {0,0,0,0}; +static SDL_Color lineColor = {0,0,0,255}; +static SDL_Color backColor = {255,255,255,255}; +static SDL_Color textColor = {0,0,0,255}; static char text[MAX_TEXT_LENGTH], markedText[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; static int cursor = 0; #ifdef HAVE_SDL_TTF static TTF_Font *font; +#else +#define UNIFONT_MAX_CODEPOINT 0x1ffff +#define UNIFONT_NUM_GLYPHS 0x20000 +/* Using 512x512 textures that are supported everywhere. */ +#define UNIFONT_TEXTURE_WIDTH 512 +#define UNIFONT_GLYPHS_IN_ROW (UNIFONT_TEXTURE_WIDTH / 16) +#define UNIFONT_GLYPHS_IN_TEXTURE (UNIFONT_GLYPHS_IN_ROW * UNIFONT_GLYPHS_IN_ROW) +#define UNIFONT_NUM_TEXTURES ((UNIFONT_NUM_GLYPHS + UNIFONT_GLYPHS_IN_TEXTURE - 1) / UNIFONT_GLYPHS_IN_TEXTURE) +#define UNIFONT_TEXTURE_SIZE (UNIFONT_TEXTURE_WIDTH * UNIFONT_TEXTURE_WIDTH * 4) +#define UNIFONT_TEXTURE_PITCH (UNIFONT_TEXTURE_WIDTH * 4) +#define UNIFONT_DRAW_SCALE 2 +struct UnifontGlyph { + Uint8 width; + Uint8 data[32]; +} *unifontGlyph; +static SDL_Texture **unifontTexture; +static Uint8 unifontTextureLoaded[UNIFONT_NUM_TEXTURES] = {0}; + +/* Unifont loading code start */ + +static Uint8 dehex(char c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + else if (c >= 'a' && c <= 'f') + return c - 'a' + 10; + else if (c >= 'A' && c <= 'F') + return c - 'A' + 10; + return 255; +} + +static Uint8 dehex2(char c1, char c2) +{ + return (dehex(c1) << 4) | dehex(c2); +} + +static Uint8 validate_hex(const char *cp, size_t len, Uint32 *np) +{ + Uint32 n = 0; + for (; len > 0; cp++, len--) + { + Uint8 c = dehex(*cp); + if (c == 255) + return 0; + n = (n << 4) | c; + } + if (np != NULL) + *np = n; + return 1; +} + +static void unifont_init(const char *fontname) +{ + Uint8 hexBuffer[65]; + Uint32 numGlyphs = 0; + int lineNumber = 1; + size_t bytesRead; + SDL_RWops *hexFile; + const size_t unifontGlyphSize = UNIFONT_NUM_GLYPHS * sizeof(struct UnifontGlyph); + const size_t unifontTextureSize = UNIFONT_NUM_TEXTURES * state->num_windows * sizeof(void *); + + /* Allocate memory for the glyph data so the file can be closed after initialization. */ + unifontGlyph = (struct UnifontGlyph *)SDL_malloc(unifontGlyphSize); + if (unifontGlyph == NULL) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to allocate %d KiB for glyph data.\n", (int)(unifontGlyphSize + 1023) / 1024); + exit(-1); + } + SDL_memset(unifontGlyph, 0, unifontGlyphSize); + + /* Allocate memory for texture pointers for all renderers. */ + unifontTexture = (SDL_Texture **)SDL_malloc(unifontTextureSize); + if (unifontTexture == NULL) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to allocate %d KiB for texture pointer data.\n", (int)(unifontTextureSize + 1023) / 1024); + exit(-1); + } + SDL_memset(unifontTexture, 0, unifontTextureSize); + + hexFile = SDL_RWFromFile(fontname, "rb"); + if (hexFile == NULL) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to open font file: %s\n", fontname); + exit(-1); + } + + /* Read all the glyph data into memory to make it accessible later when textures are created. */ + do { + int i, codepointHexSize; + size_t bytesOverread; + Uint8 glyphWidth; + Uint32 codepoint; + + bytesRead = SDL_RWread(hexFile, hexBuffer, 1, 9); + if (numGlyphs > 0 && bytesRead == 0) + break; /* EOF */ + if ((numGlyphs == 0 && bytesRead == 0) || (numGlyphs > 0 && bytesRead < 9)) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unfiont: Unexpected end of hex file.\n"); + exit(-1); + } + + /* Looking for the colon that separates the codepoint and glyph data at position 2, 4, 6 and 8. */ + if (hexBuffer[2] == ':') + codepointHexSize = 2; + else if (hexBuffer[4] == ':') + codepointHexSize = 4; + else if (hexBuffer[6] == ':') + codepointHexSize = 6; + else if (hexBuffer[8] == ':') + codepointHexSize = 8; + else + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Could not find codepoint and glyph data separator symbol in hex file on line %d.\n", lineNumber); + exit(-1); + } + + if (!validate_hex((const char *)hexBuffer, codepointHexSize, &codepoint)) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Malformed hexadecimal number in hex file on line %d.\n", lineNumber); + exit(-1); + } + if (codepoint > UNIFONT_MAX_CODEPOINT) + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "unifont: Codepoint on line %d exceeded limit of 0x%x.\n", lineNumber, UNIFONT_MAX_CODEPOINT); + + /* If there was glyph data read in the last file read, move it to the front of the buffer. */ + bytesOverread = 8 - codepointHexSize; + if (codepointHexSize < 8) + SDL_memmove(hexBuffer, hexBuffer + codepointHexSize + 1, bytesOverread); + bytesRead = SDL_RWread(hexFile, hexBuffer + bytesOverread, 1, 33 - bytesOverread); + if (bytesRead < (33 - bytesOverread)) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Unexpected end of hex file.\n"); + exit(-1); + } + if (hexBuffer[32] == '\n') + glyphWidth = 8; + else + { + glyphWidth = 16; + bytesRead = SDL_RWread(hexFile, hexBuffer + 33, 1, 32); + if (bytesRead < 32) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Unexpected end of hex file.\n"); + exit(-1); + } + } + + if (!validate_hex((const char *)hexBuffer, glyphWidth * 4, NULL)) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Malformed hexadecimal glyph data in hex file on line %d.\n", lineNumber); + exit(-1); + } + + if (codepoint <= UNIFONT_MAX_CODEPOINT) + { + if (unifontGlyph[codepoint].width > 0) + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "unifont: Ignoring duplicate codepoint 0x%08x in hex file on line %d.\n", codepoint, lineNumber); + else + { + unifontGlyph[codepoint].width = glyphWidth; + /* Pack the hex data into a more compact form. */ + for (i = 0; i < glyphWidth * 2; i++) + unifontGlyph[codepoint].data[i] = dehex2(hexBuffer[i * 2], hexBuffer[i * 2 + 1]); + numGlyphs++; + } + } + + lineNumber++; + } while (bytesRead > 0); + + SDL_RWclose(hexFile); + SDL_Log("unifont: Loaded %u glyphs.\n", numGlyphs); +} + +static void unifont_make_rgba(Uint8 *src, Uint8 *dst, Uint8 width) +{ + int i, j; + Uint8 *row = dst; + + for (i = 0; i < width * 2; i++) + { + Uint8 data = src[i]; + for (j = 0; j < 8; j++) + { + if (data & 0x80) + { + row[0] = textColor.r; + row[1] = textColor.g; + row[2] = textColor.b; + row[3] = textColor.a; + } + else + { + row[0] = 0; + row[1] = 0; + row[2] = 0; + row[3] = 0; + } + data <<= 1; + row += 4; + } + + if (width == 8 || (width == 16 && i % 2 == 1)) + { + dst += UNIFONT_TEXTURE_PITCH; + row = dst; + } + } +} + +static void unifont_load_texture(Uint32 textureID) +{ + int i; + Uint8 * textureRGBA; + + if (textureID >= UNIFONT_NUM_TEXTURES) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Tried to load out of range texture %u.\n", textureID); + exit(-1); + } + + textureRGBA = (Uint8 *)SDL_malloc(UNIFONT_TEXTURE_SIZE); + if (textureRGBA == NULL) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to allocate %d MiB for a texture.\n", UNIFONT_TEXTURE_SIZE / 1024 / 1024); + exit(-1); + } + SDL_memset(textureRGBA, 0, UNIFONT_TEXTURE_SIZE); + + /* Copy the glyphs into memory in RGBA format. */ + for (i = 0; i < UNIFONT_GLYPHS_IN_TEXTURE; i++) + { + Uint32 codepoint = UNIFONT_GLYPHS_IN_TEXTURE * textureID + i; + if (unifontGlyph[codepoint].width > 0) + { + const Uint32 cInTex = codepoint % UNIFONT_GLYPHS_IN_TEXTURE; + const size_t offset = (cInTex / UNIFONT_GLYPHS_IN_ROW) * UNIFONT_TEXTURE_PITCH * 16 + (cInTex % UNIFONT_GLYPHS_IN_ROW) * 16 * 4; + unifont_make_rgba(unifontGlyph[codepoint].data, textureRGBA + offset, unifontGlyph[codepoint].width); + } + } + + /* Create textures and upload the RGBA data from above. */ + for (i = 0; i < state->num_windows; ++i) + { + SDL_Renderer *renderer = state->renderers[i]; + SDL_Texture *tex = unifontTexture[UNIFONT_NUM_TEXTURES * i + textureID]; + if (state->windows[i] == NULL || renderer == NULL || tex != NULL) + continue; + tex = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, UNIFONT_TEXTURE_WIDTH, UNIFONT_TEXTURE_WIDTH); + if (tex == NULL) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to create texture %u for renderer %d.\n", textureID, i); + exit(-1); + } + unifontTexture[UNIFONT_NUM_TEXTURES * i + textureID] = tex; + SDL_SetTextureBlendMode(tex, SDL_BLENDMODE_BLEND); + if (SDL_UpdateTexture(tex, NULL, textureRGBA, UNIFONT_TEXTURE_PITCH) != 0) + { + SDL_Log("unifont error: Failed to update texture %u data for renderer %d.\n", textureID, i); + } + } + + SDL_free(textureRGBA); + unifontTextureLoaded[textureID] = 1; +} + +static Sint32 unifont_draw_glyph(Uint32 codepoint, int rendererID, SDL_Rect *dstrect) +{ + SDL_Texture *texture; + const Uint32 textureID = codepoint / UNIFONT_GLYPHS_IN_TEXTURE; + SDL_Rect srcrect; + srcrect.w = srcrect.h = 16; + if (codepoint > UNIFONT_MAX_CODEPOINT) + return 0; + if (!unifontTextureLoaded[textureID]) + unifont_load_texture(textureID); + texture = unifontTexture[UNIFONT_NUM_TEXTURES * rendererID + textureID]; + if (texture != NULL) + { + const Uint32 cInTex = codepoint % UNIFONT_GLYPHS_IN_TEXTURE; + srcrect.x = cInTex % UNIFONT_GLYPHS_IN_ROW * 16; + srcrect.y = cInTex / UNIFONT_GLYPHS_IN_ROW * 16; + SDL_RenderCopy(state->renderers[rendererID], texture, &srcrect, dstrect); + } + return unifontGlyph[codepoint].width; +} + +static void unifont_cleanup() +{ + int i, j; + for (i = 0; i < state->num_windows; ++i) + { + SDL_Renderer *renderer = state->renderers[i]; + if (state->windows[i] == NULL || renderer == NULL) + continue; + for (j = 0; j < UNIFONT_NUM_TEXTURES; j++) + { + SDL_Texture *tex = unifontTexture[UNIFONT_NUM_TEXTURES * i + j]; + if (tex != NULL) + SDL_DestroyTexture(tex); + } + } + + for (j = 0; j < UNIFONT_NUM_TEXTURES; j++) + unifontTextureLoaded[j] = 0; + + SDL_free(unifontTexture); + SDL_free(unifontGlyph); +} + +/* Unifont code end */ #endif size_t utf8_length(unsigned char c) @@ -78,6 +403,30 @@ char *utf8_advance(char *p, size_t distance) return p; } +Uint32 utf8_decode(char *p, size_t len) +{ + Uint32 codepoint = 0; + size_t i = 0; + if (!len) + return 0; + + for (; i < len; ++i) + { + if (i == 0) + codepoint = (0xff >> len) & *p; + else + { + codepoint <<= 6; + codepoint |= 0x3f & *p; + } + if (!*p) + return 0; + p++; + } + + return codepoint; +} + void usage() { SDL_Log("usage: testime [--font fontfile]\n"); @@ -105,34 +454,61 @@ void CleanupVideo() #ifdef HAVE_SDL_TTF TTF_CloseFont(font); TTF_Quit(); +#else + unifont_cleanup(); #endif } +void _Redraw(int rendererID) { + SDL_Renderer * renderer = state->renderers[rendererID]; + SDL_Rect drawnTextRect, cursorRect, underlineRect; + drawnTextRect = textRect; + drawnTextRect.w = 0; -void _Redraw(SDL_Renderer * renderer) { - int w = 0, h = textRect.h; - SDL_Rect cursorRect, underlineRect; - - SDL_SetRenderDrawColor(renderer, 255,255,255,255); + SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a); SDL_RenderFillRect(renderer,&textRect); -#ifdef HAVE_SDL_TTF if (*text) { +#ifdef HAVE_SDL_TTF SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, textColor); - SDL_Rect dest = {textRect.x, textRect.y, textSur->w, textSur->h }; + SDL_Texture *texture; - SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer,textSur); + /* Vertically center text */ + drawnTextRect.y = textRect.y + (textRect.h - textSur->h) / 2; + drawnTextRect.w = textSur->w; + drawnTextRect.h = textSur->h; + + texture = SDL_CreateTextureFromSurface(renderer,textSur); SDL_FreeSurface(textSur); - SDL_RenderCopy(renderer,texture,NULL,&dest); + SDL_RenderCopy(renderer,texture,NULL,&drawnTextRect); SDL_DestroyTexture(texture); - TTF_SizeUTF8(font, text, &w, &h); - } -#endif +#else + char *utext = text; + Uint32 codepoint; + size_t len; + SDL_Rect dstrect; - markedRect.x = textRect.x + w; - markedRect.w = textRect.w - w; + dstrect.x = textRect.x; + dstrect.y = textRect.y + (textRect.h - 16 * UNIFONT_DRAW_SCALE) / 2; + dstrect.w = 16 * UNIFONT_DRAW_SCALE; + dstrect.h = 16 * UNIFONT_DRAW_SCALE; + drawnTextRect.y = dstrect.y; + drawnTextRect.h = dstrect.h; + + while ((codepoint = utf8_decode(utext, len = utf8_length(*utext)))) + { + Sint32 advance = unifont_draw_glyph(codepoint, rendererID, &dstrect) * UNIFONT_DRAW_SCALE; + dstrect.x += advance; + drawnTextRect.w += advance; + utext += len; + } +#endif + } + + markedRect.x = textRect.x + drawnTextRect.w; + markedRect.w = textRect.w - drawnTextRect.w; if (markedRect.w < 0) { /* Stop text input because we cannot hold any more characters */ @@ -144,49 +520,88 @@ void _Redraw(SDL_Renderer * renderer) { SDL_StartTextInput(); } - cursorRect = markedRect; + cursorRect = drawnTextRect; + cursorRect.x += cursorRect.w; cursorRect.w = 2; - cursorRect.h = h; + cursorRect.h = drawnTextRect.h; - SDL_SetRenderDrawColor(renderer, 255,255,255,255); + drawnTextRect.x += drawnTextRect.w; + drawnTextRect.w = 0; + + SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a); SDL_RenderFillRect(renderer,&markedRect); if (markedText[0]) { #ifdef HAVE_SDL_TTF + SDL_Surface *textSur; + SDL_Texture *texture; if (cursor) { char *p = utf8_advance(markedText, cursor); char c = 0; if (!p) - p = &markedText[strlen(markedText)]; + p = &markedText[SDL_strlen(markedText)]; c = *p; *p = 0; - TTF_SizeUTF8(font, markedText, &w, 0); - cursorRect.x += w; + TTF_SizeUTF8(font, markedText, &drawnTextRect.w, NULL); + cursorRect.x += drawnTextRect.w; *p = c; } - SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, markedText, textColor); - SDL_Rect dest = {markedRect.x, markedRect.y, textSur->w, textSur->h }; - TTF_SizeUTF8(font, markedText, &w, &h); - SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer,textSur); + textSur = TTF_RenderUTF8_Blended(font, markedText, textColor); + /* Vertically center text */ + drawnTextRect.y = textRect.y + (textRect.h - textSur->h) / 2; + drawnTextRect.w = textSur->w; + drawnTextRect.h = textSur->h; + + texture = SDL_CreateTextureFromSurface(renderer,textSur); SDL_FreeSurface(textSur); - SDL_RenderCopy(renderer,texture,NULL,&dest); + SDL_RenderCopy(renderer,texture,NULL,&drawnTextRect); SDL_DestroyTexture(texture); +#else + int i = 0; + char *utext = markedText; + Uint32 codepoint; + size_t len; + SDL_Rect dstrect; + + dstrect.x = drawnTextRect.x; + dstrect.y = textRect.y + (textRect.h - 16 * UNIFONT_DRAW_SCALE) / 2; + dstrect.w = 16 * UNIFONT_DRAW_SCALE; + dstrect.h = 16 * UNIFONT_DRAW_SCALE; + drawnTextRect.y = dstrect.y; + drawnTextRect.h = dstrect.h; + + while ((codepoint = utf8_decode(utext, len = utf8_length(*utext)))) + { + Sint32 advance = unifont_draw_glyph(codepoint, rendererID, &dstrect) * UNIFONT_DRAW_SCALE; + dstrect.x += advance; + drawnTextRect.w += advance; + if (i < cursor) + cursorRect.x += advance; + i++; + utext += len; + } #endif - underlineRect = markedRect; - underlineRect.y += (h - 2); - underlineRect.h = 2; - underlineRect.w = w; + if (cursor > 0) + { + cursorRect.y = drawnTextRect.y; + cursorRect.h = drawnTextRect.h; + } - SDL_SetRenderDrawColor(renderer, 0,0,0,0); - SDL_RenderFillRect(renderer,&markedRect); + underlineRect = markedRect; + underlineRect.y = drawnTextRect.y + drawnTextRect.h - 2; + underlineRect.h = 2; + underlineRect.w = drawnTextRect.w; + + SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a); + SDL_RenderFillRect(renderer, &underlineRect); } - SDL_SetRenderDrawColor(renderer, 0,0,0,0); + SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a); SDL_RenderFillRect(renderer,&cursorRect); SDL_SetTextInputRect(&markedRect); @@ -201,7 +616,8 @@ void Redraw() { SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0); SDL_RenderClear(renderer); - _Redraw(renderer); + /* Sending in the window id to let the font renderers know which one we're working with. */ + _Redraw(i); SDL_RenderPresent(renderer); } @@ -259,6 +675,8 @@ int main(int argc, char *argv[]) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to find font: %s\n", TTF_GetError()); exit(-1); } +#else + unifont_init(fontname); #endif SDL_Log("Using font: %s\n", fontname); @@ -288,6 +706,8 @@ int main(int argc, char *argv[]) { Redraw(); break; case SDLK_BACKSPACE: + /* Only delete text if not in editing mode. */ + if (!markedText[0]) { size_t textlen = SDL_strlen(text); @@ -354,7 +774,7 @@ int main(int argc, char *argv[]) { SDL_Log("text editing \"%s\", selected range (%d, %d)\n", event.edit.text, event.edit.start, event.edit.length); - strcpy(markedText, event.edit.text); + SDL_strlcpy(markedText, event.edit.text, SDL_TEXTEDITINGEVENT_TEXT_SIZE); cursor = event.edit.start; Redraw(); break; diff --git a/Engine/lib/sdl/test/testlock.c b/Engine/lib/sdl/test/testlock.c index 1106ec3bf..113ba0d4c 100644 --- a/Engine/lib/sdl/test/testlock.c +++ b/Engine/lib/sdl/test/testlock.c @@ -23,7 +23,7 @@ static SDL_mutex *mutex = NULL; static SDL_threadID mainthread; static SDL_Thread *threads[6]; -static volatile int doterminate = 0; +static SDL_atomic_t doterminate; /* * SDL_Quit() shouldn't be used with atexit() directly because @@ -45,7 +45,7 @@ void terminate(int sig) { signal(SIGINT, terminate); - doterminate = 1; + SDL_AtomicSet(&doterminate, 1); } void @@ -54,7 +54,7 @@ closemutex(int sig) SDL_threadID id = SDL_ThreadID(); int i; SDL_Log("Process %lu: Cleaning up...\n", id == mainthread ? 0 : id); - doterminate = 1; + SDL_AtomicSet(&doterminate, 1); for (i = 0; i < 6; ++i) SDL_WaitThread(threads[i], NULL); SDL_DestroyMutex(mutex); @@ -66,7 +66,7 @@ Run(void *data) { if (SDL_ThreadID() == mainthread) signal(SIGTERM, closemutex); - while (!doterminate) { + while (!SDL_AtomicGet(&doterminate)) { SDL_Log("Process %lu ready to work\n", SDL_ThreadID()); if (SDL_LockMutex(mutex) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't lock mutex: %s", SDL_GetError()); @@ -82,7 +82,7 @@ Run(void *data) /* If this sleep isn't done, then threads may starve */ SDL_Delay(10); } - if (SDL_ThreadID() == mainthread && doterminate) { + if (SDL_ThreadID() == mainthread && SDL_AtomicGet(&doterminate)) { SDL_Log("Process %lu: raising SIGTERM\n", SDL_ThreadID()); raise(SIGTERM); } @@ -105,6 +105,8 @@ main(int argc, char *argv[]) } atexit(SDL_Quit_Wrapper); + SDL_AtomicSet(&doterminate, 0); + if ((mutex = SDL_CreateMutex()) == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create mutex: %s\n", SDL_GetError()); exit(1); diff --git a/Engine/lib/sdl/test/testmultiaudio.c b/Engine/lib/sdl/test/testmultiaudio.c index 117ef2696..1b07ba9fc 100644 --- a/Engine/lib/sdl/test/testmultiaudio.c +++ b/Engine/lib/sdl/test/testmultiaudio.c @@ -25,7 +25,7 @@ typedef struct { SDL_AudioDeviceID dev; int soundpos; - volatile int done; + SDL_atomic_t done; } callback_data; callback_data cbd[64]; @@ -46,14 +46,14 @@ play_through_once(void *arg, Uint8 * stream, int len) if (len > 0) { stream += cpy; SDL_memset(stream, spec.silence, len); - cbd->done++; + SDL_AtomicSet(&cbd->done, 1); } } void loop() { - if(cbd[0].done) { + if (SDL_AtomicGet(&cbd[0].done)) { #ifdef __EMSCRIPTEN__ emscripten_cancel_main_loop(); #endif @@ -100,8 +100,7 @@ test_multi_audio(int devcount) #ifdef __EMSCRIPTEN__ emscripten_set_main_loop(loop, 0, 1); #else - while (!cbd[0].done) - { + while (!SDL_AtomicGet(&cbd[0].done)) { #ifdef __ANDROID__ /* Empty queue, some application events would prevent pause. */ while (SDL_PollEvent(&event)){} @@ -136,7 +135,7 @@ test_multi_audio(int devcount) while (keep_going) { keep_going = 0; for (i = 0; i < devcount; i++) { - if ((cbd[i].dev) && (!cbd[i].done)) { + if ((cbd[i].dev) && (!SDL_AtomicGet(&cbd[i].done))) { keep_going = 1; } } diff --git a/Engine/lib/sdl/test/testqsort.c b/Engine/lib/sdl/test/testqsort.c new file mode 100644 index 000000000..48659f307 --- /dev/null +++ b/Engine/lib/sdl/test/testqsort.c @@ -0,0 +1,108 @@ +/* + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +#include "SDL_test.h" + +static int +num_compare(const void *_a, const void *_b) +{ + const int a = *((const int *) _a); + const int b = *((const int *) _b); + return (a < b) ? -1 : ((a > b) ? 1 : 0); +} + +static void +test_sort(const char *desc, int *nums, const int arraylen) +{ + int i; + int prev; + + SDL_Log("test: %s arraylen=%d", desc, arraylen); + + SDL_qsort(nums, arraylen, sizeof (nums[0]), num_compare); + + prev = nums[0]; + for (i = 1; i < arraylen; i++) { + const int val = nums[i]; + if (val < prev) { + SDL_Log("sort is broken!"); + return; + } + prev = val; + } +} + +int +main(int argc, char *argv[]) +{ + static int nums[1024 * 100]; + static const int itervals[] = { SDL_arraysize(nums), 12 }; + int iteration; + SDLTest_RandomContext rndctx; + + if (argc > 1) + { + int success; + Uint64 seed = 0; + if (argv[1][0] == '0' && argv[1][1] == 'x') + success = SDL_sscanf(argv[1] + 2, "%llx", &seed); + else + success = SDL_sscanf(argv[1], "%llu", &seed); + if (!success) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid seed. Use a decimal or hexadecimal number.\n"); + return 1; + } + if (seed <= 0xffffffff) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Seed must be equal or greater than 0x100000000.\n"); + return 1; + } + SDLTest_RandomInit(&rndctx, (unsigned int)(seed >> 32), (unsigned int)(seed & 0xffffffff)); + } + else + { + SDLTest_RandomInitTime(&rndctx); + } + SDL_Log("Using random seed 0x%08x%08x\n", rndctx.x, rndctx.c); + + for (iteration = 0; iteration < SDL_arraysize(itervals); iteration++) { + const int arraylen = itervals[iteration]; + int i; + + for (i = 0; i < arraylen; i++) { + nums[i] = i; + } + test_sort("already sorted", nums, arraylen); + + for (i = 0; i < arraylen; i++) { + nums[i] = i; + } + nums[arraylen-1] = -1; + test_sort("already sorted except last element", nums, arraylen); + + for (i = 0; i < arraylen; i++) { + nums[i] = (arraylen-1) - i; + } + test_sort("reverse sorted", nums, arraylen); + + for (i = 0; i < arraylen; i++) { + nums[i] = SDLTest_RandomInt(&rndctx); + } + test_sort("random sorted", nums, arraylen); + } + + return 0; +} + +/* vi: set ts=4 sw=4 expandtab: */ + diff --git a/Engine/lib/sdl/test/testrendercopyex.c b/Engine/lib/sdl/test/testrendercopyex.c index 856abf7d0..e34890245 100644 --- a/Engine/lib/sdl/test/testrendercopyex.c +++ b/Engine/lib/sdl/test/testrendercopyex.c @@ -45,7 +45,7 @@ quit(int rc) } SDL_Texture * -LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) +LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent) { SDL_Surface *temp; SDL_Texture *texture; @@ -126,7 +126,7 @@ Draw(DrawState *s) s->sprite_rect.x = (viewport.w - s->sprite_rect.w) / 2; s->sprite_rect.y = (viewport.h - s->sprite_rect.h) / 2; - SDL_RenderCopyEx(s->renderer, s->sprite, NULL, &s->sprite_rect, (double)s->sprite_rect.w, center, s->scale_direction); + SDL_RenderCopyEx(s->renderer, s->sprite, NULL, &s->sprite_rect, (double)s->sprite_rect.w, center, (SDL_RendererFlip)s->scale_direction); SDL_SetRenderTarget(s->renderer, NULL); SDL_RenderCopy(s->renderer, target, NULL, NULL); diff --git a/Engine/lib/sdl/test/testshape.c b/Engine/lib/sdl/test/testshape.c index 00750a970..476fac21e 100644 --- a/Engine/lib/sdl/test/testshape.c +++ b/Engine/lib/sdl/test/testshape.c @@ -71,6 +71,10 @@ int main(int argc,char** argv) num_pictures = argc - 1; pictures = (LoadedPicture *)SDL_malloc(sizeof(LoadedPicture)*num_pictures); + if (!pictures) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not allocate memory."); + exit(1); + } for(i=0;inum_windows; ++i) { + SDL_Renderer *renderer = state->renderers[i]; + SDL_RenderClear(renderer); + SDL_RenderPresent(renderer); + } #ifdef __EMSCRIPTEN__ if (done) { emscripten_cancel_main_loop(); @@ -122,7 +129,6 @@ main(int argc, char *argv[]) if (!state) { return 1; } - state->skip_renderer = SDL_TRUE; for (i = 1; i < argc;) { int consumed; @@ -140,6 +146,12 @@ main(int argc, char *argv[]) quit(2); } + for (i = 0; i < state->num_windows; ++i) { + SDL_Renderer *renderer = state->renderers[i]; + SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); + SDL_RenderClear(renderer); + } + /* Main render loop */ done = 0; #ifdef __EMSCRIPTEN__ diff --git a/Engine/lib/sdl/test/torturethread.c b/Engine/lib/sdl/test/torturethread.c index 5719a7195..6b98a0a9f 100644 --- a/Engine/lib/sdl/test/torturethread.c +++ b/Engine/lib/sdl/test/torturethread.c @@ -21,7 +21,7 @@ #define NUMTHREADS 10 -static char volatile time_for_threads_to_die[NUMTHREADS]; +static SDL_atomic_t time_for_threads_to_die[NUMTHREADS]; /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void @@ -58,7 +58,7 @@ ThreadFunc(void *data) } SDL_Log("Thread '%d' waiting for signal\n", tid); - while (time_for_threads_to_die[tid] != 1) { + while (SDL_AtomicGet(&time_for_threads_to_die[tid]) != 1) { ; /* do nothing */ } @@ -92,7 +92,7 @@ main(int argc, char *argv[]) for (i = 0; i < NUMTHREADS; i++) { char name[64]; SDL_snprintf(name, sizeof (name), "Parent%d", i); - time_for_threads_to_die[i] = 0; + SDL_AtomicSet(&time_for_threads_to_die[i], 0); threads[i] = SDL_CreateThread(ThreadFunc, name, (void*) (uintptr_t) i); if (threads[i] == NULL) { @@ -102,7 +102,7 @@ main(int argc, char *argv[]) } for (i = 0; i < NUMTHREADS; i++) { - time_for_threads_to_die[i] = 1; + SDL_AtomicSet(&time_for_threads_to_die[i], 1); } for (i = 0; i < NUMTHREADS; i++) { diff --git a/Engine/source/.gitattributes b/Engine/source/.gitattributes new file mode 100644 index 000000000..abf67ea1d --- /dev/null +++ b/Engine/source/.gitattributes @@ -0,0 +1,5 @@ +*.cpp filter=tabspace +*.h filter=tabspace +*.l filter=tabspace +*.y filter=tabspace +*.mm filter=tabspace diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index 44591dd94..30027e4cd 100644 --- a/Tools/CMake/torque3d.cmake +++ b/Tools/CMake/torque3d.cmake @@ -640,6 +640,7 @@ if (APPLE) addFramework("CoreVideo") #grrr damn you sdl! addFramework("Carbon") + addFramework("AudioToolbox") addLib("iconv") #set a few arch defaults set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "OSX Architecture" FORCE) From cf56764347fdb481070e594a7e6d839311c7ae7a Mon Sep 17 00:00:00 2001 From: "Thomas \"elfprince13\" Dickerson" Date: Fri, 13 Jan 2017 10:45:52 -0500 Subject: [PATCH 07/26] didn't mean to include this for everyone --- Engine/source/.gitattributes | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 Engine/source/.gitattributes diff --git a/Engine/source/.gitattributes b/Engine/source/.gitattributes deleted file mode 100644 index abf67ea1d..000000000 --- a/Engine/source/.gitattributes +++ /dev/null @@ -1,5 +0,0 @@ -*.cpp filter=tabspace -*.h filter=tabspace -*.l filter=tabspace -*.y filter=tabspace -*.mm filter=tabspace From 2029e3eb2234e7175c4dae718617658bc12e86dd Mon Sep 17 00:00:00 2001 From: LukasPJ Date: Sun, 15 Jan 2017 23:22:46 +0100 Subject: [PATCH 08/26] Make RenderPassManager call Parent::InitPersistFields --- Engine/source/renderInstance/renderPassManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/source/renderInstance/renderPassManager.cpp b/Engine/source/renderInstance/renderPassManager.cpp index f620a627b..3ed2671dc 100644 --- a/Engine/source/renderInstance/renderPassManager.cpp +++ b/Engine/source/renderInstance/renderPassManager.cpp @@ -124,6 +124,7 @@ RenderPassManager::RenderBinEventSignal& RenderPassManager::getRenderBinSignal() void RenderPassManager::initPersistFields() { + Parent::initPersistFields(); } RenderPassManager::RenderPassManager() From f50d46dffc7ccf382bb936c9ea90b4cced3c5723 Mon Sep 17 00:00:00 2001 From: LukasPJ Date: Sun, 15 Jan 2017 23:23:55 +0100 Subject: [PATCH 09/26] Cleanup when deactivating light manager instead of reinitializing --- .../renderInstance/renderParticleMgr.cpp | 66 +++++++++++-------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/Engine/source/renderInstance/renderParticleMgr.cpp b/Engine/source/renderInstance/renderParticleMgr.cpp index dcae9756c..ad0811f91 100644 --- a/Engine/source/renderInstance/renderParticleMgr.cpp +++ b/Engine/source/renderInstance/renderParticleMgr.cpp @@ -589,43 +589,51 @@ bool RenderParticleMgr::_initShader() void RenderParticleMgr::_onLMActivate( const char*, bool activate ) { - RenderPassManager *rpm = getRenderPass(); - if ( !rpm ) - return; - - // Hunt for the pre-pass manager/target - RenderPrePassMgr *prePassBin = NULL; - for( U32 i = 0; i < rpm->getManagerCount(); i++ ) + if ( activate ) { - RenderBinManager *bin = rpm->getManager(i); - if( bin->getRenderInstType() == RenderPrePassMgr::RIT_PrePass ) + RenderPassManager *rpm = getRenderPass(); + if ( !rpm ) + return; + + // Hunt for the pre-pass manager/target + RenderPrePassMgr *prePassBin = NULL; + for( U32 i = 0; i < rpm->getManagerCount(); i++ ) { - prePassBin = (RenderPrePassMgr*)bin; - break; + RenderBinManager *bin = rpm->getManager(i); + if( bin->getRenderInstType() == RenderPrePassMgr::RIT_PrePass ) + { + prePassBin = (RenderPrePassMgr*)bin; + break; + } } - } - // If we found the prepass bin, set this bin to render very shortly afterwards - // and re-add this render-manager. If there is no pre-pass bin, or it doesn't - // have a depth-texture, we can't render offscreen. - mOffscreenRenderEnabled = prePassBin && (prePassBin->getTargetChainLength() > 0); - if(mOffscreenRenderEnabled) - { - rpm->removeManager(this); - setRenderOrder( prePassBin->getRenderOrder() + 0.011f ); - rpm->addManager(this); - } + // If we found the prepass bin, set this bin to render very shortly afterwards + // and re-add this render-manager. If there is no pre-pass bin, or it doesn't + // have a depth-texture, we can't render offscreen. + mOffscreenRenderEnabled = prePassBin && (prePassBin->getTargetChainLength() > 0); + if(mOffscreenRenderEnabled) + { + rpm->removeManager(this); + setRenderOrder( prePassBin->getRenderOrder() + 0.011f ); + rpm->addManager(this); + } - // Find the targets we use - mPrepassTarget = NamedTexTarget::find( "prepass" ); - mEdgeTarget = NamedTexTarget::find( "edge" ); + // Find the targets we use + mPrepassTarget = NamedTexTarget::find( "prepass" ); + mEdgeTarget = NamedTexTarget::find( "edge" ); - // Setup the shader - if ( activate ) + // Setup the shader _initShader(); - if ( mScreenQuadVertBuff.isNull() ) - _initGFXResources(); + if ( mScreenQuadVertBuff.isNull() ) + _initGFXResources(); + } + else + { + mStencilClearSB = NULL; + mScreenQuadPrimBuff = NULL; + mScreenQuadVertBuff = NULL; + } } GFXStateBlockRef RenderParticleMgr::_getOffscreenStateBlock(ParticleRenderInst *ri) From 11532e10cc406b42a898534fdca0de12d4f4e36e Mon Sep 17 00:00:00 2001 From: rextimmy Date: Mon, 16 Jan 2017 15:35:25 +1000 Subject: [PATCH 10/26] Add log2 function to mMathFn.h --- Engine/source/math/mMathFn.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Engine/source/math/mMathFn.h b/Engine/source/math/mMathFn.h index 1855656e7..93596f63f 100644 --- a/Engine/source/math/mMathFn.h +++ b/Engine/source/math/mMathFn.h @@ -320,6 +320,11 @@ inline F32 mLog(const F32 val) return (F32) log(val); } +inline F32 mLog2(const F32 val) +{ + return (F32) log2(val); +} + inline F32 mExp(const F32 val) { return (F32) exp(val); @@ -380,6 +385,10 @@ inline F64 mLog(const F64 val) return (F64) log(val); } +inline F64 mLog2(const F64 val) +{ + return (F64) log2(val); +} inline F32 mCatmullrom(F32 t, F32 p0, F32 p1, F32 p2, F32 p3) { From f6d624be8f22c1d67bf6fd498fd4ee32d9b7e487 Mon Sep 17 00:00:00 2001 From: rextimmy Date: Mon, 16 Jan 2017 15:36:52 +1000 Subject: [PATCH 11/26] Fix mipmap count and potential crash for non square textures that are allocated with GBitmap class --- Engine/source/gfx/bitmap/gBitmap.cpp | 5 ++++- Engine/source/gfx/gfxTextureManager.cpp | 16 +--------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Engine/source/gfx/bitmap/gBitmap.cpp b/Engine/source/gfx/bitmap/gBitmap.cpp index e5ef6b407..9e20d6951 100644 --- a/Engine/source/gfx/bitmap/gBitmap.cpp +++ b/Engine/source/gfx/bitmap/gBitmap.cpp @@ -327,7 +327,10 @@ void GBitmap::allocateBitmap(const U32 in_width, const U32 in_height, const bool mNumMipLevels++; allocPixels += currWidth * currHeight * mBytesPerPixel; - } while (currWidth != 1 && currHeight != 1); + } while (currWidth != 1 || currHeight != 1); + + U32 expectedMips = mFloor(mLog2(mMax(in_width, in_height))) + 1; + AssertFatal(mNumMipLevels == expectedMips, "GBitmap::allocateBitmap: mipmap count wrong"); } AssertFatal(mNumMipLevels <= c_maxMipLevels, "GBitmap::allocateBitmap: too many miplevels"); diff --git a/Engine/source/gfx/gfxTextureManager.cpp b/Engine/source/gfx/gfxTextureManager.cpp index b656fcffd..781e0daa2 100644 --- a/Engine/source/gfx/gfxTextureManager.cpp +++ b/Engine/source/gfx/gfxTextureManager.cpp @@ -1085,21 +1085,7 @@ void GFXTextureManager::_validateTexParams( const U32 width, const U32 height, // NOTE: Does this belong here? if( inOutNumMips == 0 && !autoGenSupp ) { - U32 currWidth = width; - U32 currHeight = height; - - inOutNumMips = 1; - do - { - currWidth >>= 1; - currHeight >>= 1; - if( currWidth == 0 ) - currWidth = 1; - if( currHeight == 0 ) - currHeight = 1; - - inOutNumMips++; - } while ( currWidth != 1 && currHeight != 1 ); + inOutNumMips = mFloor(mLog2(mMax(width, height))) + 1; } } } From f02d0d6c4ee4b131ebf8ac65a7ee9ff666eb5b8b Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 16 Jan 2017 00:09:55 -0600 Subject: [PATCH 12/26] Hooks the splash window code up to the same image loading code as the icon code, and also adds a check if it tries to load a BMP for either(this is a bad format and really shouldn't be used for pretty much anything). Also includes a icon for the templates. --- .../windowManager/sdl/sdlSplashScreen.cpp | 49 ++++++++++- .../source/windowManager/sdl/sdlWindowMgr.cpp | 82 ++++++++++-------- Templates/Empty/game/core/torque.png | Bin 0 -> 1331 bytes Templates/Full/game/core/torque.png | Bin 0 -> 1331 bytes 4 files changed, 92 insertions(+), 39 deletions(-) create mode 100644 Templates/Empty/game/core/torque.png create mode 100644 Templates/Full/game/core/torque.png diff --git a/Engine/source/windowManager/sdl/sdlSplashScreen.cpp b/Engine/source/windowManager/sdl/sdlSplashScreen.cpp index bf0931a9c..1cf2440af 100644 --- a/Engine/source/windowManager/sdl/sdlSplashScreen.cpp +++ b/Engine/source/windowManager/sdl/sdlSplashScreen.cpp @@ -22,7 +22,7 @@ #include "platform/platform.h" #include "console/console.h" - +#include "gfx/bitmap/gBitmap.h" #include "SDL.h" #include "windowManager/sdl/sdlWindow.h" @@ -36,7 +36,52 @@ bool Platform::displaySplashWindow( String path ) if(path.isEmpty()) return false; - gSplashImage = SDL_LoadBMP(path); + Torque::Path iconPath = Torque::Path(path); + + if (iconPath.getExtension() == String("bmp")) + { + Con::errorf("Unable to use bmp format images for the splash screen. Please use a different format."); + return false; + } + + Resource img = GBitmap::load(iconPath); + if (img != NULL) + { + U32 pitch; + U32 width = img->getWidth(); + bool hasAlpha = img->getHasTransparency(); + U32 depth; + + if (hasAlpha) + { + pitch = 4 * width; + depth = 32; + } + else + { + pitch = 3 * width; + depth = 24; + } + + Uint32 rmask, gmask, bmask, amask; + if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + { + S32 shift = hasAlpha ? 8 : 0; + rmask = 0xff000000 >> shift; + gmask = 0x00ff0000 >> shift; + bmask = 0x0000ff00 >> shift; + amask = 0x000000ff >> shift; + } + else + { + rmask = 0x000000ff; + gmask = 0x0000ff00; + bmask = 0x00ff0000; + amask = hasAlpha ? 0xff000000 : 0; + } + + gSplashImage = SDL_CreateRGBSurfaceFrom(img->getAddress(0, 0), img->getWidth(), img->getHeight(), depth, pitch, rmask, gmask, bmask, amask); + } //now the pop-up window if (gSplashImage) diff --git a/Engine/source/windowManager/sdl/sdlWindowMgr.cpp b/Engine/source/windowManager/sdl/sdlWindowMgr.cpp index 6157374dd..489377082 100644 --- a/Engine/source/windowManager/sdl/sdlWindowMgr.cpp +++ b/Engine/source/windowManager/sdl/sdlWindowMgr.cpp @@ -168,47 +168,55 @@ PlatformWindow *PlatformWindowManagerSDL::createWindow(GFXDevice *device, const //Now, fetch our window icon, if any Torque::Path iconPath = Torque::Path(Con::getVariable( "$Core::windowIcon" )); - Resource bmp = GBitmap::load(iconPath); - if (bmp != NULL) + + if (iconPath.getExtension() == String("bmp")) { - U32 pitch; - U32 width = bmp->getWidth(); - bool hasAlpha = bmp->getHasTransparency(); - U32 depth; - - if (hasAlpha) + Con::errorf("Unable to use bmp format images for the window icon. Please use a different format."); + } + else + { + Resource img = GBitmap::load(iconPath); + if (img != NULL) { - pitch = 4 * width; - depth = 32; - } - else - { - pitch = 3 * width; - depth = 24; - } + U32 pitch; + U32 width = img->getWidth(); + bool hasAlpha = img->getHasTransparency(); + U32 depth; - Uint32 rmask, gmask, bmask, amask; - if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - { - S32 shift = hasAlpha ? 8 : 0; - rmask = 0xff000000 >> shift; - gmask = 0x00ff0000 >> shift; - bmask = 0x0000ff00 >> shift; - amask = 0x000000ff >> shift; + if (hasAlpha) + { + pitch = 4 * width; + depth = 32; + } + else + { + pitch = 3 * width; + depth = 24; + } + + Uint32 rmask, gmask, bmask, amask; + if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + { + S32 shift = hasAlpha ? 8 : 0; + rmask = 0xff000000 >> shift; + gmask = 0x00ff0000 >> shift; + bmask = 0x0000ff00 >> shift; + amask = 0x000000ff >> shift; + } + else + { + rmask = 0x000000ff; + gmask = 0x0000ff00; + bmask = 0x00ff0000; + amask = hasAlpha ? 0xff000000 : 0; + } + + SDL_Surface* iconSurface = SDL_CreateRGBSurfaceFrom(img->getAddress(0, 0), img->getWidth(), img->getHeight(), depth, pitch, rmask, gmask, bmask, amask); + + SDL_SetWindowIcon(window->mWindowHandle, iconSurface); + + SDL_FreeSurface(iconSurface); } - else - { - rmask = 0x000000ff; - gmask = 0x0000ff00; - bmask = 0x00ff0000; - amask = hasAlpha ? 0xff000000 : 0; - } - - SDL_Surface* iconSurface = SDL_CreateRGBSurfaceFrom(bmp->getAddress(0, 0), bmp->getWidth(), bmp->getHeight(), depth, pitch, rmask, gmask, bmask, amask); - - SDL_SetWindowIcon(window->mWindowHandle, iconSurface); - - SDL_FreeSurface(iconSurface); } if(device) diff --git a/Templates/Empty/game/core/torque.png b/Templates/Empty/game/core/torque.png new file mode 100644 index 0000000000000000000000000000000000000000..1023f2bb6655b4e5740ee9dbd56a2e4c2ac27594 GIT binary patch literal 1331 zcmV-31ue_)p4!cG4G5pgl# zAhXdy5XFU{3qgyx>Ozo$8!ePkTLhV=SS?N4Nt>6Ky!+m9(I!or`(9uAUPwI4ymxQT zcfNDJbMAdWkL;b%3Bv!?KFt^C@ufMsl1lX)gckOOKTSPN1#!IXs3v+IEFRWI4{}qq zR+w!%4*>I;j=3JQ5DEj|OGECN;xQuH8j|N4BzTMwrlDY$+F&27b3nZhz)hu)iVj|>P2n1l;sIZ#d z-I`d)ECd4ZFgHyf50Bz*EY;Pz5zg@-H${Cb;`c`<>5X`z*@drbF>FLEtXQV6^%=o& zO^=4s+`3wPZ)}oY)nm#I3;-XQWvt4Yuf48EVpz88Om zGXEL5VwsrW!3+9a^xschrt=(MwyGWTk6-)ClGq5)+*}#>B441J(YWiv64_X)8(5XK z3pw7ZN~AU0b>dPoNuj3D2p3qY8(5JhZtDpYc>8Nx3Qz~OgRCFFN(VXkU!(Uo7_yebuAS1RCaEio_HWY9nkb2+g&S7qfZt8vHy*iKjG8*#lGs z90&l{5aY+O{48G}0U##?p3_d5*&CgpcXzj0R{)fEJ_-gjA1Qpl^e=lmIjoH2tw)GWTpPX=&2BuOE&Hz0D;5Kx59b&39ASvW^>S;6;m5Dwx(3G4_TjB@P=$QUA pF#IVk{A1f~bTu@*AIj5e{{eIA^)eNAYt;Y%002ovPDHLkV1ikdVpISC literal 0 HcmV?d00001 diff --git a/Templates/Full/game/core/torque.png b/Templates/Full/game/core/torque.png new file mode 100644 index 0000000000000000000000000000000000000000..1023f2bb6655b4e5740ee9dbd56a2e4c2ac27594 GIT binary patch literal 1331 zcmV-31ue_)p4!cG4G5pgl# zAhXdy5XFU{3qgyx>Ozo$8!ePkTLhV=SS?N4Nt>6Ky!+m9(I!or`(9uAUPwI4ymxQT zcfNDJbMAdWkL;b%3Bv!?KFt^C@ufMsl1lX)gckOOKTSPN1#!IXs3v+IEFRWI4{}qq zR+w!%4*>I;j=3JQ5DEj|OGECN;xQuH8j|N4BzTMwrlDY$+F&27b3nZhz)hu)iVj|>P2n1l;sIZ#d z-I`d)ECd4ZFgHyf50Bz*EY;Pz5zg@-H${Cb;`c`<>5X`z*@drbF>FLEtXQV6^%=o& zO^=4s+`3wPZ)}oY)nm#I3;-XQWvt4Yuf48EVpz88Om zGXEL5VwsrW!3+9a^xschrt=(MwyGWTk6-)ClGq5)+*}#>B441J(YWiv64_X)8(5XK z3pw7ZN~AU0b>dPoNuj3D2p3qY8(5JhZtDpYc>8Nx3Qz~OgRCFFN(VXkU!(Uo7_yebuAS1RCaEio_HWY9nkb2+g&S7qfZt8vHy*iKjG8*#lGs z90&l{5aY+O{48G}0U##?p3_d5*&CgpcXzj0R{)fEJ_-gjA1Qpl^e=lmIjoH2tw)GWTpPX=&2BuOE&Hz0D;5Kx59b&39ASvW^>S;6;m5Dwx(3G4_TjB@P=$QUA pF#IVk{A1f~bTu@*AIj5e{{eIA^)eNAYt;Y%002ovPDHLkV1ikdVpISC literal 0 HcmV?d00001 From 6a204f3528974f3efacd32b42a6328b012b9b521 Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 16 Jan 2017 00:16:17 -0600 Subject: [PATCH 13/26] Missed removing the old BMP splash for the new PNG one. --- Templates/Empty/game/art/gui/splash.bmp | Bin 338576 -> 0 bytes Templates/Empty/game/art/gui/splash.png | Bin 0 -> 11864 bytes Templates/Empty/game/main.cs | 2 +- Templates/Full/game/art/gui/splash.bmp | Bin 338576 -> 0 bytes Templates/Full/game/art/gui/splash.png | Bin 0 -> 11864 bytes Templates/Full/game/main.cs | 2 +- 6 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 Templates/Empty/game/art/gui/splash.bmp create mode 100644 Templates/Empty/game/art/gui/splash.png delete mode 100644 Templates/Full/game/art/gui/splash.bmp create mode 100644 Templates/Full/game/art/gui/splash.png diff --git a/Templates/Empty/game/art/gui/splash.bmp b/Templates/Empty/game/art/gui/splash.bmp deleted file mode 100644 index 47cb47f97e390125d04ee2fc9c4a53edee71a7ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 338576 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 Y0--3-;2QqnhYC;uDiDkU@Am2Q|HxtSh5!Hn diff --git a/Templates/Empty/game/art/gui/splash.png b/Templates/Empty/game/art/gui/splash.png new file mode 100644 index 0000000000000000000000000000000000000000..333df9eb3950726e7eb4ebde5dfe034e8a0b1a6f GIT binary patch literal 11864 zcmZX41yoewx9=b*ARr?h(v5_44c#CENH>BsNDST5jfmvX-AK0xNOukmlG5Gvj{kM< zdhgvk#p1+wcJFWh_6}Ep%3{4Fc?kl6u;k^WK7c?->A?3j+B4t?`{;ot@aKhzqO26? z>EAo6tuP)qg6<%v0|S9DaQ=OfCYF5ffrF^d@=DUEe~`d0UQsSh+v$TqlpuL2adr3k zgLDsXHM7T~%(S#TC97Ag@Omr12%37UZpZJuSb|#OSp$oXQuDh}q?BCD&#H?9DHX{G zv*4?oEYbuC5*S7L!S$4aTB-S%>l&$e&N3;q(%;J&>R9a(?|PZ2GU}}o;E~MwGtr03<0O=tXI^$VzxtbCf zI=d| z^!H-5?}`MdMW0v7eAeN0_P1>Ux$l$SVGj2Zn+fKsa}GG`L_7l+YJ6s6d%vw#voJ)E zWXyJ4SOPS8)Mg3B?jQTDANZk-5| zskB110_aUQpSr=5J(u2)*QIaG1%6NqpKrn$}rfB zQZa1H0l!LhJ36?*p~e~i(-msp{&30Y^O>6@+ABl6TvJO^bIs-1Ym;K1lRGx_ z(a}c24avB8?fJu-q0q+}qE))I$(_-?bAXj5?iiT5z3u~Z?)%u;xTm#9c9m@;|Kr*e z*5*+1O_7z_-2}L1+nUl;lxjig@WRaw$>C06CA_<-y%$%-w$0;QRIS zTR^^2%@ibUE=^0LZ+LnrajyMF+kZ7>M%)!L9=4C(^?pn2wPpQTW|E9vKA&1O)uD zIsfqC!<4nl=YOw?$^}g=EkGr}uU8`E%5-ykn-C8#FE7u%#xGh%O+{su4cy{-aC*e) zVQR*i;(0$mknr|7yVw4K_VV$=%)w%)D$L^MYJ_Xxd~X}_aL~*L=&h`ZBPT!y0rheY zW4@bJgUz!L%*+y{OoUv|CnR}n4kTFDc}^B6kxP}!rZ6%xf~Cs6Csqaq22!{zmVK_4 z4hu9hBXTuMEk@FI#HTzVnpRfDy5($4Os^MNcKsYKEYn|y{x+Oj zTg%PIM~Fq0adWaNekkeBW62q862=T~oQ{*m!;#5&IMht4C4=*z`dWTc)zN7(?g&`+ z-HRx26m@#tu)KVr1n0HlPBmz84d(pYQ@tPX9HXSP)awjaCy|wr@$YaMOnS0$xLngl zQZlgr)2=GgusIB%Kwe&+alt)z=$J3#??fH?I`ZQ5*Zs0HK_7VcM87W0yO3^q(xf&1 z%1OVPOQk2~tt^{tT%J1J^vujmID7#vVZ}|trqB%==0_gzvKky6z2f}5$;Q^YUd^Hh z==H;gwYDM-Oh9j6ladg6y8dQ!ySuxmr>BPtPBa8n6TE(p_dj-ZwThGUi!mLv9GUtT zQA@}9X{l`<=%Vfu8xW36G4_Zy0rdoYs%?QRm-6Q3=9VHeb8|MMpRJ=1f8BD;(rK2# z3hk-@EzHHSv3Ibo_w0e2H#axFdCSeE8fIo@vCT8NMZ=k*ep^E+83{=rlkfk%yrX4m zj60rX+|&cVAs_Gibb~=Yw)RMzPni$#GwwSB{A*MEi9TA-Xl1N#VXN<`%n9_&(O!d3k;;3$tJh&ow$`JO%K|>??EB)+p#zHcm@)DYfb=-L=npaRj zZ2*P{>g=^=WOSYF=LDD1FVd+o&a)&Iv{8iUAZ~}#%!D<$F03k<@FG^D#jezF?zI8R zq@|@ZVmmc9&@HQ7+J`{)3ib=0ud%n%-;Akd9=(VFsD^ zM1IzLt~0Z<*1VymwM0Hgs+e8x&bEg43S^s9;a7K_hVona|{j)=!<$5C88k_6BGNC;0#u`y6ZrpP(#Cvt2t23+`bK=HC|~~ zvD&yxryapyEUKt*-GzacN05F>M%w|IpkNX%*|#NpaI1=+x}%@_H}d3BNn^bbt=T_@ zUgI=?dAlhQtbOr1Yzk$t%YZcoqGG!~Rb^*)z;oTvkKVtCF?rGF;Uhd6RK=TNS)*O{ zxikkX;mhMifJnq^!|WdstgN)~^Dr2zTkZ7f8aA)#Fa|Swsi>)~Kjw0-%9HU&L`EJp zZIio^)>Kzd1lBSoC|uQ+K?`y7e51jgaD||cM1NBonhQ#wu1GUpwtRXiJ##s%I(~Ra z+{F3N`g55?#DFyGgeRlcZn;(G>ymYyZU!sOR1_f~3&=-i7MAm`wwq)PKnzo^IR`F( zXkUJuJ?&x6VTR@D#2yHssT0o z^a;&!@Sl?lvF4o+x67JTp7{)sH7q zBc|_#g-!OS7i)w%rn!3D*N$4iw9o><||&6j{}-^v#FwHzw7FQZw|MoAKleq5cm!R$IV^a|`aUJb;) zZDW(y&`9u#N$}eC(9EVh zdBcdLuV!=7kpwOX!VEh)yun0PSOfR4IhV5XQeDfP0E=#IQNt0g#Kw+QyT>|VdmV4a zHDcdGIA$nMKHk%2bPcO4l*ZG)A;JG<5lyQBzT*DSqxIDDFk5>iDM#u&%*Sgx`|C^w z>qXZ_e>~tlt+jY1B_;IA8H-D3%*@O$C%k42%7MLz=OFsV#>VljOw*Ba2BfK>q>XCM zbb?TH?~#4`Lbl=lk8eg1U>xq?&&zd)si|vbJ2;>HmRaI+TgPbcZ-w{bZ4KYfDiC3uN z6hJ@ZJIZJ>M_>{!>)W@bB_+Ej4z0#%9mcb*9$fau#33h!2y*XZ@$C1eAH70-Br4vI z&Nu6D(Pe_2toJT|mvPWMGhBVy%&W3$INpB0$-abNQcw_L!Rda(c}(rrkyTV=dAiZh zCNN`Nmu7u_xe27)Ljtu}5nDq;LseDP+cgWo3hPdS_Erkz&9>PDpn|qO5hPcrxh=IP zueNpPV$Zo@>TcQRA~h`P$nvwfUQTAW(Up(UXOhaT&DL_Rnzhc9K~+vzzJKwp?l$6; zpSi*K_t;T#ddMQTjXl{c01+EXO9%5!sAy=^d7PQ+vW+fl9%e{V20`ee;YP>57&5)r zl+I?V%?2T)<>oayUc{q0iNH>12~N)cipip&PA3&=w?NKXXxE~@{AaiLWncx?&_$6u z9o`j(#GSFBem)b--=6hS&~Jg`7nw7t8EWsBkz-L9-EnK?mUUtRLa*_ zem*fmnQD3~7moO)KO7DHzJsaNXhRioa~7~&jKb4VAn_!Gx8v4zEpA5@#lFSTjG#(5b;6a@7Dk^BYR$$So(x6t|f=gkNG07!}uM1m>{xylaT|ntIpdq#!vS7 zA~%&jw?g4$6GT5);*al_-Xs>A`MbEg5Wq@R=8ZBhjvVwgQt!St*UGacabd>C#c_x! z2zq}F?~yt9{%nMG*n5+1)adbw)c$FExB;CCH`*xp%65`K^hz{V5LZ0Dt%k(dbCTsD65%2_regH4ULK_`_>N)k35JQ%BB za+&Oqj(qwe%l@;W)__fw;LlGfUiEk=@Zb9^5_0f-rc>pFnnNHYy}QjG;~C?t)%RV0 z8!TDf+xT>K#P<{vhfZA8-=9>T9mYF1&!RNbBO}pw{G$iyPv|ptgKX}j$>(C%Ct3y4 z-5yTa!V+@Y)HVQo5cDVDX9kAItA6r$qFN``aL7w$Cp*nOAop&znx{|;3^mW#&*VO% zJWoR)o(c!){5YxJYR5S>l+=nC&Ax@91iLdr?UqI~HVpap`j1OquGxT4cC$lQ87t@v zs1tb=aSM;a=S(}3(Ss|HD1!!Rj+j?~D2TbNIuCE=%zjO3$;ILkcjvHFR@mvw3DEPb z2Em4*q-Y9;w+W2rZ8`~3BijMG-WZsn?$8dbKms?m(Qlh<*d-RMPA55Tl7)Y?ra4lC zDW`ecVe#P+v$x}+7or#-Q>y4Y;pVMzRtS6tb9&#W$GINxmQEi_AU>TSgdaY+PiAR7 z&Vn~2kXY-%(Nhu6=0ByF0}9ekv6GyE{tei)a*C(Y(5WNH`o|vA6cQWYC&N z%lm9(qrJujU>uZz~*zB z1Q=czAd7)2;1{%4e}u#r25mL>`Za9aL&M&vu4BsUvbCEH7KBac15nYkug)uNY5lI* zk407sUeBy$Tk^xfoK7?GRdKJI*QPE@o6ZcDPXN#4<(Bpaq$Q!$GZ?%W8eckt#yJ;0 zI2d18XmI76M`Sb8gWFp$yaA1B*)W*=PptT^ zuR~tWT`fg zl3s3BnIdn@+i8|s-FX!p9G#VskDhV>Y(3+c{OPrKw9-~5avZ-+%R;p`b6r~-7M*+1 zH=Zk-Z9^HxqSJidc0sCzMJ~u8BZJ2Dx#c=$TDR8qAoKBh)t@AElET~h^4Nm#T-FP> z5lE0-Ju3p<_l>{QP!19c>gk^rj&i%H11r9~JH9wsudx^n7rHrEK<^?_)tYZ>JXo_x zn%`07^M0KB^F@G#w=_ZPiAoU~lNPY>*Z~mm+6cMx>@g;SPBBTuoB@U_d;GwntB)8v z?vA5rSaDqdy&=|RJ3@V-iWkKto{kER+1lEggKhh27~FmCd}mfx+j~SS|5u|Fv3S{` zjY)`xQ#ANI0FY0dP;Yb+*<-J)WTocB#PZKXg-90{mnWW-cP0QfN}USa0fCt9n%LYi zn-{&!nyHDU#GxBsn=VBdj{%^m6eDoy;TyikGX&y*)RQOaYCm2by)8HA89k|g#TU6x zveMn@>pih|%jbq`Xu-1!-0Ed=-=!km_KSXj0Fwx#OohWKJoc*)TdeL$iNj)9haqF>i|DTyCFd=FTXv+U8;0!(=H7eCtdR)>S{-bJzMA9s^EL zejvn>b=u5_X|9yhmlo$OBK+-hRoflZ)o9N{ut?u!0Nix;`zaL&^{&)aIv@PZ)>>gF z#amqtiR>0l9Ts8+n<00}Dtf!C+^( zu}XS8et-1T%P5$hVbhMA7^H9Y#R+0^0{o6SZpbY)p18UA-p>7#sJto4if9s1H$O69 z{jV$VIskq9D7-$GE1et;;ocN1NuUe^9N$z}| zg~IVS#gcmX09v2Tk@8-&W=7SSLYmxn0~I0}DOHT)*(HPL?f;9M78B`jhqlo2szBpb zwjZU~2dk6E2h{iUYSz}wpHckVUPx>NUCxPuv-%UIA`y7_>uf-i0Q{|4P$~8@Rpkb0 zH0ry;CB^K@;?SB5=;=Xa%ESM&@81(ltJb^rTETREVp+5p^0zqhdcJ^>cGW}@tQi7r z1u-x~ZHJYeqrID`)sc7cfrO=0G>wLYz0@Uu{`>p)q@FrCluz$?m!`8?xBQiT5~Bn} zxw}p9{`IRY8!;jh63oTc#!$fpLrY=8ynC@seWgk1Zn{P?K%+q?lDJGIjRz(_&X6f&(@_M`RJaI)OP*i>Y zyRyw5rNRh+=8m%d7QXic>_Aj-{t_=*6-->>qb9R(xI(+U=@iHjBKH+Tzy3Hmk zLQ|t~eAV!uxE%Fzva-b%GPEr zY6+KOZTW9PP)Y$5z_qOl9=c z++WS9kNoJaEu90zLfe~{@pInuwj(3`#CpNBOn;>j@38s*R#?)}5hi)gIsA0vK;&=oo`8>W^x^B$#57Tq-<7&YQ4Dk+}uIIM5xEsjcq(Y!1 zDlaG#atH@-B)ri{^je}+fagtf8+?c`F*wFh+2;81E@k+Pki~Xvw*c$glaJ*$6<1AW z>Cnd0Ks`T^gd9C9i}bkps_P^ z^J@jU8~;BTZBb`C_>Z1W(6_sIr2KAsk6xpZWU+Q zm^@!s>hvezrg0tAJd-)6p`-KRL+btdTmveWCf&<7i0w{2m-lDlTIUiwE+HZP{2^g#aLV zp7I7RS$VlQzw?&iARSd`;b*Nu#K!BdYB?{Eow39aw-|3V2>|voNky+~{`7Y;>uTeq zKgLlKkYdU}FadTb_*D#ij0ZJ4Ce!~YIp2y?OY;zcO_0axe8rWN4vtLMgK+BP6rDYl zA#}H)FPK!t&~CAAL)%>K_bIb4U5je$jCw~^8LWfAy0j7a;Xv4Qrv*8)?n>Lq+3Ydu zQct~VVj|7O6VO*(J(X15e%+>ym|DceWmtWs~fqpf9f}lcaKL~Vo^LBjR2+#=KjqBTy~Ifq8gXg38jn9?HAg)GK+{@xy73gC1<3J_qLK? zcG)iec>IF;Bxhu;oYRf;N-j-~7FSgtE(MXcs?~LYzRJJ_c7^oT*475lqEIHjiQgjM z{jdK7&8LlI?#EEr)?>KJ`Wi07;_0`bsT&VlDa6F2d}V%rWBtCV<+u-Is@OA2uTUo5 zhr~3Av&fPw`NLF+5Ov zZwc?FrD@n`iazbb=BksmD-pfTDKSkci3QvAqpVdQny+xl6~gTa6eoXwgYRS@^0#LeY4nRx zOJG1j(JUt~e-o{sQ8*d>T>&Ch;OX_`)fL-MBlJ9CgpjcOqt4}Qwq&kp{*u8Cd?%Uo z_c!&DSPLE~Er~+-sKEXSo*6G(C-Gu52<1Tv@f8xm#`%39g6v33QzN16=cQ0&KA#JQ zt3xz+V$ETrNId`|Dh)7p+$-vsK;cOJy3mX-($t$%K#eK2Mi94KT~bo=m4q!a{?w+- z+ZzuL*~cT%$9m5Mm+LUUI-_Pwx8tZJQt$D)AIgnDk8FhOD6@W!A|@^gi-ea|MkF!j z!bRFMNr_Ndm8AR?HabujR5i1D9Msw8a~$q&srC4SO->CEDE2`nMD#Q?G(AkGUf687 zJQ+DrGI_uTi1K#&plS}Lzq=KWt8l-YW$noS-0hqw1U+xNBSG-1+F#$$iZ6ddKPKOt zW&D{s(7wwj^`5G$fyxHy%jtnEI`d!gdqtb+)XYVpA~(Od4QwuksUs$wGv_49eSaea z!;g0groQ8q(qt_alLt8(a_ebx+&+wT0)nCkVE3(Jh3rk%t34u&k9|)ny&Vjdnqu zh2D!s_{i2opA+}tDpid>zq$Q4wt45U5xKS487F^O_*neebK zQQV!JrHpL6YvIwpzM@w{AZHh{-~WPe>71>r()W#NmE>XF@)%ssa!tawI7`gostS2) zBQYhyUWwueKzQet7lH}gGl+8NHNFu|5K68p({U54fdQ(M!l!pc!h5N6w!B19FLK38 zCy6n8G)pfu<%cZ8YyA^jxmi5&8uy+Tw@qC-DIEahokWQv#QI#6O7GyY%>-5$R5eJI zRbLgxjlL-ceMPC#E=4G%a#z7iKTqw}zQ|QAovvaL(xq;br+!$eJ=c+6tdylaZyXKh zsHRgg59|PG;Q=*M#GLJ8he?x}dxWyyO&j?1c?-}>W7?Cv}Arcw!Tja=7NeUi_zF zu#gr#OHPrWr3>HEJ>14hS6;DK!IZo(zrpZA^zq;_W45tLqvcP81VYR*U8Oz1=5-@M z_1wp^I-|~X{y0V@mbmaD^$1^T^JB|!Zg7ILV+(hpfY;B0g2e6F0JLeIsmcpngUQ{D zW1o~yPv)nqt=(H&<{e7)QJ9;-liTvf800M9=}=6Aj$)!qi^~D9^ci_Q8tTJ~2b91L zxrW;N)Ju;!!KeK??KsA8f~U(Ep+Q5VxBJ2GPW#d^ovin>Qs;Fcwm>kUwzjr;aF9^G z)%znJDK$W}b3v9gu;RYn;I>#ijV>^!gVNmdCfBn6>x?GQn7|4`ONSPoR{2DLop^sx z$D(i~utvr`ov+hi3*YyO3gcbh6YHkO)K!blAG{VCx%&P4V7U!-R4*v7Ra_LX0(@+( z>*jdu1b~Xy}}ASeF~@^rjD&Mu*b5OmELKVl8=L zE}sO`p{0}gVODgkfZf7qtB!8qOCcGOhXak59q;w;8{RtHtZ; zP_u2~Dr}0*!aNzKuA0KpsDP?;hH~*1g@cEeZRY%-Ar^A(kfuLUy?;@=0eHX?PQO!s zmMRTS4lq2>^SivL97`q|1E>$1S21(YX+HSO@W_IlHw%(W#5F?|dOY_3R1dn(G-eVKrypIXD5%wXe00>8uw>uDjVuq}SzU=;;+{mg|Z}JAHSKm2%KG^y0 z=$1~-MXUyjRahQ$1pbFSD8jkfk%Lo|m%B?FH*6ul%2`p-jx`U!Hc^};9^h~^Xb~mg zxWL{K`0U^mLo0jzrSSfG#hNfowKs)l*@$4N!zbrnJj4dA z7N{wm-ofnXt`|yInEkhF;P>=-IC#{okgmiXD1X_PVo(kZZFwT9Py_O!*wnxJ-C5AU zF)FizM-63fzG<+6+QK#EO+9ZR4Y#>gY%TvAUIwZlZ88H3hm%thf5Lr(Xv;~BId@86 z51rLLc3B|;Ru?&qNNH3f2*$tmqJ zcQ?6n0VIK{s&Qj(U6w>C4t!IVa_F1r_Fbx6U` z$}6wW)YM}VeVUMj#DN^PSn2w%aWmX z`KT#8Obml+Aq^Vb`8H5BTZIuXA{>`~wdV^s(1R{_$Pf+|+e}5D#04tnFh&-F$Z<=| zK0^$CtFbi)cdIfapmH}PvJq@sf#Eu$EL$1FzTy2P`KMy%azj5aP=XE0q#pn)hKYF{ zjDVOCC_7o!FhSKrY-(T_RSH$cbUg*M^-t3HIeocHJMWd1yO5Cqr>BbIY4g?hhZd1R z8UG=)5=NEntn`!yxOssCFBE|q&fmD1;Foo_!DTAA8K`wWS(wh-0JKQ(XFCs$=30iY zc=2!7Hgp08!2?$9nFqpx*yS(QkZ1qU;FyZ((makY`{G4b5Vl#e0q66gf5<0hV%_e! zr-pIAia3x&jfn(4zXTpFmOdu7MZYE%hx(6>i8{}RpkDztQjMP&Qc}ssBd|ZtP zBjN@p?e|O6)cQ7ec6JsmG+YS|(Zal?La`}+Zl&711CIxEn^bADR8aiug-&eTRuvcb z?_Vy+!1YJg0OqAZ^3qVL3JK$Y{{!qCM1lYS literal 0 HcmV?d00001 diff --git a/Templates/Empty/game/main.cs b/Templates/Empty/game/main.cs index 87daf9770..44b333b87 100644 --- a/Templates/Empty/game/main.cs +++ b/Templates/Empty/game/main.cs @@ -29,7 +29,7 @@ $defaultGame = "scripts"; // Set profile directory $Pref::Video::ProfilePath = "core/profile"; $Core::windowIcon = "core/torque.png"; -$Core::splashWindowImage = "art/gui/splash.bmp"; +$Core::splashWindowImage = "art/gui/splash.png"; function createCanvas(%windowTitle) { diff --git a/Templates/Full/game/art/gui/splash.bmp b/Templates/Full/game/art/gui/splash.bmp deleted file mode 100644 index 47cb47f97e390125d04ee2fc9c4a53edee71a7ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 338576 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 Y0--3-;2QqnhYC;uDiDkU@Am2Q|HxtSh5!Hn diff --git a/Templates/Full/game/art/gui/splash.png b/Templates/Full/game/art/gui/splash.png new file mode 100644 index 0000000000000000000000000000000000000000..333df9eb3950726e7eb4ebde5dfe034e8a0b1a6f GIT binary patch literal 11864 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 literal 0 HcmV?d00001 diff --git a/Templates/Full/game/main.cs b/Templates/Full/game/main.cs index d4a6656e0..65aae6d7f 100644 --- a/Templates/Full/game/main.cs +++ b/Templates/Full/game/main.cs @@ -29,7 +29,7 @@ $defaultGame = "scripts"; // Set profile directory $Pref::Video::ProfilePath = "core/profile"; $Core::windowIcon = "core/torque.png"; -$Core::splashWindowImage = "art/gui/splash.bmp"; +$Core::splashWindowImage = "art/gui/splash.png"; function createCanvas(%windowTitle) { From c7b041f54500a5c579935a032d26ea4b27e65264 Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 16 Jan 2017 22:11:32 -0600 Subject: [PATCH 14/26] Fixes the debug netevent packing error by keeping the mStart value as it's proper 0-1 range until it gets to the client, using a temporary world-space var for finding strike target objects in the radius. Also add a checker for if there is a texture or not set for the lighting bolt. If it use, set the stateblock description to support it and set the texture, if not, only utilize the color blend. --- Engine/source/T3D/fx/lightning.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 125c5891d..c7981df47 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -478,11 +478,15 @@ void Lightning::renderObject(ObjectRenderInst *ri, SceneRenderState *state, Base desc.setBlend( true, GFXBlendSrcAlpha, GFXBlendOne); desc.setCullMode(GFXCullNone); desc.zWriteEnable = false; - desc.samplersDefined = true; - desc.samplers[0].magFilter = GFXTextureFilterLinear; - desc.samplers[0].minFilter = GFXTextureFilterLinear; - desc.samplers[0].addressModeU = GFXAddressWrap; - desc.samplers[0].addressModeV = GFXAddressWrap; + + if (mDataBlock->strikeTextures[0].isValid()) + { + desc.samplersDefined = true; + desc.samplers[0].magFilter = GFXTextureFilterLinear; + desc.samplers[0].minFilter = GFXTextureFilterLinear; + desc.samplers[0].addressModeU = GFXAddressWrap; + desc.samplers[0].addressModeV = GFXAddressWrap; + } mLightningSB = GFX->createStateBlock(desc); @@ -494,7 +498,8 @@ void Lightning::renderObject(ObjectRenderInst *ri, SceneRenderState *state, Base Strike* walk = mStrikeListHead; while (walk != NULL) { - GFX->setTexture(0, mDataBlock->strikeTextures[0]); + if (mDataBlock->strikeTextures[0].isValid()) + GFX->setTexture(0, mDataBlock->strikeTextures[0]); for( U32 i=0; i<3; i++ ) { @@ -731,18 +736,19 @@ void Lightning::strikeRandomPoint() Point3F strikePoint( gRandGen.randF( 0.0f, 1.0f ), gRandGen.randF( 0.0f, 1.0f ), 0.0f ); // check if an object is within target range + Point3F worldPosStrikePoint = strikePoint; - strikePoint *= mObjScale; - strikePoint += getPosition(); - strikePoint += Point3F( -mObjScale.x * 0.5f, -mObjScale.y * 0.5f, 0.0f ); + worldPosStrikePoint *= mObjScale; + worldPosStrikePoint += getPosition(); + worldPosStrikePoint += Point3F( -mObjScale.x * 0.5f, -mObjScale.y * 0.5f, 0.0f ); Box3F queryBox; F32 boxWidth = strikeRadius * 2.0f; queryBox.minExtents.set( -boxWidth * 0.5f, -boxWidth * 0.5f, -mObjScale.z * 0.5f ); queryBox.maxExtents.set( boxWidth * 0.5f, boxWidth * 0.5f, mObjScale.z * 0.5f ); - queryBox.minExtents += strikePoint; - queryBox.maxExtents += strikePoint; + queryBox.minExtents += worldPosStrikePoint; + queryBox.maxExtents += worldPosStrikePoint; SimpleQueryList sql; getContainer()->findObjects(queryBox, DAMAGEABLE_TYPEMASK, From f43bfd6ca25c541c023274ab22aa33c296d70953 Mon Sep 17 00:00:00 2001 From: Areloch Date: Tue, 17 Jan 2017 01:10:24 -0600 Subject: [PATCH 15/26] Cleans up a few cmake options and flags a most of the alsoft and sdl options as advanced so they're not cluttering up the regular view for no reason --- Tools/CMake/torque3d.cmake | 123 ++++++++++++++++++++++++++++++++++--- 1 file changed, 113 insertions(+), 10 deletions(-) diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index 44591dd94..aaaa84e1e 100644 --- a/Tools/CMake/torque3d.cmake +++ b/Tools/CMake/torque3d.cmake @@ -67,17 +67,63 @@ endif() option(TORQUE_SFX_OPENAL "OpenAL Sound" ON) #windows uses openal-soft if(WIN32) -#disable a few things that are not required -set(ALSOFT_TESTS OFF CACHE BOOL "Build and install test programs" FORCE) -set(ALSOFT_UTILS OFF CACHE BOOL "Build and install utility programs" FORCE) -set(ALSOFT_EXAMPLES OFF CACHE BOOL "Build and install example programs" FORCE) -set(ALSOFT_CONFIG OFF CACHE BOOL "Install alsoft.conf sample configuration file" FORCE) -set(ALSOFT_INSTALL OFF CACHE BOOL "Install headers and libraries" FORCE) -set(ALSOFT_NO_CONFIG_UTIL OFF CACHE BOOL "Disable building the alsoft-config utility" FORCE) -set(ALSOFT_HRTF_DEFS OFF CACHE BOOL "Install HRTF definition files" FORCE) -set(ALSOFT_AMBDEC_PRESETS OFF CACHE BOOL "Install AmbDec presets" FORCE) -add_subdirectory( ${libDir}/openal-soft ${CMAKE_CURRENT_BINARY_DIR}/openal-soft) + #disable a few things that are not required + set(ALSOFT_TESTS OFF CACHE BOOL "Build and install test programs" FORCE) + set(ALSOFT_UTILS OFF CACHE BOOL "Build and install utility programs" FORCE) + set(ALSOFT_EXAMPLES OFF CACHE BOOL "Build and install example programs" FORCE) + set(ALSOFT_CONFIG OFF CACHE BOOL "Install alsoft.conf sample configuration file" FORCE) + set(ALSOFT_INSTALL OFF CACHE BOOL "Install headers and libraries" FORCE) + set(ALSOFT_NO_CONFIG_UTIL OFF CACHE BOOL "Disable building the alsoft-config utility" FORCE) + set(ALSOFT_HRTF_DEFS OFF CACHE BOOL "Install HRTF definition files" FORCE) + set(ALSOFT_AMBDEC_PRESETS OFF CACHE BOOL "Install AmbDec presets" FORCE) + + add_subdirectory( ${libDir}/openal-soft ${CMAKE_CURRENT_BINARY_DIR}/openal-soft) endif() + +if(TORQUE_SFX_OPENAL) + #Hide some unnecessary fields as advanced + mark_as_advanced(ALSOFT_AMBDEC_PRESETS) + mark_as_advanced(ALSOFT_BACKEND_DSOUND) + mark_as_advanced(ALSOFT_BACKEND_MMDEVAPI) + mark_as_advanced(ALSOFT_BACKEND_WAVE) + mark_as_advanced(ALSOFT_BACKEND_WINMM) + mark_as_advanced(ALSOFT_CONFIG) + mark_as_advanced(ALSOFT_CPUEXT_SSE) + mark_as_advanced(ALSOFT_CPUEXT_SSE2) + mark_as_advanced(ALSOFT_CPUEXT_SSE3) + mark_as_advanced(ALSOFT_CPUEXT_SSE4_1) + mark_as_advanced(ALSOFT_DLOPEN) + mark_as_advanced(ALSOFT_EMBED_HRTF_DATA) + mark_as_advanced(ALSOFT_EXAMPLES) + mark_as_advanced(ALSOFT_HRTF_DEFS) + mark_as_advanced(ALSOFT_INSTALL) + mark_as_advanced(ALSOFT_NO_CONFIG_UTIL) + mark_as_advanced(ALSOFT_NO_UID_DEFS) + mark_as_advanced(ALSOFT_REQUIRE_ALSA) + mark_as_advanced(ALSOFT_REQUIRE_COREAUDIO) + mark_as_advanced(ALSOFT_REQUIRE_DSOUND) + mark_as_advanced(ALSOFT_REQUIRE_JACK) + mark_as_advanced(ALSOFT_REQUIRE_MMDEVAPI) + mark_as_advanced(ALSOFT_REQUIRE_NEON) + mark_as_advanced(ALSOFT_REQUIRE_OPENSL) + mark_as_advanced(ALSOFT_REQUIRE_OSS) + mark_as_advanced(ALSOFT_REQUIRE_PORTAUDIO) + mark_as_advanced(ALSOFT_REQUIRE_PULSEAUDIO) + mark_as_advanced(ALSOFT_REQUIRE_QSA) + mark_as_advanced(ALSOFT_REQUIRE_SNDIO) + mark_as_advanced(ALSOFT_REQUIRE_SOLARIS) + mark_as_advanced(ALSOFT_REQUIRE_SSE) + mark_as_advanced(ALSOFT_REQUIRE_SSE2) + mark_as_advanced(ALSOFT_REQUIRE_SSE4_1) + mark_as_advanced(ALSOFT_REQUIRE_WINMM) + mark_as_advanced(ALSOFT_TESTS) + mark_as_advanced(ALSOFT_UTILS) + mark_as_advanced(ALSOFT_WERROR) + mark_as_advanced(COREAUDIO_FRAMEWORK) + mark_as_advanced(CMAKE_DEBUG_POSTFIX) + mark_as_advanced(FORCE_STATIC_VCRT) +endif() + mark_as_advanced(TORQUE_SFX_OPENAL) option(TORQUE_HIFI "HIFI? support" OFF) mark_as_advanced(TORQUE_HIFI) @@ -690,6 +736,63 @@ if(TORQUE_SDL) addDef(TORQUE_SDL) addInclude(${libDir}/sdl/include) addLib(SDL2) + + SET(VIDEO_WAYLAND OFF CACHE BOOL "" FORCE) + mark_as_advanced(3DNOW) + mark_as_advanced(ALSA) + mark_as_advanced(ALTIVEC) + mark_as_advanced(ARTS) + mark_as_advanced(ASSEMBLY) + mark_as_advanced(ASSERTIONS) + mark_as_advanced(DIRECTX) + mark_as_advanced(DISKAUDIO) + mark_as_advanced(DUMMYAUDIO) + mark_as_advanced(ESD) + mark_as_advanced(FUSIONSOUND) + mark_as_advanced(INPUT_TSLIB) + mark_as_advanced(LIBC) + mark_as_advanced(MMX) + mark_as_advanced(NAS) + mark_as_advanced(NAS_SHARED) + mark_as_advanced(OSS) + mark_as_advanced(PTHREADS) + mark_as_advanced(PULSEAUDIO) + mark_as_advanced(RENDER_D3D) + mark_as_advanced(RPATH) + mark_as_advanced(SNDIO) + mark_as_advanced(SSE) + mark_as_advanced(SSE2) + mark_as_advanced(SSEMATH) + mark_as_advanced(WINDRES) + mark_as_advanced(SDL_ATOMIC) + mark_as_advanced(SDL_AUDIO) + mark_as_advanced(SDL_CPUINFO) + mark_as_advanced(SDL_DLOPEN) + mark_as_advanced(SDL_EVENTS) + mark_as_advanced(SDL_FILE) + mark_as_advanced(SDL_FILESYSTEM) + mark_as_advanced(SDL_HAPTIC) + mark_as_advanced(SDL_JOYSTICK) + mark_as_advanced(SDL_LOADSO) + mark_as_advanced(SDL_POWER) + mark_as_advanced(SDL_RENDER) + mark_as_advanced(SDL_SHARED) + mark_as_advanced(SDL_STATIC) + mark_as_advanced(SDL_THREADS) + mark_as_advanced(SDL_TIMERS) + mark_as_advanced(SDL_VIDEO) + mark_as_advanced(CLOCK_GETTIME) + mark_as_advanced(GCC_ATOMICS) + mark_as_advanced(VIDEO_WAYLAND) + mark_as_advanced(VIDEO_COCOA) + mark_as_advanced(VIDEO_DIRECTFB) + mark_as_advanced(VIDEO_DUMMY) + mark_as_advanced(VIDEO_MIR) + mark_as_advanced(VIDEO_OPENGL) + mark_as_advanced(VIDEO_OPENGLES) + mark_as_advanced(VIDEO_RPI) + mark_as_advanced(VIDEO_VIVANTE) + mark_as_advanced(VIDEO_X11) endif() if(TORQUE_STATIC_CODE_ANALYSIS) From ec8b657b715709376f71cc8311d6e276faf13265 Mon Sep 17 00:00:00 2001 From: Areloch Date: Thu, 19 Jan 2017 19:15:50 -0600 Subject: [PATCH 16/26] Adds support for multiple textures used in the strike rendering per @RichardsGameStudio's help. --- Engine/source/T3D/fx/lightning.cpp | 21 ++++++++++++++++-- Engine/source/T3D/fx/lightning.h | 1 + .../Full/game/art/datablocks/environment.cs | 2 ++ .../Full/game/art/environment/lightning.png | Bin 0 -> 2876 bytes 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 Templates/Full/game/art/environment/lightning.png diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index c7981df47..ed941a82b 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -243,6 +243,7 @@ LightningData::LightningData() dMemset( strikeTextureNames, 0, sizeof( strikeTextureNames ) ); dMemset( strikeTextures, 0, sizeof( strikeTextures ) ); dMemset( thunderSounds, 0, sizeof( thunderSounds ) ); + mNumStrikeTextures = 0; } LightningData::~LightningData() @@ -297,10 +298,14 @@ bool LightningData::preload(bool server, String &errorStr) if( !sfxResolve( &strikeSound, sfxErrorStr ) ) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", sfxErrorStr.c_str()); + mNumStrikeTextures = 0; for (U32 i = 0; i < MaxTextures; i++) { if (strikeTextureNames[i][0]) + { strikeTextures[i] = GFXTexHandle(strikeTextureNames[i], &GFXDefaultStaticDiffuseProfile, avar("%s() - strikeTextures[%d] (line %d)", __FUNCTION__, i, __LINE__)); + mNumStrikeTextures++; + } } } @@ -317,6 +322,9 @@ void LightningData::packData(BitStream* stream) U32 i; for (i = 0; i < MaxThunders; i++) sfxWrite( stream, thunderSounds[ i ] ); + + stream->writeInt(mNumStrikeTextures, 4); + for (i = 0; i < MaxTextures; i++) { stream->writeString(strikeTextureNames[i]); } @@ -331,6 +339,9 @@ void LightningData::unpackData(BitStream* stream) U32 i; for (i = 0; i < MaxThunders; i++) sfxRead( stream, &thunderSounds[ i ] ); + + mNumStrikeTextures = stream->readInt(4); + for (i = 0; i < MaxTextures; i++) { strikeTextureNames[i] = stream->readSTString(); } @@ -479,7 +490,7 @@ void Lightning::renderObject(ObjectRenderInst *ri, SceneRenderState *state, Base desc.setCullMode(GFXCullNone); desc.zWriteEnable = false; - if (mDataBlock->strikeTextures[0].isValid()) + if (mDataBlock->mNumStrikeTextures != 0) { desc.samplersDefined = true; desc.samplers[0].magFilter = GFXTextureFilterLinear; @@ -498,8 +509,14 @@ void Lightning::renderObject(ObjectRenderInst *ri, SceneRenderState *state, Base Strike* walk = mStrikeListHead; while (walk != NULL) { - if (mDataBlock->strikeTextures[0].isValid()) + if (mDataBlock->mNumStrikeTextures > 1) + { + GFX->setTexture(0, mDataBlock->strikeTextures[sgLightningRand.randI(0, mDataBlock->mNumStrikeTextures - 1)]); + } + else if (mDataBlock->mNumStrikeTextures > 0) + { GFX->setTexture(0, mDataBlock->strikeTextures[0]); + } for( U32 i=0; i<3; i++ ) { diff --git a/Engine/source/T3D/fx/lightning.h b/Engine/source/T3D/fx/lightning.h index 20620fca5..71ff493d1 100644 --- a/Engine/source/T3D/fx/lightning.h +++ b/Engine/source/T3D/fx/lightning.h @@ -70,6 +70,7 @@ class LightningData : public GameBaseData GFXTexHandle strikeTextures[MaxTextures]; U32 numThunders; + U32 mNumStrikeTextures; protected: bool onAdd(); diff --git a/Templates/Full/game/art/datablocks/environment.cs b/Templates/Full/game/art/datablocks/environment.cs index c9d2b0a51..ab9af14d3 100644 --- a/Templates/Full/game/art/datablocks/environment.cs +++ b/Templates/Full/game/art/datablocks/environment.cs @@ -83,6 +83,8 @@ datablock LightningData(DefaultStorm) thunderSounds[1] = ThunderCrash2Sound; thunderSounds[2] = ThunderCrash3Sound; thunderSounds[3] = ThunderCrash4Sound; + + strikeTextures[0] = "art/environment/lightning"; }; datablock ReflectorDesc( DefaultCubeDesc ) diff --git a/Templates/Full/game/art/environment/lightning.png b/Templates/Full/game/art/environment/lightning.png new file mode 100644 index 0000000000000000000000000000000000000000..fc19efad9592e68a518f65044a32c509fed28aaf GIT binary patch literal 2876 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 literal 0 HcmV?d00001 From f8b650f7a1225e5ebc7dd32d08e040b6fb320871 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 21 Jan 2017 17:11:54 -0600 Subject: [PATCH 17/26] Reworks the open/close functions of the gui and world editors so they will properly toggle between and clean up when closed. --- Templates/Empty/game/art/gui/mainMenuGui.gui | 2 +- .../game/tools/base/utils/inspector.ed.cs | 2 +- .../game/tools/guiEditor/gui/guiEditor.ed.gui | 2 +- .../tools/guiEditor/scripts/guiEditor.ed.cs | 43 ++++++++- .../tools/worldEditor/gui/EditorGui.ed.gui | 2 +- .../tools/worldEditor/scripts/EditorGui.ed.cs | 19 +++- .../tools/worldEditor/scripts/editor.ed.cs | 32 ++----- .../tools/worldEditor/scripts/menus.ed.cs | 88 +++++++++++-------- Templates/Full/game/art/gui/mainMenuGui.gui | 2 +- .../game/tools/base/utils/inspector.ed.cs | 2 +- .../game/tools/guiEditor/gui/guiEditor.ed.gui | 2 +- .../tools/guiEditor/scripts/guiEditor.ed.cs | 43 ++++++++- .../tools/worldEditor/gui/EditorGui.ed.gui | 2 +- .../tools/worldEditor/scripts/EditorGui.ed.cs | 19 +++- .../tools/worldEditor/scripts/editor.ed.cs | 32 ++----- .../tools/worldEditor/scripts/menus.ed.cs | 88 +++++++++++-------- 16 files changed, 238 insertions(+), 142 deletions(-) diff --git a/Templates/Empty/game/art/gui/mainMenuGui.gui b/Templates/Empty/game/art/gui/mainMenuGui.gui index e9d575093..212944c56 100644 --- a/Templates/Empty/game/art/gui/mainMenuGui.gui +++ b/Templates/Empty/game/art/gui/mainMenuGui.gui @@ -106,7 +106,7 @@ profile = "GuiMenuButtonProfile"; visible = "1"; active = "1"; - command = "GuiEdit();"; + command = "toggleGuiEditor(1);"; tooltipProfile = "GuiToolTipProfile"; tooltip = "The GUI Editor is accessible in-game by pressing F10"; hovertime = "1000"; diff --git a/Templates/Empty/game/tools/base/utils/inspector.ed.cs b/Templates/Empty/game/tools/base/utils/inspector.ed.cs index 9df8c7e98..f7c27ecf0 100644 --- a/Templates/Empty/game/tools/base/utils/inspector.ed.cs +++ b/Templates/Empty/game/tools/base/utils/inspector.ed.cs @@ -105,7 +105,7 @@ function EditorInspectorBase::onAdd( %this ) superClass = "MenuBuilder"; isPopup = true; - item[ 0 ] = "Edit Profile" TAB "" TAB "if( !$InGuiEditor ) toggleGuiEditor( true ); GuiEditor.editProfile( %this.inspectorField.getData() );"; + item[ 0 ] = "Edit Profile" TAB "" TAB "if( !GuiEditorIsActive() ) toggleGuiEditor( true ); GuiEditor.editProfile( %this.inspectorField.getData() );"; item[ 1 ] = "Jump to Definition in Torsion" TAB "" TAB "EditorOpenDeclarationInTorsion( %this.inspectorField.getData() );"; item[ 2 ] = "Inspect Object" TAB "" TAB "inspectObject( %this.inspectorField.getData() );"; item[ 3 ] = "-"; diff --git a/Templates/Empty/game/tools/guiEditor/gui/guiEditor.ed.gui b/Templates/Empty/game/tools/guiEditor/gui/guiEditor.ed.gui index e387f1bc0..cc03cbd07 100644 --- a/Templates/Empty/game/tools/guiEditor/gui/guiEditor.ed.gui +++ b/Templates/Empty/game/tools/guiEditor/gui/guiEditor.ed.gui @@ -86,7 +86,7 @@ minExtent = "8 8"; canSave = "1"; visible = "1"; - command = "GuiEditor.switchToWorldEditor();"; + command = "toggleEditor(1);"; tooltipProfile = "ToolsGuiToolTipProfile"; ToolTip = "World Editor"; hovertime = "1000"; diff --git a/Templates/Empty/game/tools/guiEditor/scripts/guiEditor.ed.cs b/Templates/Empty/game/tools/guiEditor/scripts/guiEditor.ed.cs index eace7d43b..61dc8c5e7 100644 --- a/Templates/Empty/game/tools/guiEditor/scripts/guiEditor.ed.cs +++ b/Templates/Empty/game/tools/guiEditor/scripts/guiEditor.ed.cs @@ -75,11 +75,26 @@ function toggleGuiEditor( %make ) if( EditorIsActive() && !GuiEditor.toggleIntoEditorGui ) toggleEditor( true ); - GuiEdit(); + if( !isObject( GuiEditCanvas ) ) + new GuiControl( GuiEditCanvas, EditorGuiGroup ); - // Cancel the scheduled event to prevent - // the level from cycling after it's duration - // has elapsed. + if( GuiEditorIsActive() ) + { + GuiEditor.close(); + } + else + { + GuiEditor.open(); + + // Cancel the scheduled event to prevent + // the level from cycling after it's duration + // has elapsed. + cancel($Game::Schedule); + } + + // Cancel the scheduled event to prevent + // the level from cycling after it's duration + // has elapsed. cancel($Game::Schedule); } } @@ -98,6 +113,26 @@ package GuiEditor_BlockDialogs //--------------------------------------------------------------------------------------------- +function GuiEditor::open(%this) +{ + GuiEditCanvas.onCreateMenu(); + + GuiEditContent(Canvas.getContent()); +} + +function GuiEditor::close(%this) +{ + // prevent the mission editor from opening while the GuiEditor is open. + if(Canvas.getContent() != GuiEditorGui.getId()) + return; + + GuiGroup.add(GuiEditorGui); + + Canvas.setContent(GuiEditor.lastContent); + + GuiEditCanvas.onDestroyMenu(); +} + function GuiEditor::openForEditing( %this, %content ) { Canvas.setContent( GuiEditorGui ); diff --git a/Templates/Empty/game/tools/worldEditor/gui/EditorGui.ed.gui b/Templates/Empty/game/tools/worldEditor/gui/EditorGui.ed.gui index 445bacf63..3eb8558e4 100644 --- a/Templates/Empty/game/tools/worldEditor/gui/EditorGui.ed.gui +++ b/Templates/Empty/game/tools/worldEditor/gui/EditorGui.ed.gui @@ -67,7 +67,7 @@ MinExtent = "8 8"; canSave = "1"; Visible = "1"; - Command = "toggleEditor( true ); GuiEdit(); $GuiEditorBtnPressed = true;"; + Command = "toggleGuiEditor(true); $GuiEditorBtnPressed = true;"; tooltipprofile = "ToolsGuiToolTipProfile"; ToolTip = "Open the GuiEditor"; hovertime = "1000"; diff --git a/Templates/Empty/game/tools/worldEditor/scripts/EditorGui.ed.cs b/Templates/Empty/game/tools/worldEditor/scripts/EditorGui.ed.cs index 38a180e64..31f794d17 100644 --- a/Templates/Empty/game/tools/worldEditor/scripts/EditorGui.ed.cs +++ b/Templates/Empty/game/tools/worldEditor/scripts/EditorGui.ed.cs @@ -35,8 +35,6 @@ function EditorGui::init(%this) $NextOperationId = 1; $HeightfieldDirtyRow = -1; - %this.buildMenus(); - if( !isObject( %this-->ToolsPaletteWindow ) ) { // Load Creator/Inspector GUI @@ -1914,6 +1912,8 @@ function Editor::open(%this) if(Canvas.getContent() == GuiEditorGui.getId()) return; + EditorGui.buildMenus(); + if( !EditorGui.isInitialized ) EditorGui.init(); @@ -1929,6 +1929,21 @@ function Editor::close(%this, %gui) if(isObject(MessageHud)) MessageHud.close(); EditorGui.writeCameraSettings(); + + EditorGui.onDestroyMenu(); +} + +function EditorGui::onDestroyMenu(%this) +{ + if( !isObject( %this.menuBar ) ) + return; + + // Destroy menus + while( %this.menuBar.getCount() != 0 ) + %this.menuBar.getObject( 0 ).delete(); + + %this.menuBar.removeFromCanvas(); + %this.menuBar.delete(); } $RelightCallback = ""; diff --git a/Templates/Empty/game/tools/worldEditor/scripts/editor.ed.cs b/Templates/Empty/game/tools/worldEditor/scripts/editor.ed.cs index 74b34e0a9..8545c9d67 100644 --- a/Templates/Empty/game/tools/worldEditor/scripts/editor.ed.cs +++ b/Templates/Empty/game/tools/worldEditor/scripts/editor.ed.cs @@ -99,18 +99,12 @@ function Editor::checkActiveLoadDone() //------------------------------------------------------------------------------ function toggleEditor(%make) { - if (Canvas.isFullscreen()) - { - MessageBoxOK("Windowed Mode Required", "Please switch to windowed mode to access the Mission Editor."); - return; - } - if (%make) - { + { %timerId = startPrecisionTimer(); - if( $InGuiEditor ) - GuiEdit(); + if( GuiEditorIsActive() ) + toggleGuiEditor(1); if( !$missionRunning ) { @@ -141,29 +135,21 @@ function toggleEditor(%make) Editor.close("PlayGui"); } } - else + else { - if ( !$GuiEditorBtnPressed ) - { - canvas.pushDialog( EditorLoadingGui ); - canvas.repaint(); - } - else - { - $GuiEditorBtnPressed = false; - } + canvas.pushDialog( EditorLoadingGui ); + canvas.repaint(); Editor.open(); - // Cancel the scheduled event to prevent - // the level from cycling after it's duration - // has elapsed. + // Cancel the scheduled event to prevent + // the level from cycling after it's duration + // has elapsed. cancel($Game::Schedule); if (theLevelInfo.type $= "DemoScene") commandToServer('dropCameraAtPlayer', true); - canvas.popDialog(EditorLoadingGui); } diff --git a/Templates/Empty/game/tools/worldEditor/scripts/menus.ed.cs b/Templates/Empty/game/tools/worldEditor/scripts/menus.ed.cs index b6c4200d4..be068b9ed 100644 --- a/Templates/Empty/game/tools/worldEditor/scripts/menus.ed.cs +++ b/Templates/Empty/game/tools/worldEditor/scripts/menus.ed.cs @@ -42,47 +42,59 @@ function EditorGui::buildMenus(%this) } // Sub menus (temporary, until MenuBuilder gets updated) - // The speed increments located here are overwritten in EditorCameraSpeedMenu::setupDefaultState. - // The new min/max for the editor camera speed range can be set in each level's levelInfo object. - %this.cameraSpeedMenu = new PopupMenu(EditorCameraSpeedOptions) + // The speed increments located here are overwritten in EditorCameraSpeedMenu::setupDefaultState. + // The new min/max for the editor camera speed range can be set in each level's levelInfo object. + if(!isObject(EditorCameraSpeedOptions)) { - superClass = "MenuBuilder"; - class = "EditorCameraSpeedMenu"; - - item[0] = "Slowest" TAB %cmdCtrl @ "-Shift 1" TAB "5"; - item[1] = "Slow" TAB %cmdCtrl @ "-Shift 2" TAB "35"; - item[2] = "Slower" TAB %cmdCtrl @ "-Shift 3" TAB "70"; - item[3] = "Normal" TAB %cmdCtrl @ "-Shift 4" TAB "100"; - item[4] = "Faster" TAB %cmdCtrl @ "-Shift 5" TAB "130"; - item[5] = "Fast" TAB %cmdCtrl @ "-Shift 6" TAB "165"; - item[6] = "Fastest" TAB %cmdCtrl @ "-Shift 7" TAB "200"; - }; - %this.freeCameraTypeMenu = new PopupMenu(EditorFreeCameraTypeOptions) + %this.cameraSpeedMenu = new PopupMenu(EditorCameraSpeedOptions) + { + superClass = "MenuBuilder"; + class = "EditorCameraSpeedMenu"; + + item[0] = "Slowest" TAB %cmdCtrl @ "-Shift 1" TAB "5"; + item[1] = "Slow" TAB %cmdCtrl @ "-Shift 2" TAB "35"; + item[2] = "Slower" TAB %cmdCtrl @ "-Shift 3" TAB "70"; + item[3] = "Normal" TAB %cmdCtrl @ "-Shift 4" TAB "100"; + item[4] = "Faster" TAB %cmdCtrl @ "-Shift 5" TAB "130"; + item[5] = "Fast" TAB %cmdCtrl @ "-Shift 6" TAB "165"; + item[6] = "Fastest" TAB %cmdCtrl @ "-Shift 7" TAB "200"; + }; + } + if(!isObject(EditorFreeCameraTypeOptions)) { - superClass = "MenuBuilder"; - class = "EditorFreeCameraTypeMenu"; - - item[0] = "Standard" TAB "Ctrl 1" TAB "EditorGuiStatusBar.setCamera(\"Standard Camera\");"; - item[1] = "Orbit Camera" TAB "Ctrl 2" TAB "EditorGuiStatusBar.setCamera(\"Orbit Camera\");"; - Item[2] = "-"; - item[3] = "Smoothed" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Camera\");"; - item[4] = "Smoothed Rotate" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Rot Camera\");"; - }; - %this.playerCameraTypeMenu = new PopupMenu(EditorPlayerCameraTypeOptions) + %this.freeCameraTypeMenu = new PopupMenu(EditorFreeCameraTypeOptions) + { + superClass = "MenuBuilder"; + class = "EditorFreeCameraTypeMenu"; + + item[0] = "Standard" TAB "Ctrl 1" TAB "EditorGuiStatusBar.setCamera(\"Standard Camera\");"; + item[1] = "Orbit Camera" TAB "Ctrl 2" TAB "EditorGuiStatusBar.setCamera(\"Orbit Camera\");"; + Item[2] = "-"; + item[3] = "Smoothed" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Camera\");"; + item[4] = "Smoothed Rotate" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Rot Camera\");"; + }; + } + if(!isObject(EditorPlayerCameraTypeOptions)) { - superClass = "MenuBuilder"; - class = "EditorPlayerCameraTypeMenu"; - - Item[0] = "First Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"1st Person Camera\");"; - Item[1] = "Third Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"3rd Person Camera\");"; - }; - %this.cameraBookmarksMenu = new PopupMenu(EditorCameraBookmarks) + %this.playerCameraTypeMenu = new PopupMenu(EditorPlayerCameraTypeOptions) + { + superClass = "MenuBuilder"; + class = "EditorPlayerCameraTypeMenu"; + + Item[0] = "First Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"1st Person Camera\");"; + Item[1] = "Third Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"3rd Person Camera\");"; + }; + } + if(!isObject(EditorCameraBookmarks)) { - superClass = "MenuBuilder"; - class = "EditorCameraBookmarksMenu"; - - //item[0] = "None"; - }; + %this.cameraBookmarksMenu = new PopupMenu(EditorCameraBookmarks) + { + superClass = "MenuBuilder"; + class = "EditorCameraBookmarksMenu"; + + //item[0] = "None"; + }; + } %this.viewTypeMenu = new PopupMenu() { superClass = "MenuBuilder"; @@ -98,7 +110,7 @@ function EditorGui::buildMenus(%this) }; // Menu bar - %this.menuBar = new MenuBar() + %this.menuBar = new MenuBar(WorldEditorMenubar) { dynamicItemInsertPos = 3; }; diff --git a/Templates/Full/game/art/gui/mainMenuGui.gui b/Templates/Full/game/art/gui/mainMenuGui.gui index bde78491f..895f48200 100644 --- a/Templates/Full/game/art/gui/mainMenuGui.gui +++ b/Templates/Full/game/art/gui/mainMenuGui.gui @@ -126,7 +126,7 @@ profile = "GuiMenuButtonProfile"; visible = "1"; active = "1"; - command = "GuiEdit();"; + command = "toggleGuiEditor(1);"; tooltipProfile = "GuiToolTipProfile"; tooltip = "The GUI Editor is accessible in-game by pressing F10"; hovertime = "1000"; diff --git a/Templates/Full/game/tools/base/utils/inspector.ed.cs b/Templates/Full/game/tools/base/utils/inspector.ed.cs index 9df8c7e98..f7c27ecf0 100644 --- a/Templates/Full/game/tools/base/utils/inspector.ed.cs +++ b/Templates/Full/game/tools/base/utils/inspector.ed.cs @@ -105,7 +105,7 @@ function EditorInspectorBase::onAdd( %this ) superClass = "MenuBuilder"; isPopup = true; - item[ 0 ] = "Edit Profile" TAB "" TAB "if( !$InGuiEditor ) toggleGuiEditor( true ); GuiEditor.editProfile( %this.inspectorField.getData() );"; + item[ 0 ] = "Edit Profile" TAB "" TAB "if( !GuiEditorIsActive() ) toggleGuiEditor( true ); GuiEditor.editProfile( %this.inspectorField.getData() );"; item[ 1 ] = "Jump to Definition in Torsion" TAB "" TAB "EditorOpenDeclarationInTorsion( %this.inspectorField.getData() );"; item[ 2 ] = "Inspect Object" TAB "" TAB "inspectObject( %this.inspectorField.getData() );"; item[ 3 ] = "-"; diff --git a/Templates/Full/game/tools/guiEditor/gui/guiEditor.ed.gui b/Templates/Full/game/tools/guiEditor/gui/guiEditor.ed.gui index e387f1bc0..cc03cbd07 100644 --- a/Templates/Full/game/tools/guiEditor/gui/guiEditor.ed.gui +++ b/Templates/Full/game/tools/guiEditor/gui/guiEditor.ed.gui @@ -86,7 +86,7 @@ minExtent = "8 8"; canSave = "1"; visible = "1"; - command = "GuiEditor.switchToWorldEditor();"; + command = "toggleEditor(1);"; tooltipProfile = "ToolsGuiToolTipProfile"; ToolTip = "World Editor"; hovertime = "1000"; diff --git a/Templates/Full/game/tools/guiEditor/scripts/guiEditor.ed.cs b/Templates/Full/game/tools/guiEditor/scripts/guiEditor.ed.cs index eace7d43b..61dc8c5e7 100644 --- a/Templates/Full/game/tools/guiEditor/scripts/guiEditor.ed.cs +++ b/Templates/Full/game/tools/guiEditor/scripts/guiEditor.ed.cs @@ -75,11 +75,26 @@ function toggleGuiEditor( %make ) if( EditorIsActive() && !GuiEditor.toggleIntoEditorGui ) toggleEditor( true ); - GuiEdit(); + if( !isObject( GuiEditCanvas ) ) + new GuiControl( GuiEditCanvas, EditorGuiGroup ); - // Cancel the scheduled event to prevent - // the level from cycling after it's duration - // has elapsed. + if( GuiEditorIsActive() ) + { + GuiEditor.close(); + } + else + { + GuiEditor.open(); + + // Cancel the scheduled event to prevent + // the level from cycling after it's duration + // has elapsed. + cancel($Game::Schedule); + } + + // Cancel the scheduled event to prevent + // the level from cycling after it's duration + // has elapsed. cancel($Game::Schedule); } } @@ -98,6 +113,26 @@ package GuiEditor_BlockDialogs //--------------------------------------------------------------------------------------------- +function GuiEditor::open(%this) +{ + GuiEditCanvas.onCreateMenu(); + + GuiEditContent(Canvas.getContent()); +} + +function GuiEditor::close(%this) +{ + // prevent the mission editor from opening while the GuiEditor is open. + if(Canvas.getContent() != GuiEditorGui.getId()) + return; + + GuiGroup.add(GuiEditorGui); + + Canvas.setContent(GuiEditor.lastContent); + + GuiEditCanvas.onDestroyMenu(); +} + function GuiEditor::openForEditing( %this, %content ) { Canvas.setContent( GuiEditorGui ); diff --git a/Templates/Full/game/tools/worldEditor/gui/EditorGui.ed.gui b/Templates/Full/game/tools/worldEditor/gui/EditorGui.ed.gui index 445bacf63..3eb8558e4 100644 --- a/Templates/Full/game/tools/worldEditor/gui/EditorGui.ed.gui +++ b/Templates/Full/game/tools/worldEditor/gui/EditorGui.ed.gui @@ -67,7 +67,7 @@ MinExtent = "8 8"; canSave = "1"; Visible = "1"; - Command = "toggleEditor( true ); GuiEdit(); $GuiEditorBtnPressed = true;"; + Command = "toggleGuiEditor(true); $GuiEditorBtnPressed = true;"; tooltipprofile = "ToolsGuiToolTipProfile"; ToolTip = "Open the GuiEditor"; hovertime = "1000"; diff --git a/Templates/Full/game/tools/worldEditor/scripts/EditorGui.ed.cs b/Templates/Full/game/tools/worldEditor/scripts/EditorGui.ed.cs index 38a180e64..31f794d17 100644 --- a/Templates/Full/game/tools/worldEditor/scripts/EditorGui.ed.cs +++ b/Templates/Full/game/tools/worldEditor/scripts/EditorGui.ed.cs @@ -35,8 +35,6 @@ function EditorGui::init(%this) $NextOperationId = 1; $HeightfieldDirtyRow = -1; - %this.buildMenus(); - if( !isObject( %this-->ToolsPaletteWindow ) ) { // Load Creator/Inspector GUI @@ -1914,6 +1912,8 @@ function Editor::open(%this) if(Canvas.getContent() == GuiEditorGui.getId()) return; + EditorGui.buildMenus(); + if( !EditorGui.isInitialized ) EditorGui.init(); @@ -1929,6 +1929,21 @@ function Editor::close(%this, %gui) if(isObject(MessageHud)) MessageHud.close(); EditorGui.writeCameraSettings(); + + EditorGui.onDestroyMenu(); +} + +function EditorGui::onDestroyMenu(%this) +{ + if( !isObject( %this.menuBar ) ) + return; + + // Destroy menus + while( %this.menuBar.getCount() != 0 ) + %this.menuBar.getObject( 0 ).delete(); + + %this.menuBar.removeFromCanvas(); + %this.menuBar.delete(); } $RelightCallback = ""; diff --git a/Templates/Full/game/tools/worldEditor/scripts/editor.ed.cs b/Templates/Full/game/tools/worldEditor/scripts/editor.ed.cs index 74b34e0a9..8545c9d67 100644 --- a/Templates/Full/game/tools/worldEditor/scripts/editor.ed.cs +++ b/Templates/Full/game/tools/worldEditor/scripts/editor.ed.cs @@ -99,18 +99,12 @@ function Editor::checkActiveLoadDone() //------------------------------------------------------------------------------ function toggleEditor(%make) { - if (Canvas.isFullscreen()) - { - MessageBoxOK("Windowed Mode Required", "Please switch to windowed mode to access the Mission Editor."); - return; - } - if (%make) - { + { %timerId = startPrecisionTimer(); - if( $InGuiEditor ) - GuiEdit(); + if( GuiEditorIsActive() ) + toggleGuiEditor(1); if( !$missionRunning ) { @@ -141,29 +135,21 @@ function toggleEditor(%make) Editor.close("PlayGui"); } } - else + else { - if ( !$GuiEditorBtnPressed ) - { - canvas.pushDialog( EditorLoadingGui ); - canvas.repaint(); - } - else - { - $GuiEditorBtnPressed = false; - } + canvas.pushDialog( EditorLoadingGui ); + canvas.repaint(); Editor.open(); - // Cancel the scheduled event to prevent - // the level from cycling after it's duration - // has elapsed. + // Cancel the scheduled event to prevent + // the level from cycling after it's duration + // has elapsed. cancel($Game::Schedule); if (theLevelInfo.type $= "DemoScene") commandToServer('dropCameraAtPlayer', true); - canvas.popDialog(EditorLoadingGui); } diff --git a/Templates/Full/game/tools/worldEditor/scripts/menus.ed.cs b/Templates/Full/game/tools/worldEditor/scripts/menus.ed.cs index b6c4200d4..be068b9ed 100644 --- a/Templates/Full/game/tools/worldEditor/scripts/menus.ed.cs +++ b/Templates/Full/game/tools/worldEditor/scripts/menus.ed.cs @@ -42,47 +42,59 @@ function EditorGui::buildMenus(%this) } // Sub menus (temporary, until MenuBuilder gets updated) - // The speed increments located here are overwritten in EditorCameraSpeedMenu::setupDefaultState. - // The new min/max for the editor camera speed range can be set in each level's levelInfo object. - %this.cameraSpeedMenu = new PopupMenu(EditorCameraSpeedOptions) + // The speed increments located here are overwritten in EditorCameraSpeedMenu::setupDefaultState. + // The new min/max for the editor camera speed range can be set in each level's levelInfo object. + if(!isObject(EditorCameraSpeedOptions)) { - superClass = "MenuBuilder"; - class = "EditorCameraSpeedMenu"; - - item[0] = "Slowest" TAB %cmdCtrl @ "-Shift 1" TAB "5"; - item[1] = "Slow" TAB %cmdCtrl @ "-Shift 2" TAB "35"; - item[2] = "Slower" TAB %cmdCtrl @ "-Shift 3" TAB "70"; - item[3] = "Normal" TAB %cmdCtrl @ "-Shift 4" TAB "100"; - item[4] = "Faster" TAB %cmdCtrl @ "-Shift 5" TAB "130"; - item[5] = "Fast" TAB %cmdCtrl @ "-Shift 6" TAB "165"; - item[6] = "Fastest" TAB %cmdCtrl @ "-Shift 7" TAB "200"; - }; - %this.freeCameraTypeMenu = new PopupMenu(EditorFreeCameraTypeOptions) + %this.cameraSpeedMenu = new PopupMenu(EditorCameraSpeedOptions) + { + superClass = "MenuBuilder"; + class = "EditorCameraSpeedMenu"; + + item[0] = "Slowest" TAB %cmdCtrl @ "-Shift 1" TAB "5"; + item[1] = "Slow" TAB %cmdCtrl @ "-Shift 2" TAB "35"; + item[2] = "Slower" TAB %cmdCtrl @ "-Shift 3" TAB "70"; + item[3] = "Normal" TAB %cmdCtrl @ "-Shift 4" TAB "100"; + item[4] = "Faster" TAB %cmdCtrl @ "-Shift 5" TAB "130"; + item[5] = "Fast" TAB %cmdCtrl @ "-Shift 6" TAB "165"; + item[6] = "Fastest" TAB %cmdCtrl @ "-Shift 7" TAB "200"; + }; + } + if(!isObject(EditorFreeCameraTypeOptions)) { - superClass = "MenuBuilder"; - class = "EditorFreeCameraTypeMenu"; - - item[0] = "Standard" TAB "Ctrl 1" TAB "EditorGuiStatusBar.setCamera(\"Standard Camera\");"; - item[1] = "Orbit Camera" TAB "Ctrl 2" TAB "EditorGuiStatusBar.setCamera(\"Orbit Camera\");"; - Item[2] = "-"; - item[3] = "Smoothed" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Camera\");"; - item[4] = "Smoothed Rotate" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Rot Camera\");"; - }; - %this.playerCameraTypeMenu = new PopupMenu(EditorPlayerCameraTypeOptions) + %this.freeCameraTypeMenu = new PopupMenu(EditorFreeCameraTypeOptions) + { + superClass = "MenuBuilder"; + class = "EditorFreeCameraTypeMenu"; + + item[0] = "Standard" TAB "Ctrl 1" TAB "EditorGuiStatusBar.setCamera(\"Standard Camera\");"; + item[1] = "Orbit Camera" TAB "Ctrl 2" TAB "EditorGuiStatusBar.setCamera(\"Orbit Camera\");"; + Item[2] = "-"; + item[3] = "Smoothed" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Camera\");"; + item[4] = "Smoothed Rotate" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Rot Camera\");"; + }; + } + if(!isObject(EditorPlayerCameraTypeOptions)) { - superClass = "MenuBuilder"; - class = "EditorPlayerCameraTypeMenu"; - - Item[0] = "First Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"1st Person Camera\");"; - Item[1] = "Third Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"3rd Person Camera\");"; - }; - %this.cameraBookmarksMenu = new PopupMenu(EditorCameraBookmarks) + %this.playerCameraTypeMenu = new PopupMenu(EditorPlayerCameraTypeOptions) + { + superClass = "MenuBuilder"; + class = "EditorPlayerCameraTypeMenu"; + + Item[0] = "First Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"1st Person Camera\");"; + Item[1] = "Third Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"3rd Person Camera\");"; + }; + } + if(!isObject(EditorCameraBookmarks)) { - superClass = "MenuBuilder"; - class = "EditorCameraBookmarksMenu"; - - //item[0] = "None"; - }; + %this.cameraBookmarksMenu = new PopupMenu(EditorCameraBookmarks) + { + superClass = "MenuBuilder"; + class = "EditorCameraBookmarksMenu"; + + //item[0] = "None"; + }; + } %this.viewTypeMenu = new PopupMenu() { superClass = "MenuBuilder"; @@ -98,7 +110,7 @@ function EditorGui::buildMenus(%this) }; // Menu bar - %this.menuBar = new MenuBar() + %this.menuBar = new MenuBar(WorldEditorMenubar) { dynamicItemInsertPos = 3; }; From 80a2a8c29abb25bb694972d4e090cf97db4f934c Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 23 Jan 2017 18:52:30 -0600 Subject: [PATCH 18/26] Fixed the fadeout coloration when using textures, as well as some cleanup for the code. --- Engine/source/T3D/fx/lightning.cpp | 55 ++++++++++++++++-------------- Engine/source/T3D/fx/lightning.h | 1 + 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index ed941a82b..080bbed82 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -200,7 +200,7 @@ void LightningStrikeEvent::unpack(NetConnection* con, BitStream* stream) { if(!stream->readFlag()) return; - S32 mClientId = stream->readRangedU32(0, NetConnection::MaxGhostCount); + mClientId = stream->readRangedU32(0, NetConnection::MaxGhostCount); mLightning = NULL; NetObject* pObject = con->resolveGhost(mClientId); if (pObject) @@ -214,10 +214,10 @@ void LightningStrikeEvent::unpack(NetConnection* con, BitStream* stream) // target id S32 mTargetID = stream->readRangedU32(0, NetConnection::MaxGhostCount); - NetObject* pObject = con->resolveGhost(mTargetID); - if( pObject != NULL ) + NetObject* tObject = con->resolveGhost(mTargetID); + if(tObject != NULL ) { - mTarget = dynamic_cast(pObject); + mTarget = dynamic_cast(tObject); } if( bool(mTarget) == false ) { @@ -325,7 +325,8 @@ void LightningData::packData(BitStream* stream) stream->writeInt(mNumStrikeTextures, 4); - for (i = 0; i < MaxTextures; i++) { + for (i = 0; i < MaxTextures; i++) + { stream->writeString(strikeTextureNames[i]); } @@ -342,7 +343,8 @@ void LightningData::unpackData(BitStream* stream) mNumStrikeTextures = stream->readInt(4); - for (i = 0; i < MaxTextures; i++) { + for (i = 0; i < MaxTextures; i++) + { strikeTextureNames[i] = stream->readSTString(); } @@ -379,16 +381,16 @@ Lightning::~Lightning() { while( mThunderListHead ) { - Thunder* next = mThunderListHead->next; + Thunder* nextThunder = mThunderListHead->next; delete mThunderListHead; - mThunderListHead = next; + mThunderListHead = nextThunder; } while( mStrikeListHead ) { - Strike* next = mStrikeListHead->next; + Strike* nextStrike = mStrikeListHead->next; delete mStrikeListHead; - mStrikeListHead = next; + mStrikeListHead = nextStrike; } } @@ -489,6 +491,7 @@ void Lightning::renderObject(ObjectRenderInst *ri, SceneRenderState *state, Base desc.setBlend( true, GFXBlendSrcAlpha, GFXBlendOne); desc.setCullMode(GFXCullNone); desc.zWriteEnable = false; + desc.vertexColorEnable = true; if (mDataBlock->mNumStrikeTextures != 0) { @@ -518,7 +521,7 @@ void Lightning::renderObject(ObjectRenderInst *ri, SceneRenderState *state, Base GFX->setTexture(0, mDataBlock->strikeTextures[0]); } - for( U32 i=0; i<3; i++ ) + for( U32 i=0; ibolt[i].isFading ) { @@ -611,7 +614,7 @@ void Lightning::advanceTime(F32 dt) while (*pWalker != NULL) { Strike* pStrike = *pWalker; - for( U32 i=0; i<3; i++ ) + for( U32 i=0; ibolt[i].update( dt ); } @@ -695,7 +698,7 @@ void Lightning::processEvent(LightningStrikeEvent* pEvent) pStrike->currentAge = 0.0f; pStrike->next = mStrikeListHead; - for( U32 i=0; i<3; i++ ) + for( U32 i=0; iwrite(color.red); stream->write(color.green); stream->write(color.blue); + stream->write(color.alpha); stream->write(fadeColor.red); stream->write(fadeColor.green); stream->write(fadeColor.blue); @@ -918,6 +922,7 @@ void Lightning::unpackUpdate(NetConnection* con, BitStream* stream) stream->read(&color.red); stream->read(&color.green); stream->read(&color.blue); + stream->read(&color.alpha); stream->read(&fadeColor.red); stream->read(&fadeColor.green); stream->read(&fadeColor.blue); @@ -953,7 +958,7 @@ DefineEngineMethod(Lightning, strikeRandomPoint, void, (),, object->strikeRandomPoint(); } -DefineEngineMethod(Lightning, strikeObject, void, (ShapeBase* pSB),, +DefineEngineMethod(Lightning, strikeObject, void, (ShapeBase* pSB), (nullAsType()), "Creates a LightningStrikeEvent which strikes a specific object.\n" "@note This method is currently unimplemented.\n" ) { @@ -1177,7 +1182,7 @@ void LightningBolt::generateMinorNodes() //---------------------------------------------------------------------------- // Recursive algo to create bolts that split off from main bolt //---------------------------------------------------------------------------- -void LightningBolt::createSplit( const Point3F &startPoint, const Point3F &endPoint, U32 depth, F32 width ) +void LightningBolt::createSplit( const Point3F &startingPoint, const Point3F &endingPoint, U32 depth, F32 splitWidth ) { if( depth == 0 ) return; @@ -1186,17 +1191,17 @@ void LightningBolt::createSplit( const Point3F &startPoint, const Point3F &endPo if( chanceToEnd > 0.70f ) return; - if( width < 0.75f ) - width = 0.75f; + if(splitWidth < 0.75f ) + splitWidth = 0.75f; - VectorF diff = endPoint - startPoint; + VectorF diff = endingPoint - startingPoint; F32 length = diff.len(); diff.normalizeSafe(); LightningBolt newBolt; - newBolt.startPoint = startPoint; - newBolt.endPoint = endPoint; - newBolt.width = width; + newBolt.startPoint = startingPoint; + newBolt.endPoint = endingPoint; + newBolt.width = splitWidth; newBolt.numMajorNodes = 3; newBolt.maxMajorAngle = 30.0f; newBolt.numMinorNodes = 3; @@ -1207,13 +1212,13 @@ void LightningBolt::createSplit( const Point3F &startPoint, const Point3F &endPo splitList.pushBack( newBolt ); VectorF newDir1 = MathUtils::randomDir( diff, 10.0f, 45.0f ); - Point3F newEndPoint1 = endPoint + newDir1 * gRandGen.randF( 0.5f, 1.5f ) * length; + Point3F newEndPoint1 = endingPoint + newDir1 * gRandGen.randF( 0.5f, 1.5f ) * length; VectorF newDir2 = MathUtils::randomDir( diff, 10.0f, 45.0f ); - Point3F newEndPoint2 = endPoint + newDir2 * gRandGen.randF( 0.5f, 1.5f ) * length; + Point3F newEndPoint2 = endingPoint + newDir2 * gRandGen.randF( 0.5f, 1.5f ) * length; - createSplit( endPoint, newEndPoint1, depth - 1, width * 0.30f ); - createSplit( endPoint, newEndPoint2, depth - 1, width * 0.30f ); + createSplit(endingPoint, newEndPoint1, depth - 1, splitWidth * 0.30f ); + createSplit(endingPoint, newEndPoint2, depth - 1, splitWidth * 0.30f ); } diff --git a/Engine/source/T3D/fx/lightning.h b/Engine/source/T3D/fx/lightning.h index 71ff493d1..340d4e067 100644 --- a/Engine/source/T3D/fx/lightning.h +++ b/Engine/source/T3D/fx/lightning.h @@ -47,6 +47,7 @@ class ShapeBase; class LightningStrikeEvent; class SFXTrack; +#define MAX_LIGHTNING 3 // ------------------------------------------------------------------------- class LightningData : public GameBaseData From a8f2fc567beeedb365712857745250a07c5038d6 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sun, 29 Jan 2017 03:22:25 -0600 Subject: [PATCH 19/26] Fixes up the handling of accelerator keybinds for SDL - specifically compound ones with several modifier keys, ie ctrl-alt-shift-up. --- Engine/source/platform/input/event.h | 2 +- Engine/source/windowManager/sdl/sdlWindow.cpp | 42 +++++++++++++------ .../windowManager/windowInputGenerator.cpp | 12 +++--- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/Engine/source/platform/input/event.h b/Engine/source/platform/input/event.h index b77caa202..1c6d1f1dc 100644 --- a/Engine/source/platform/input/event.h +++ b/Engine/source/platform/input/event.h @@ -429,7 +429,7 @@ struct InputEventInfo U16 ascii; /// Modifiers to action: SI_LSHIFT, SI_LCTRL, etc. - InputModifiers modifier; + U32 modifier; inline void postToSignal(InputEvent &ie) { diff --git a/Engine/source/windowManager/sdl/sdlWindow.cpp b/Engine/source/windowManager/sdl/sdlWindow.cpp index 510834fca..3c819248b 100644 --- a/Engine/source/windowManager/sdl/sdlWindow.cpp +++ b/Engine/source/windowManager/sdl/sdlWindow.cpp @@ -51,23 +51,41 @@ namespace { U32 ret = 0; - if(mod & KMOD_LSHIFT) - ret |= IM_LSHIFT; + if (mod & KMOD_LSHIFT) + { + ret |= SI_LSHIFT; + ret |= SI_SHIFT; + } - if(mod & KMOD_RSHIFT) - ret |= IM_RSHIFT; + if (mod & KMOD_RSHIFT) + { + ret |= SI_RSHIFT; + ret |= SI_SHIFT; + } - if(mod & KMOD_LCTRL) - ret |= IM_LCTRL; + if (mod & KMOD_LCTRL) + { + ret |= SI_LCTRL; + ret |= SI_CTRL; + } - if(mod & KMOD_RCTRL) - ret |= IM_RCTRL; + if (mod & KMOD_RCTRL) + { + ret |= SI_RCTRL; + ret |= SI_CTRL; + } - if(mod & KMOD_LALT) - ret |= IM_LALT; + if (mod & KMOD_LALT) + { + ret |= SI_LALT; + ret |= SI_ALT; + } - if(mod & KMOD_RALT) - ret |= IM_RALT; + if (mod & KMOD_RALT) + { + ret |= SI_RALT; + ret |= SI_ALT; + } return ret; } diff --git a/Engine/source/windowManager/windowInputGenerator.cpp b/Engine/source/windowManager/windowInputGenerator.cpp index c31bad1ba..907f1be77 100644 --- a/Engine/source/windowManager/windowInputGenerator.cpp +++ b/Engine/source/windowManager/windowInputGenerator.cpp @@ -95,7 +95,7 @@ void WindowInputGenerator::generateInputEvent( InputEventInfo &inputEvent ) { const AccKeyMap &acc = mAcceleratorMap[i]; if (!mWindow->getKeyboardTranslation() && - (acc.modifier & inputEvent.modifier || (acc.modifier == 0 && inputEvent.modifier == 0)) + ((acc.modifier == inputEvent.modifier && acc.modifier != 0) || (acc.modifier == 0 && inputEvent.modifier == 0)) && acc.keyCode == inputEvent.objInst) { Con::evaluatef(acc.cmd); @@ -145,7 +145,7 @@ void WindowInputGenerator::handleMouseMove( WindowId did, U32 modifier, S32 x, S event.deviceType = MouseDeviceType; event.deviceInst = 0; event.objType = SI_AXIS; - event.modifier = convertModifierBits(modifier); + event.modifier = modifier; event.ascii = 0; // Generate delta movement along each axis @@ -231,7 +231,7 @@ void WindowInputGenerator::handleMouseButton( WindowId did, U32 modifiers, U32 a event.deviceInst = 0; event.objType = SI_BUTTON; event.objInst = (InputObjectInstances)(KEY_BUTTON0 + button); - event.modifier = convertModifierBits(modifiers); + event.modifier = modifiers; event.ascii = 0; event.action = (action==IA_MAKE) ? SI_MAKE : SI_BREAK; event.fValue = (action==IA_MAKE) ? 1.0 : 0.0; @@ -248,7 +248,7 @@ void WindowInputGenerator::handleMouseWheel( WindowId did, U32 modifiers, S32 wh event.deviceType = MouseDeviceType; event.deviceInst = 0; event.objType = SI_AXIS; - event.modifier = convertModifierBits(modifiers); + event.modifier = modifiers; event.ascii = 0; event.action = SI_MOVE; @@ -281,7 +281,7 @@ void WindowInputGenerator::handleCharInput( WindowId did, U32 modifier, U16 key event.deviceInst = 0; event.objType = SI_KEY; event.objInst = KEY_NULL; - event.modifier = convertModifierBits(modifier); + event.modifier = modifier; event.ascii = key; event.action = SI_MAKE; event.fValue = 1.0; @@ -303,7 +303,7 @@ void WindowInputGenerator::handleKeyboard( WindowId did, U32 modifier, U32 actio event.deviceInst = 0; event.objType = SI_KEY; event.objInst = (InputObjectInstances)key; - event.modifier = convertModifierBits(modifier); + event.modifier = modifier; event.ascii = 0; switch(action) From 48bd911dcbc94804286acd23c7ca2178a832a3f6 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sun, 29 Jan 2017 04:12:32 -0600 Subject: [PATCH 20/26] Made sure the old code was still there for non-SDL usage. --- .../windowManager/windowInputGenerator.cpp | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Engine/source/windowManager/windowInputGenerator.cpp b/Engine/source/windowManager/windowInputGenerator.cpp index 907f1be77..6c9e45b71 100644 --- a/Engine/source/windowManager/windowInputGenerator.cpp +++ b/Engine/source/windowManager/windowInputGenerator.cpp @@ -145,7 +145,11 @@ void WindowInputGenerator::handleMouseMove( WindowId did, U32 modifier, S32 x, S event.deviceType = MouseDeviceType; event.deviceInst = 0; event.objType = SI_AXIS; - event.modifier = modifier; +#ifdef TORQUE_SDL + event.modifier = modifier; +#else + event.modifier = convertModifierBits(modifier); +#endif event.ascii = 0; // Generate delta movement along each axis @@ -231,7 +235,11 @@ void WindowInputGenerator::handleMouseButton( WindowId did, U32 modifiers, U32 a event.deviceInst = 0; event.objType = SI_BUTTON; event.objInst = (InputObjectInstances)(KEY_BUTTON0 + button); - event.modifier = modifiers; +#ifdef TORQUE_SDL + event.modifier = modifiers; +#else + event.modifier = convertModifierBits(modifiers); +#endif event.ascii = 0; event.action = (action==IA_MAKE) ? SI_MAKE : SI_BREAK; event.fValue = (action==IA_MAKE) ? 1.0 : 0.0; @@ -248,7 +256,11 @@ void WindowInputGenerator::handleMouseWheel( WindowId did, U32 modifiers, S32 wh event.deviceType = MouseDeviceType; event.deviceInst = 0; event.objType = SI_AXIS; - event.modifier = modifiers; +#ifdef TORQUE_SDL + event.modifier = modifiers; +#else + event.modifier = convertModifierBits(modifiers); +#endif event.ascii = 0; event.action = SI_MOVE; @@ -281,7 +293,11 @@ void WindowInputGenerator::handleCharInput( WindowId did, U32 modifier, U16 key event.deviceInst = 0; event.objType = SI_KEY; event.objInst = KEY_NULL; - event.modifier = modifier; +#ifdef TORQUE_SDL + event.modifier = modifier; +#else + event.modifier = convertModifierBits(modifier); +#endif event.ascii = key; event.action = SI_MAKE; event.fValue = 1.0; @@ -303,7 +319,11 @@ void WindowInputGenerator::handleKeyboard( WindowId did, U32 modifier, U32 actio event.deviceInst = 0; event.objType = SI_KEY; event.objInst = (InputObjectInstances)key; +#ifdef TORQUE_SDL event.modifier = modifier; +#else + event.modifier = convertModifierBits(modifier); +#endif event.ascii = 0; switch(action) From 501b55d9399e3a383a6dd486933be612720f923b Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 30 Jan 2017 20:36:48 -0600 Subject: [PATCH 21/26] Adds a check to the record movie call so that it only happens in Release mode, to avoid crash issues with theora and debug mode. --- Engine/source/gfx/video/videoCapture.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Engine/source/gfx/video/videoCapture.cpp b/Engine/source/gfx/video/videoCapture.cpp index 8f7b7e52e..a966bbe01 100644 --- a/Engine/source/gfx/video/videoCapture.cpp +++ b/Engine/source/gfx/video/videoCapture.cpp @@ -314,6 +314,9 @@ DefineEngineFunction( startVideoCapture, void, "@see stopVideoCapture\n" "@ingroup Rendering\n" ) { +#ifdef TORQUE_DEBUG + Con::errorf("Recording video is disabled in debug!"); +#else if ( !canvas ) { Con::errorf("startVideoCapture -Please specify a GuiCanvas object to record from!"); @@ -328,6 +331,7 @@ DefineEngineFunction( startVideoCapture, void, VIDCAP->setResolution(resolution); VIDCAP->begin(canvas); +#endif } DefineEngineFunction( stopVideoCapture, void, (),, From 381169c3c221bbbbd27ae47cb8f1f083e7be56a0 Mon Sep 17 00:00:00 2001 From: Johxz Date: Tue, 31 Jan 2017 15:25:50 -0600 Subject: [PATCH 22/26] fix warningFlashes() of lighting --- Engine/source/T3D/fx/lightning.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 080bbed82..4885a656c 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -734,6 +734,7 @@ void Lightning::warningFlashes() { AssertFatal(isServerObject(), "Error, client objects may not initiate lightning!"); + Point3F strikePoint( gRandGen.randF( 0.0f, 1.0f ), gRandGen.randF( 0.0f, 1.0f ), 0.0f ); SimGroup* pClientGroup = Sim::getClientGroup(); for (SimGroup::iterator itr = pClientGroup->begin(); itr != pClientGroup->end(); itr++) { @@ -742,6 +743,9 @@ void Lightning::warningFlashes() { LightningStrikeEvent* pEvent = new LightningStrikeEvent; pEvent->mLightning = this; + + pEvent->mStart.x = strikePoint.x; + pEvent->mStart.y = strikePoint.y; nc->postNetEvent(pEvent); } From 3cd82d9229a7f2d3dd2094ea613077daed709b2d Mon Sep 17 00:00:00 2001 From: Johxz Date: Tue, 31 Jan 2017 18:38:09 -0600 Subject: [PATCH 23/26] add strikeObject functionality feature --- Engine/source/T3D/fx/lightning.cpp | 40 ++++++++++++++++++++++++++++-- Engine/source/T3D/fx/lightning.h | 2 +- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 080bbed82..385068ddf 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -863,11 +863,47 @@ void Lightning::strikeRandomPoint() } //-------------------------------------------------------------------------- -void Lightning::strikeObject(ShapeBase*) +void Lightning::strikeObject(ShapeBase* targetObj) { AssertFatal(isServerObject(), "Error, client objects may not initiate lightning!"); - AssertFatal(false, "Lightning::strikeObject is not implemented."); + Point3F strikePoint = targetObj->getPosition(); + Point3F objectCenter; + + targetObj->getObjBox().getCenter(&objectCenter); + objectCenter.convolve(targetObj->getScale()); + targetObj->getTransform().mulP(objectCenter); + + bool playerInWarmup = false; + Player *playerObj = dynamic_cast< Player * >(targetObj); + if (playerObj) + { + if (!playerObj->getControllingClient()) + { + playerInWarmup = true; + } + } + + if (!playerInWarmup) + { + applyDamage_callback(objectCenter, VectorF(0.0, 0.0, 1.0), targetObj); + } + + SimGroup* pClientGroup = Sim::getClientGroup(); + for (SimGroup::iterator itr = pClientGroup->begin(); itr != pClientGroup->end(); itr++) { + NetConnection* nc = static_cast(*itr); + if (nc != NULL) + { + LightningStrikeEvent* pEvent = new LightningStrikeEvent; + pEvent->mLightning = this; + + pEvent->mStart.x = strikePoint.x; + pEvent->mStart.y = strikePoint.y; + pEvent->mTarget = targetObj; + + nc->postNetEvent(pEvent); + } + } } diff --git a/Engine/source/T3D/fx/lightning.h b/Engine/source/T3D/fx/lightning.h index 340d4e067..ed08bbd82 100644 --- a/Engine/source/T3D/fx/lightning.h +++ b/Engine/source/T3D/fx/lightning.h @@ -229,7 +229,7 @@ class Lightning : public GameBase void warningFlashes(); void strikeRandomPoint(); - void strikeObject(ShapeBase*); + void strikeObject(ShapeBase* targetObj); void processEvent(LightningStrikeEvent*); DECLARE_CONOBJECT(Lightning); From 73752ff061c63f22e50288c3d56bc1c9100f7591 Mon Sep 17 00:00:00 2001 From: Areloch Date: Tue, 31 Jan 2017 19:16:34 -0600 Subject: [PATCH 24/26] Hotfix to re-add the prior static function fix for these functions that was accidentally removed. --- Engine/source/platform/platformNet.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Engine/source/platform/platformNet.h b/Engine/source/platform/platformNet.h index 0e9610c0a..50a2c1d4c 100644 --- a/Engine/source/platform/platformNet.h +++ b/Engine/source/platform/platformNet.h @@ -214,11 +214,6 @@ struct Net static bool smMulticastEnabled; static bool smIpv4Enabled; static bool smIpv6Enabled; - - static ConnectionNotifyEvent* smConnectionNotify; - static ConnectionAcceptedEvent* smConnectionAccept; - static ConnectionReceiveEvent* smConnectionReceive; - static PacketReceiveEvent* smPacketReceive; static bool init(); static void shutdown(); From 84f610f2f23373179ed895be7cd5ca1d500129ea Mon Sep 17 00:00:00 2001 From: Johxz Date: Fri, 3 Feb 2017 18:23:34 -0600 Subject: [PATCH 25/26] fix tabs vs space, fix net strikepoints --- Engine/source/T3D/fx/lightning.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 385068ddf..e6c315796 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -870,25 +870,30 @@ void Lightning::strikeObject(ShapeBase* targetObj) Point3F strikePoint = targetObj->getPosition(); Point3F objectCenter; - targetObj->getObjBox().getCenter(&objectCenter); - objectCenter.convolve(targetObj->getScale()); - targetObj->getTransform().mulP(objectCenter); + Box3F wb = getWorldBox(); + if (!wb.isContained(strikePoint)) + return; + + Point3F targetRel = strikePoint - getPosition(); + Point3F length(wb.len_x() / 2.0f, wb.len_y() / 2.0f, wb.len_z() / 2.0f); + + Point3F strikePos = targetRel / length; bool playerInWarmup = false; Player *playerObj = dynamic_cast< Player * >(targetObj); if (playerObj) { - if (!playerObj->getControllingClient()) - { - playerInWarmup = true; - } + if (!playerObj->getControllingClient()) + { + playerInWarmup = true; + } } if (!playerInWarmup) { - applyDamage_callback(objectCenter, VectorF(0.0, 0.0, 1.0), targetObj); + applyDamage_callback(targetObj->getWorldSphere().center, VectorF(0.0, 0.0, 1.0), targetObj); } - + SimGroup* pClientGroup = Sim::getClientGroup(); for (SimGroup::iterator itr = pClientGroup->begin(); itr != pClientGroup->end(); itr++) { NetConnection* nc = static_cast(*itr); @@ -897,16 +902,15 @@ void Lightning::strikeObject(ShapeBase* targetObj) LightningStrikeEvent* pEvent = new LightningStrikeEvent; pEvent->mLightning = this; - pEvent->mStart.x = strikePoint.x; - pEvent->mStart.y = strikePoint.y; - pEvent->mTarget = targetObj; + pEvent->mStart.x = strikePoint.x; + pEvent->mStart.y = strikePoint.y; + pEvent->mTarget = targetObj; nc->postNetEvent(pEvent); } } } - //-------------------------------------------------------------------------- U32 Lightning::packUpdate(NetConnection* con, U32 mask, BitStream* stream) { From 2db03e47e98e7dc1adf1ec0240f2dcadcb8505ec Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 4 Feb 2017 22:45:49 -0600 Subject: [PATCH 26/26] Fixes a crash when you try to delete things without being in selection mode in the forest editor. Adds a sanity check that everything is properly set up before attempting the delete action. Also adds a fix to the mesh item tab in the forest editor to correct odd selection behavior that could erroneously cause selection of two items in the list when you only clicked one. --- Engine/source/forest/editor/forestSelectionTool.cpp | 3 +++ Templates/Empty/game/tools/forestEditor/forestEditorGui.gui | 2 +- Templates/Full/game/tools/forestEditor/forestEditorGui.gui | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Engine/source/forest/editor/forestSelectionTool.cpp b/Engine/source/forest/editor/forestSelectionTool.cpp index a01c6cf86..3d3e9d022 100644 --- a/Engine/source/forest/editor/forestSelectionTool.cpp +++ b/Engine/source/forest/editor/forestSelectionTool.cpp @@ -197,6 +197,9 @@ void ForestSelectionTool::_selectItem( const ForestItem &item ) void ForestSelectionTool::deleteSelection() { + if (!mEditor) + return; + ForestDeleteUndoAction *action = new ForestDeleteUndoAction( mForest->getData(), mEditor ); for ( U32 i=0; i < mSelection.size(); i++ ) diff --git a/Templates/Empty/game/tools/forestEditor/forestEditorGui.gui b/Templates/Empty/game/tools/forestEditor/forestEditorGui.gui index ca40147bf..e46a09f3d 100644 --- a/Templates/Empty/game/tools/forestEditor/forestEditorGui.gui +++ b/Templates/Empty/game/tools/forestEditor/forestEditorGui.gui @@ -252,7 +252,7 @@ objectNamesOnly = "1"; useInspectorTooltips = "0"; tooltipOnWidthOnly = "0"; - compareToObjectID = "1"; + compareToObjectID = "0"; canRenameObjects = "1"; renameInternal = "0"; isContainer = "1"; diff --git a/Templates/Full/game/tools/forestEditor/forestEditorGui.gui b/Templates/Full/game/tools/forestEditor/forestEditorGui.gui index ca40147bf..e46a09f3d 100644 --- a/Templates/Full/game/tools/forestEditor/forestEditorGui.gui +++ b/Templates/Full/game/tools/forestEditor/forestEditorGui.gui @@ -252,7 +252,7 @@ objectNamesOnly = "1"; useInspectorTooltips = "0"; tooltipOnWidthOnly = "0"; - compareToObjectID = "1"; + compareToObjectID = "0"; canRenameObjects = "1"; renameInternal = "0"; isContainer = "1";